[OpenLayers-Dev] addOptions and redraw

Bart van den Eijnden bartvde at opengeo.org
Wed Apr 11 13:43:27 EDT 2012


Just tested, using map.setCenter() does not work.

I guess it's because the code block is protected by zoomChanged and centerChanged, and none of them changed in this case.

https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Map.js#L1934

Would it not make sense to move this logic (visibility based on range) from the Map into the Layer? Ofcourse I am unaware of the history of all this.

I'll work on creating a minimal example to illustrate the issues first thing tomorrow morning.

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Apr 11, 2012, at 6:37 PM, Eric Lemoine wrote:

> On Wed, Apr 11, 2012 at 4:26 PM, Eric Lemoine
> <eric.lemoine at camptocamp.com> wrote:
>> On Wed, Apr 11, 2012 at 3:48 PM, Bart van den Eijnden
>> <bartvde at opengeo.org> wrote:
>>> Hey Eric,
>>> 
>>> right, what I am doing now is calling display in the following way:
>>> 
>>> layer.display(layer.calculateInRange());
>>> 
>>> but it feels a bit weird to do it this way.
>> 
>> 
>> Yes, that's ugly. We really provide a better way to handle your case.
> 
> Another thing you could try is call map.setCenter() (with no
> argument), this should turn off your out-of-range overlays.
> 
> Regarding the displacement issue I'm interested to exactly know how to
> reproduce it.
> 
> -- 
> 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/20120411/b181c78a/attachment.html


More information about the Dev mailing list