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

Eric Lemoine eric.c2c at gmail.com
Wed Aug 13 00:33:08 EDT 2008


Hi. You may want to try adding features with
vector_layer.addFeatures(features). Eric

2008/8/13, David Fuhry <dfuhry at acm.org>:
> 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?
>
> Thanks,
>
> Dave Fuhry
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list