AnsweredAssumed Answered

Problems projecting a point

Question asked by hdaw on Jun 17, 2014
Latest reply on Jun 18, 2014 by JUihlein-esristaff
I am trying to display a point that is in UTM NAD83 Zone 11.  When I try to project the point to Web Mercator, the point's coordinates seem to revert to Null and display just West of Africa instead of in Western Canada where I want it.  I thought I had based my script on various online samples (including this post: http://forums.arcgis.com/threads/36983-geometry-task-project-bug), but clearly something is missing.  Here's part of the script (the entire script has been attached):


  //convert point's coordinates from UTM NAD83 zone11 to Universal Tranverse Meracator:
function getCoordinates() {    
         
   var easting = 422310.0;
          var northing = 5853918.0;  
    var newlong = null;
   var newlat = null;
   var newpoint = null;
        
    var inSR = new esri.SpatialReference({
              wkid: 26911         
   });

   var outSR = new esri.SpatialReference({
              wkid: 3857          
   });

   var geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
            var inputpoint = new esri.geometry.Point(easting, northing, inSR);    
     var PrjParams = new esri.tasks.ProjectParameters();
            PrjParams.geometries = [ inputpoint ];
     PrjParams.outSR = outSR;        
     geometryService.project(PrjParams, function(outputpoint) {
     newpoint = outputpoint[0];    
            });

          var point = new esri.geometry.Point(newpoint, outSR);    
          return point;
   
       };

Suggestions?
Heather

Attachments

Outcomes