[OpenLayers-Dev] Use layer.inRange or layer.calculateInRange() ?

Eric Lemoine eric.lemoine at camptocamp.com
Mon Aug 24 02:20:36 EDT 2009

On Thursday, August 20, 2009, Ivan Grcic <ivan.grcic at geofoto.hr> wrote:
> Hi, quick question:
> whenever we have to exam layer's visibility we have to test inRange param.
> I saw that calculateInRange is called every time in map.moveTo() fn,
> and it sets layer.inRange param accordingly.

Is it also called from Layer.redraw(), itself called from setVisibility().

> Is it safe to just take inRange param, or its better to call
> calculateInRange() every time?

AFAICT Map.moveTo() and Layer.redraw() take care of calling
calculateInRange when it makes sense, so it should be safe to rely on
the inRange value elsewhere. But this needs to be considered on a case
by case basis.


More information about the Dev mailing list