AnsweredAssumed Answered

Project UTM point to DD

Question asked by bulla_b on Feb 27, 2018
Latest reply on Feb 27, 2018 by bulla_b

Hi,

 

I'm trying to emulate the screen cap below into some JS.

 

 

In the SDK for Project there is no parameter specified for the Input Spatial Reference like there in the above screen cap of the Geometry Service I am using, so I'm not quite sure how I specify that in my JS.  Here is what I have so far:

 

view.on("click", function (event) {
              event.stopPropagation(); // overwrite default click-for-popup behavior
             
              // Get the coordinates of the click on the view
              var northing = event.mapPoint.y;
              var easting = event.mapPoint.x;

              var geomSer = new GeometryService("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer");
              var params = new ProjectParameters();
              params.geometries = [event];
              params.outSpatialReference = 4326;
             
              var newPoint = geomSer.project(params);

              view.popup.open({
                  // Set the popup's title to the coordinates of the location
                  title: "Latitiude: " + newPoint.y + ", Longitude: " + newPoint.x,
                  content:  "Northing: " + northing + ", Easting: " + easting,
                  location: event.mapPoint // Set the location of the popup to the clicked location
              });
          });

 

Any guidance is appreciated.

Outcomes