[OpenLayers-Users] Callback for after a layer has loaded
Eric Lemoine
eric.lemoine at camptocamp.com
Mon Apr 6 11:59:33 EDT 2009
On Mon, Apr 6, 2009 at 5:46 PM, Nicholas Bergson-Shilcock
<nicholasbs at openplans.org> wrote:
> I have a GML layer that pulls in a KML file. After the layer has loaded, I'd
> like to run something like:
>
> map.zoomToExtent(layer.getDataExtent());
>
> Just running this right after I create and add the layer doesn't work because
> it runs before the layer has fully loaded. Using setTimeout() is hacky and
> unreliable. Is there a callback for doing this?
Yes, just listen to "loadend" on the layer.
--
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
More information about the Users
mailing list