Search code examples
openlayers

OpenLayers - KML Vector Layer zIndexing reversed but switches on zoom in/out


I'm having an issue where the data layers within my kml vector layer are reversed so that I cannot see what should be the highest polygon because it is hidden below the lowest polygon. When I zoom in or out using the mouse-wheel some of them will re-align and become visible, but not all of them. What is going on?

var HPC = new OpenLayers.Layer.Vector("Day 1 QPF", {
            strategies: [new OpenLayers.Strategy.Fixed()],
            checkedGroup : 'HPC Precipitation Forecasts',
            sphericalMercator : true,
            rendererOptions : {zIndexing : true},
            projection : new OpenLayers.Projection("EPSG:4326"),
            visibility : true,
            protocol: new OpenLayers.Protocol.HTTP({
                url: "resource/hpc/QPF24hr_Day1_latest_netlink.kml",
                format: new OpenLayers.Format.KML({
                    extractStyles: true, 
                    extractAttributes: true,
                    maxDepth: 2
                })
            })
        });

        map.addLayer(HPC);

Solution

  • It turned out to be malformed KML that broke the layer. Still odd behavior...since it partially showed up.