Using angular-cesium and cesium. ( but this part concern cesium)
I am trying to load a KML model from the internet. I have a server that host the file, and using a request I get the file in draw it into Cesium.
I am doing the same procedure on GLTF and it works fine, but KML fail.
So I load the file and then pass the text result to this function :
I think the problem is the way I load my KML into cesium,
I already have loaded the KML from my external service, so I have access to the content of the file already in my code. (like if I console.log(myKml) I can see the kml content).
so I need a way to add this content directly to cesium, without asking cesium to reload it.
If you’re passing in your KML content as a string, CesiumJS will interpret it as a URL and try to load it. I think you need to pass a parsed document, so it would look something like this:
var kmlContent = ‘…your kml as text…’;
var parser = new DOMParser();
var kmlDoc = parser.parseFromString(kmlContent, “text/xml”);