[OpenLayers-Users] ZoomToExtent of KML File

Patrick Markiewicz pmarkiewicz at sim-gtech.com
Mon Sep 15 11:43:54 EDT 2008


That worked.  Thanks.

-----Original Message-----
From: Christopher Schmidt [mailto:crschmidt at metacarta.com] 
Sent: Monday, September 15, 2008 10:57 AM
To: Patrick Markiewicz
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] ZoomToExtent of KML File

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