Load KmlDataset via URL without map visible

429
2
Jump to solution
02-18-2022 12:09 PM
jasonhartley
New Contributor

I'm working on an Android app and I've noticed that when I create a KmlDataset where a .kml file is fetched via URL (e.g. KmlDataset kmlDataset = new KmlDataset(url);), that the actual call to the URL is not performed until after the map is visible (i.e. the addDoneLoadingListener(runnable) isn't called until after the map is visible). I need the KML data to display a layer on the map, but I also need from it the polygons beforehand for the sake of a geofence computation.

Is there a way to force the KmlDataset to be loaded immediately rather than after the map is visible on the screen?

Fwiw, I have a "Lite" runtime license, if that makes a difference.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RamaChintapalli
Esri Contributor

HI,

KmlDataset is a loadable object. Can you try loading the kmldataset  (i.e call loadAsync) separately and get the required information before displaying it on the map.

Thanks
Rama

View solution in original post

2 Replies
RamaChintapalli
Esri Contributor

HI,

KmlDataset is a loadable object. Can you try loading the kmldataset  (i.e call loadAsync) separately and get the required information before displaying it on the map.

Thanks
Rama

jasonhartley
New Contributor

kmlDataset.loadAsync() did the trick. Thanks!

0 Kudos