[OpenLayers-Users] Callback for after a layer has loaded

Nicholas Bergson-Shilcock nicholasbs at openplans.org
Mon Apr 6 11:46:13 EDT 2009


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?

Thanks,
  -Nick



More information about the Users mailing list