Hi,
I want to add a Kml layer to a map. The data is string under kml format. I fought that the api allows to add a kml layer by giving it a URL, but I can't found un example adding a kml layer by reading it's content from a stream string.
Use case :
I have a kml file, I want to parse its content and add it to the map.
Thanks,
Maxim,
Have you tried the KML to Layer (Conversion) tool?
Hi,
I am using the ArcGis API for JavaScript. I am Parsing the kml file and get its content as an xml stream.
The Api allows to add a KML layer using an URL but unfortunalety I can't with an XML stream.
This is kind of a limitation of the ArcGis API,
require(["esri/map", "esri/layers/KMLLayer"],
function ( Map,KMLLayer ){
var kmladdress = kmlUrl; // ONLY THE URL ALLOWED HER , XML/KML STRING IS NOT WORKING
var kmlLayer = new KMLLayer(kmladdress);
_map.addLayer(kmlLayer);
}
);
So I you got any idea of how doing it please notify me,
Thanks,
Maxim
I've moved your post into the Arcgis API for
Javascript space. You will get a much better answer here as the GeoNet Help is intended for community
help and feedback. I have also added in a few additional tags. You can see more
on the community structure, and what topics are under each space from the following documents:
ArcGIS Discussion Forums Migration Strategy
Thanks!
Don