# How to get the the coordinate of a KML point?

**URL:** <https://community.cesium.com/t/how-to-get-the-the-coordinate-of-a-kml-point/3016>\
**Category:** CesiumJS\
**Created:** [September 2, 2015, 6:29pm UTC](https://community.cesium.com/t/how-to-get-the-the-coordinate-of-a-kml-point/3016 "2015-09-02T18:29:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilson1256](https://avatars.discourse-cdn.com/v4/letter/w/dfb087/32.png) [@wilson1256](https://community.cesium.com/u/wilson1256)\
**Post date:** [September 2, 2015, 6:29pm UTC](https://community.cesium.com/t/how-to-get-the-the-coordinate-of-a-kml-point/3016/1 "2015-09-02T18:29:30Z")

</div>

I have a project which load the Cesium map with several KML files. Some of them are KML point. Right now, I have to develop a method to answer the event when click on the KML point.  
Before this we had Google Earth and we have code like below:  
......  
......  
google.earth.addEventListener(ge.getGlobe(), 'dblclick', myEventHandler);  
......  
......  
var myEventHandler =function(event) {  
&nbsp;&nbsp;if(event.getTarget().getGeometry().getType() == "KmlPoint"){  
&nbsp;&nbsp;&nbsp;&nbsp;var target = event.getTarget();  
&nbsp;&nbsp;&nbsp;&nbsp;var description = target.getDescription();  
&nbsp;&nbsp;&nbsp;&nbsp;var objectId = target.getId();  
&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById("c\_ground\_amsl\_elevation").value = event.getAltitude()\*3.2808379;  
&nbsp;&nbsp;}  
......  
......

We used this event.getAltitude() to get the value we need. Is there any relevant function we could use in Cesium?

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [September 3, 2015, 6:20pm UTC](https://community.cesium.com/t/how-to-get-the-the-coordinate-of-a-kml-point/3016/2 "2015-09-03T18:20:52Z")

</div>

Hello,

Here is an event handler that will get the Cartesian3 position of a point on left click and writes it to the console.

var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);

handler.setInputAction(function(click) {

var pickedObject = viewer.scene.pick(click.position);

if (Cesium.defined(pickedObject)) {

console.log(pickedObject.id.position.getValue(viewer.clock.currentTime));

}

}, Cesium.ScreenSpaceEventType.LEFT\_CLICK);

``

Hope this helps!

-Hannah
