[OpenLayers-Dev] addOptions and redraw

Bart van den Eijnden bartvde at opengeo.org
Thu Apr 12 03:31:13 EDT 2012


Hi Eric,

the displacement issue was caused by calling display on the layer.

If I use setVisibility all is fine.

layer.setVisibility(layer.calculateInRange());

I'll open up a ticket for the alwaysInRange issue.

Best regards,
Bart

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



On Apr 11, 2012, at 7:43 PM, Bart van den Eijnden wrote:

> 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/20120412/68a5e95c/attachment.html


More information about the Dev mailing list