[OpenLayers-Dev] Issue with BBox resfactor and Vector Layer redraw() in v2.12

Eric Lemoine eric.lemoine at camptocamp.com
Mon Mar 19 17:29:22 EDT 2012


On Monday, March 19, 2012, Alex Cassells <ACassells at integrated-skills.com>
wrote:
> I am fairly new to OpenLayers and mapping in general but I have quite a
lot of js experience.  I am not sure if this is the correct forum to raise
this but I have been doing some investigation of some OpenLayers behaviors
and I thought I would raise what are some possible issues.  It is all to do
with resymbolising (restyling) vector layers and whether they reload data
and whether the resymbolisation takes affect.
>
> This was prompted by a stack overflow question on OpenLayers
http://stackoverflow.com/questions/9768430/openlayers-redraw-vector-layer-without-downloading-data-again/9770999#9770999
>
> It seems that there is an issue (with both v2.11 and v2.12) if you set
the BBox strategy resFactor to 1 and then resymbolise and redraw the Layer
you will always refresh the data from the server.  This is because the BBox
strategy logic infers (wrongly in my opinion) that the data is invalid and
needs to be refreshed.  I am happy looking at this and suggesting a
possible fix for this but this raised potentially a larger issue with
v2.12.  If you try to resymbolise a vector layer and then use
layer.redraw() to redraw the layer with the new style in v2.12 the redraw
does nothing, previously the layer.redraw() function would show the new
styling of the vector features.  In v2.12 you have to do something like pan
the map to make the changes take affect.  I presume this is a bug and the
redraw() function should show the layer with new symbols on the map (please
forgive me if I am wrong about this).


Hi. How old is your OpenLayers? The bug you describe sounds like a bug we
fixed 10 days ago. See <https://github.com/openlayers/openlayers/pull/312>

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20120319/be0daddc/attachment.html


More information about the Dev mailing list