AnsweredAssumed Answered

IdentifyTask + InfoWindow 'Zoomto' button using wrong spatial reference

Question asked by msereda on May 16, 2014
Latest reply on Oct 14, 2014 by bsvensson-esristaff
Hi

I'm using the following parameters in an identify task:

            var identifyParams = new IdentifyParameters();             identifyParams.tolerance = this.identifyTolerance;             identifyParams.returnGeometry = true;             identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_VISIBLE;             identifyParams.geometry = evt.mapPoint;             identifyParams.mapExtent = this.map.extent;          identifyParams.spatialReference = this.map.spatialReference;             identifyParams.width = this.map.width;             identifyParams.height = this.map.height;


Problem is, when I get the infoWindow when clicking on the map, I receive the following error:

Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 2151)

I'm struggling to understand where the wkid 4326 is coming from, as everything to and from the identifyTask is in 2151.  I've debugged the code to note that yes, 'this.map.spatialReference' is of wkid 2151.  I've logged the network traffic going to our ArcGIS Server, and yes, the request being sent includes a spatial reference of wkid 2151 in the URL.  I've looked at the MapService that it's doing the identify on, and the MapService is of wkid 2151.  I tried going right to the identify task right on the ArcGIS Server via a web browser, put in my variables at performed an Identify there, and it gave me back the right spatial reference as well.

Anyone have any idea where the 'geometry of wkid 4326' is coming from?

Outcomes