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