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); }); }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.