[OpenLayers-Dev] Issue with BBox resfactor and Vector Layer
redraw() in v2.12
ACassells at integrated-skills.com
Mon Mar 19 17:46:12 EDT 2012
This may well be my issue, I will check again and retest, apologies for the spam.
From: Eric Lemoine [eric.lemoine at camptocamp.com]
Sent: 19 March 2012 21:29
To: Alex Cassells
Cc: openlayers-dev at lists.osgeo.org
Subject: Re: [OpenLayers-Dev] Issue with BBox resfactor and Vector Layer redraw() in v2.12
On Monday, March 19, 2012, Alex Cassells <ACassells at integrated-skills.com<mailto: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>
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<mailto:eric.lemoine at camptocamp.com>
More information about the Dev