AnsweredAssumed Answered

Show x,y coordinates in non-amd style

Question asked by dexconor on May 22, 2014
Latest reply on May 22, 2014 by dexconor
Hi,

I was trying to convert https://developers.arcgis.com/javascript/jssamples/map_xycoords.html to non-amd style
so far

http://jsfiddle.net/gv45L/

var dojoConfig = {                 parseOnLoad: true             } dojo.require("esri.map"); function init() {     var map;     center = [-97.345680, 39.612473];     zoom = 15;     map = new esri.Map("map", {         basemap: "topo",         center: center,         zoom: zoom,         sliderStyle: "large"     });          map.on("load", function() {           //after map loads, connect to listen to mouse move & drag events           map.on("mouse-move", showCoordinates);           map.on("mouse-drag", showCoordinates);         }); } function showCoordinates(evt) {           //the map is in web mercator but display coordinates in geographic (lat, long)           var mp = esri.geometry.webMercatorToGeographic(evt.mapPoint);           //display mouse coordinates           dom.byId("info").innerHTML = mp.x.toFixed(3) + ", " + mp.y.toFixed(3);         } dojo.addOnLoad(init);


but seems like I missed something.

Can anyone help me with this? Thank you

Outcomes