Select to view content in your preferred language

KML file read locally?

3248
5
Jump to solution
09-26-2013 12:59 AM
JessicaSena
Emerging Contributor
Hi,

I'm using KMLLayer in my app, and for what I've read in the documentation:

"To add a KML file(.kml or .kmz) to a map, the KML must be available via a publicly accessible URL. Locally hosted or KML files inside a firewall are not supported"

I understand is not possible to read KML file locally. So, my question is, somebody has achieved this by his own? and could point me in the right direction? Maybe with a costum layer?

And for the ESRI people, this behaviour is going to be implemented in future realeses of the SDK?

Thanks,
0 Kudos
1 Solution

Accepted Solutions
KeithTurner
Occasional Contributor
If it's simple kml, you might look into extracting the data from the kml file (just xml, but there's probably a kml library out there somewhere), populating it in a featureset and adding it as a feature collection based feature layer.  We're using this approach for data from a web service, but it should be the same basic idea for your situation - open data, add to feature set, add to feature layer.

Keith

View solution in original post

0 Kudos
5 Replies
DanO_Neill
Deactivated User


And for the ESRI people, this behaviour is going to be implemented in future realeses of the SDK?



Yes, we are planning to support file based KML in a future release.
0 Kudos
KeithTurner
Occasional Contributor
If it's simple kml, you might look into extracting the data from the kml file (just xml, but there's probably a kml library out there somewhere), populating it in a featureset and adding it as a feature collection based feature layer.  We're using this approach for data from a web service, but it should be the same basic idea for your situation - open data, add to feature set, add to feature layer.

Keith
0 Kudos
JessicaSena
Emerging Contributor
Thanks, I've found a good lib and following your suggestion it seems that will work 🙂
0 Kudos
AnsarRauf
New Contributor
Thanks, I've found a good lib and following your suggestion it seems that will work 🙂


Hey jessica can u share the lib you found for kml ? actually i also want to load kml locally, and also can u tell me that if your kml contains polylines data?
0 Kudos
JessicaSena
Emerging Contributor
hey,

is not exactly a "lib", I found de following code:

http://www.java2s.com/Open-Source/Android/android-core/platform-sdk/com/android/ddmuilib/location/Km...
http://www.java2s.com/Open-Source/Android/App/geopaparazzi/eu/hydrologis/geopaparazzi/gpx/parser/Gpx...

but for the moment I'm focus on the gpx parser, which is actually working, so cannot assure if the kml code is working or not...

Anyway, in case it was not useful for u, if you do some research on google I'm sure you'll find what you want (when I did it, I found a great amount of examples 🙂 )

Good luck!
0 Kudos