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?
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.
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.
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?
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 🙂 )