[OpenLayers-Dev] Features added to vector layer don't rescale when map extent changes

Christopher Schmidt crschmidt at metacarta.com
Wed Aug 13 09:12:41 EDT 2008


On Tue, Aug 12, 2008 at 11:40:25PM -0400, David Fuhry wrote:
> I add a new OpenLayers.Layer.Vector to my map, several 
> OpenLayers.Feature.Vectors to that layer using 
> vector_layer.drawFeature(), then call map.zoomToExtent().  When the map 
> is zoomed, the vector features remain in a static state,  rendered for 
> the original extent, not the new zoomed extent.
> 
> I would like the features to be rescaled when the map is zoomed / 
> panned.  I've tried passing { isFixed: false } to the 
> OpenLayers.Layer.Vector constructor without success.  Is this not an 
> envisioned use case of a OpenLayers.Layer.Vector layer with manually 
> added features?

No, it's simply that this seems entirely wrong. Vectors should never
continue to display in the same place after zooming: at worst, they
might disappear, but they should never be *wrong*.

If you look at http://crschmidt.net/mapping/vectors.html , does it do
what you want? If you look at it, can you see what you're doing
differently that results in the different behavior?

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list