# \[cesium-dev\] learn Cesium and kml try

**URL:** <https://community.cesium.com/t/cesium-dev-learn-cesium-and-kml-try/1045>\
**Category:** CesiumJS\
**Created:** [March 5, 2014, 9:32pm UTC](https://community.cesium.com/t/cesium-dev-learn-cesium-and-kml-try/1045 "2014-03-05T21:32:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Hunter](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/scott_hunter/32/2006_2.png) [@Scott\_Hunter](https://community.cesium.com/u/Scott_Hunter)\
**Post date:** [March 5, 2014, 9:32pm UTC](https://community.cesium.com/t/cesium-dev-learn-cesium-and-kml-try/1045/1 "2014-03-05T21:32:44Z")

</div>

A few problems:

- `viewer.dataSource` should be `viewer.dataSources`.

- `loadKmz` expects a Blob. To load from a URL, use `loadUrl` instead.

---

<div class="post-metadata">

**Author:** ![Allen\_Song](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Allen\_Song](https://community.cesium.com/u/Allen_Song)\
**Post date:** [March 5, 2014, 9:54pm UTC](https://community.cesium.com/t/cesium-dev-learn-cesium-and-kml-try/1045/2 "2014-03-05T21:54:28Z")

</div>

Thanks Scott,

it works now, but the spatial features still looks hiding under the Bing map image even I didn’t include terrain data.

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [March 5, 2014, 9:55pm UTC](https://community.cesium.com/t/cesium-dev-learn-cesium-and-kml-try/1045/3 "2014-03-05T21:55:43Z")

</div>

Cesium KML support is still very much a work in progress, which is why it’s not part of the official Cesium release. If you can share the KML file you are trying to load, I can take a look at it and see what’s missing that we need to support.

---

<div class="post-metadata">

**Author:** ![Allen\_Song](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Allen\_Song](https://community.cesium.com/u/Allen_Song)\
**Post date:** [March 5, 2014, 10:27pm UTC](https://community.cesium.com/t/cesium-dev-learn-cesium-and-kml-try/1045/4 "2014-03-05T22:27:54Z")

</div>

Tried to attach the kml, kmz files several times, not work; don’t know why.

Actually I just use Google Earth to draw a polygon, lines and points. I will try to read KmlDataSource.js and also try to use Google Earth to create a kmz with z value. My kml file looks no z values.

---

<div class="post-metadata">

**Author:** ![Allen\_Song](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Allen\_Song](https://community.cesium.com/u/Allen_Song)\
**Post date:** [March 6, 2014, 3:56pm UTC](https://community.cesium.com/t/cesium-dev-learn-cesium-and-kml-try/1045/5 "2014-03-06T15:56:33Z")

</div>

To load spatial features on Cesium terrain is important for us. But I found usually the loaded features are under the ground or higher than the terrain height. They are not perfectly draped on the terrain. I can only think about is creating a WFS/WMS server and use cesium api to load WFS url. But this way, can I use both WMS server as base layer (for example Bing satellite image) and WFS server as my customized spatial data? The reason for using WFS sever is I wish can mouse select individual feature and get attribute values. So I can visualize my data on 3D. Thanks.

Allen

---

<div class="post-metadata">

**Author:** ![vaibhav\_kumar](https://avatars.discourse-cdn.com/v4/letter/v/f9ae1b/32.png) [@vaibhav\_kumar](https://community.cesium.com/u/vaibhav_kumar)\
**Post date:** [May 10, 2014, 6:18am UTC](https://community.cesium.com/t/cesium-dev-learn-cesium-and-kml-try/1045/6 "2014-05-10T06:18:25Z")

</div>

Hi,

I am also facing problem adding kmldatasources in the viewer.  
kmlDataSource.loadUrl('C:/xampp/htdocs/kmlcesium/Apps/Temp.kml').then(function(){  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert("555");  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;viewer.dataSources.add(kmlDataSource);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert("666");  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;viewer.homeButton.viewModel.command();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert("777")  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})

It alerts till 555

Regards,

vaibhav
