[OpenLayers-Dev] getVisibility() gets true if the layer is invisible by maxResolution

Eric Lemoine eric.lemoine at camptocamp.com
Tue May 15 14:13:48 EDT 2012


On Tuesday, May 15, 2012, neffets wrote:

> I work with Openlayers 2.11.
>
> Here a Example:
>
> lyr = new OpenLayers.Layer.Vector("test", {
>   version: "1.1.0",
>   strategies: [new OpenLayers.Strategy.BBOX(), oSaveStrategyVG],
>   projection: new OpenLayers.Projection("EPSG:4326"),
>   maxResolution: 20,
>   eventListeners: {
>      "visibilitychanged": function() {
>        alert("visibility changed");
>      },
>   ...
> });
>
> In a Map Resolution over 20 the layer is invisible in the map, that's
> right.


The layer is out of range, not invisible. For a layer to be actually
displayed on the map it must be both visible and in range.



> But if I try lyr.getVisibility() I get 'true' in my option it must be
> 'false'.



-- 
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/20120515/73c4ca16/attachment.html


More information about the Dev mailing list