AnsweredAssumed Answered

increase significant digits for XY Click

Question asked by jay.kapalczynski on Feb 9, 2017
Latest reply on Feb 9, 2017 by jay.kapalczynski

I am using the code below to capture the XY coordinates when a user clicks on the map.


How can I adjust this for more significant digits?


Getting 36.25  I want 36.2545241


    map = new Map("map", {
        basemap: "topo",
        center: [-78.728, 37.649],
        zoom: 6
    map.on("load", function() {
        //after map loads, connect to listen to mouse move & drag events
        map.on("click", showCoordinates2);
    function showCoordinates2(evt) {
          //the map is in web mercator but display coordinates in geographic (lat, long)
          var mp = webMercatorUtils.webMercatorToGeographic(evt.mapPoint);
          var XCoordMap= (mp.x.toFixed(3));
          var YCoordMap = (mp.y.toFixed(3));
          var XYCoordMap = (XCoord + ", " + YCoord);
          document.getElementById("XCoord").value = (XCoordMap);
       document.getElementById("YCoord").value = (YCoordMap);