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); }); }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.