Is there any way to calculate the extent of a KML layer loaded from the web using the KMLLayer({ url: "my file" }) method in ArcGIS Online?
The KMLs loaded AGOL have a valid fullExtent property, but ones loaded from other sources seem to default to the entire world, which is not useful.
Here is an example:
app.kml=new KMLLayer({ url: "my file" }); app.map.add(app.kml); app.kml.load().then(function() { app.mapView.extent=app.kml.fullExtent; console.log(app.kml) });
It is live at:
The console prints out the KMLLayer object, and the fullExtent field seems to be not set right.
Hi William, try importing the Kml features into Graphic Layers and use it extents.
regards
ashok
ok. I'll try that. Thanks!