swenwaschk

show x,y coordinates, changing the number of decimal places

Discussion created by swenwaschk on Sep 10, 2011
Latest reply on Sep 10, 2011 by swenwaschk
Hi,

I'm working on an project using the ArcGIS API for JavaScript and i've added:
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);
        });


and further on i've added:
function showCoordinates(evt) {
        //get mapPoint from event
         var mp = evt.mapPoint;
        //display mouse coordinates
        dojo.byId("info").innerHTML = mp.x + ", " + mp.y;
    }


since my map is in wkid: 28992 (or RD new for the dutch people here) just showing 123456, 345678 instead of say 6 decimal places would by ideal.

But how do I do this?

Outcomes