[OpenLayers-Users] ZoomToExtent of KML File

Christopher Schmidt crschmidt at metacarta.com
Mon Sep 15 10:57:10 EDT 2008


On Mon, Sep 15, 2008 at 10:40:48AM -0400, Patrick Markiewicz wrote:
> When I do this, the getDataExtent() returns null.  Does the KML need to
> contain something specific for this to work?  Thanks.

I assume you create your layer, and then immediately call getDataExtent
on it, before the KML has loaded. Listen to the layer's loadend event,
and then call getDataExtent when it has loaded.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list