how to retrieve coordiantes on mouse click

609
1
01-28-2011 03:35 AM
AbuDawud
New Contributor
I am very very new to this framework. I have managed to get a map up in a screen and I am hoping somebody can advise me on how to get the coordinates on a mouse click. There are a lot of features on the javascript API but I have no idea which one is the one that I need.

I have seen samples where you can click on the map and it brings up a point of interest but I want to actually close the map down on the click event and retrieve the coordinates.

Thanks in advance
0 Kudos
1 Reply
nicogis
MVP Frequent Contributor
map has event onclick where you can use event for get mapPoint or screenPoint

dojo.connect(map, "onClick", function(evt) {
    alert(evt.mapPoint.x + " " + evt.mapPoint.y);
});

0 Kudos