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

David Fuhry dfuhry at acm.org
Tue Aug 12 23:40:25 EDT 2008

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?

I notice the SVG renderer scales the features into screen coordinates. 
I'm willing to pay the performance hit of rescaling the features on each 
pan / zoom since I render a bounded number of them.  Or, maybe there is 
interest in an implementation which adds svg elements in native map 
coordinates and just modifies the svg viewBox="x y width height" 
attribute on zoom/pan, which leaves the rescaling to the browser.  I've 
had success building such an implementation like in the past.

I skimmed the mailing lists back to January without finding info on 
this.  Can someone point out where I've erred, or recommend the best way 
to implement this?


Dave Fuhry

More information about the Dev mailing list