Geometry Task Project Bug

710
2
08-10-2011 01:56 PM
JulianoKersting
New Contributor III
Hello I'm having problems using the geometry service project method.

I get the following error: "
Message: 'spatialReference' is null or not an object
Line: 48
Char: 410823
Code: 0
URI: http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4
"

The code is very simple, I am just trying to project a mapPoint from projected (26911 ) UTM NAD81 Z11 to WGS84 (4326 ) using the geometry service.

                   

// explicit SR definition for input point
var ptUTM = new esri.geometry.Point(mapPoint.x, mapPoint.y, new esri.SpatialReference({ wkid: 26911 }));
                   
                    var outSR = new esri.SpatialReference({ wkid: 4326 });
                    var ptWGS;
                    gsvc.project(ptUTM, outSR, function (projectedPoints) {
                        ptWGS = projectedPoints[0];
                    });

Any Inputs?
0 Kudos
2 Replies
HemingZhu
Occasional Contributor III
Hello I'm having problems using the geometry service project method. 

I get the following error: " 
Message: 'spatialReference' is null or not an object 
Line: 48 
Char: 410823 
Code: 0 
URI:   http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4


The code is very simple, I am just trying to project a mapPoint from projected (26911 ) UTM NAD81 Z11 to WGS84 (4326 ) using the geometry service. 

  
// explicit SR definition for input point
var ptUTM = new esri.geometry.Point(mapPoint.x, mapPoint.y, new esri.SpatialReference({ wkid: 26911 }));
                    
                    var outSR = new esri.SpatialReference({ wkid: 4326 });
                    var ptWGS;
                    gsvc.project(ptUTM, outSR, function (projectedPoints) {
                        ptWGS = projectedPoints[0];
                    });

Any Inputs?



gsvc.project([ptUTM], outSR, function (projectedPoints) {
ptWGS = projectedPoints[0];
});


The first parameter is Geometry[].
0 Kudos
JulianoKersting
New Contributor III

The first parameter is Geometry[].


Thank you! Its working now.
0 Kudos