rikke

FindResults return features in the wrong coordinate system

Discussion created by rikke on Jan 25, 2011
Latest reply on Feb 2, 2011 by rikke
Hi there,

I keep getting results from the FindTask that are in geographical coordinates (i.e. Lat/Long). The map is setup in Web Mercator (and uses Bing as a basemap), so I am expecting results in projected coordinates (i.e. Meters). The API explicitly states that results will be returned in the map coordinates if outSpatialReference is not defined for the Find task. Mine are not defined but results are not returned in the map coordinates.

To further complicate things, I have an Identify function running on the same feature layer (in the same application), and its results come back in web mercator!

Identify Params (works fine):
identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [0,4];
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;
identifyParams.width  = map.width;
identifyParams.height = map.height;


Find Params (dont work fine):
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.contains=true;
findParams.layerIds = [0];
findParams.searchFields = ['SERIAL_NO'];
findParams.searchText = dijit.byId('searchText').get('value');


I have now explicitly set outSpatialReference using FindParameters to wkid:102100, and the results are ok.

Any idea why the results arent being returned in the map coordinates automatically?

Also, perhaps worth noting, the datasets being queried are saved as "Spatial Reference: 4148".

Thanks,
Richard.

Outcomes