[OpenLayers-Users] Vector layer not redraw correctly when zooming

Max Demars burton449geo at gmail.com
Fri Dec 12 12:01:35 PST 2014


Hi,

I load an external GeoJSON file into a vector layer and add it to the map:

geojson_layer = new OpenLayers.Layer.Vector("GeoJSON", {
        strategies: [new OpenLayers.Strategy.Fixed()],
        protocol: new OpenLayers.Protocol.HTTP({
            url: "json/CS_Fr_St_General.json",
            format: new OpenLayers.Format.GeoJSON()
        })
    });

olmap.addLayer(geojson_layer);

When I zoom in or out, the old drawings of the geojson are not removed and
the new one is added over it.

I suppose there is a setting in olmap that prevent the geojson to be
refreshed/redrawn when zooming but I dont know how to fix it.

You can inspect the olmap and the geojson_layer in the debug tool from this
address

https://carto48dev.mels.gouv.qc.ca/Infogeo/test/window.html

Thanks for your help
-Max Demars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20141212/b87b0258/attachment.html>


More information about the Users mailing list