function initUI(response) { dojo.connect(response.map, "onClick", showCoordinates); ... function showCoordinates(evt) { var mp = esri.geometry.webMercatorToGeographic(evt.mapPoint); alert(mp.x.toFixed(3) + ", " + mp.y.toFixed(3)); }
if (map.loaded) { initUI(response); } else { dojo.connect(map, "onLoad", function () { //after map loads, connect to listen to mouse move & drag events dojo.connect(map, "onMouseMove", showCoordinates); dojo.connect(map, "onMouseDrag", showCoordinates); initUI(response); }); }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.