KML/KMZ assets are not loading in Cesium ION map

Hello
I am able to see preview of 3DTiles, Imagery, Terrain type of assets in the map but not able to see preview of KML/KMZ files.

When i click on any KML file, it is showing loader as shown in the attachment.
image
Please do the need full.

1 Like

i am actually new to cesium but according to me you have to convert .kml to 5 of the types that ion supports viewing. 3D tiles , imagery, gLTF, native or terrian. upload your kml file and cesium choose the option in a form you want your kml to get converted and cesium will interally create a tiling pipeline and do the need full for you. Also if you have the option for setting up tileset location click on it and choose zoom to option which will diretly zoom to your tileset and give you the proper view.
for more you can take help of the given link below

@rakhishah. It is possible to visualize KML files directly with Cesium. Can you try clicking “Open complete code example” under the preview window there? That should give you a sharable Sandcastle link. Do you see any errors printed using that? Can you share that link here?

Hey @oma,

I am able to see KMLs from SandCastle.
But for one of the KMLs it is displaying console error.
Link: https://sandcastle.cesium.com/?src=Hello%20World.html&label=Showcases&code=eyJjb2RlIjoiLy8gR3JhbnQgQ2VzaXVtSlMgYWNjZXNzIHRvIHlvdXIgaW9uIGFzc2V0c1xuQ2VzaXVtLklvbi5kZWZhdWx0QWNjZXNzVG9rZW4gPSBcImV5SmhiR2NpT2lKSVV6STFOaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpxZEdraU9pSm1aR1F5WW1Wak1TMDNZVEl6TFRRMk5HRXRPVEF3T1MweFpHWXpOV0ZqWmpjMk5qQWlMQ0pwWkNJNk1USTRMQ0pwWVhRaU9qRTBPVEUxTmpJME56ZDkuejlIdUdsN0dTT1U1R0pNSlhnLWMza2V3RmM1QUM2c2REaWF1OXltMlRSb1wiO1xuXG52YXIgdmlld2VyID0gbmV3IENlc2l1bS5WaWV3ZXIoXCJjZXNpdW1Db250YWluZXJcIik7XG5cbnZhciBwcm9taXNlID0gQ2VzaXVtLklvblJlc291cmNlLmZyb21Bc3NldElkKDI4NDY4KVxuICAudGhlbihmdW5jdGlvbiAocmVzb3VyY2UpIHtcbiAgICByZXR1cm4gQ2VzaXVtLkttbERhdGFTb3VyY2UubG9hZChyZXNvdXJjZSwge1xuICAgICAgY2FtZXJhOiB2aWV3ZXIuc2NlbmUuY2FtZXJhLFxuICAgICAgY2FudmFzOiB2aWV3ZXIuc2NlbmUuY2FudmFzLFxuICAgIH0pO1xuICB9KVxuICAudGhlbihmdW5jdGlvbiAoZGF0YVNvdXJjZSkge1xuICAgIHJldHVybiB2aWV3ZXIuZGF0YVNvdXJjZXMuYWRkKGRhdGFTb3VyY2UpO1xuICB9KVxuICAudGhlbihmdW5jdGlvbiAoZGF0YVNvdXJjZSkge1xuICAgIHJldHVybiB2aWV3ZXIuem9vbVRvKGRhdGFTb3VyY2UpO1xuICB9KVxuICAub3RoZXJ3aXNlKGZ1bmN0aW9uIChlcnJvcikge1xuICAgIGNvbnNvbGUubG9nKGVycm9yKTtcbiAgfSk7XG4iLCJodG1sIjoiPHN0eWxlPlxuICBAaW1wb3J0IHVybCguLi90ZW1wbGF0ZXMvYnVja2V0LmNzcyk7XG48L3N0eWxlPlxuPGRpdiBpZD1cImNlc2l1bUNvbnRhaW5lclwiIGNsYXNzPVwiZnVsbFNpemVcIj48L2Rpdj5cbjxkaXYgaWQ9XCJsb2FkaW5nT3ZlcmxheVwiPlxuICA8aDE+TG9hZGluZy4uLjwvaDE+XG48L2Rpdj5cbjxkaXYgaWQ9XCJ0b29sYmFyXCI+PC9kaXY+XG4ifQ==

@rakhishah your KML file is loading successfully, it’s just invisible.

All of your lines have the following tag on them <visibility>0</visibility>. You need to change them to <visibility>1</visibility>.

The lines do have <gx:labelVisibility>1</gx:labelVisibility> but that extension is not supported in CesiumJS. You will also need to add the tessellation flag to your lines to allow them to be clamped to the ground, see: https://github.com/CesiumGS/cesium/issues/8760.

Thank You @omar.
After making visibility and tessellation flag related changes, KML is loading in Cesium ION map.

1 Like