On Mon, Apr 06, 2009 at 11:46:13AM -0400, Nicholas Bergson-Shilcock 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?

layer.events.register("loadend", layer, function() {
this.map.zoomToExtent(this.getDataExtent()) } );

> Thanks,
>   -Nick
> _______________________________________________
> Users mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to