queryTask = new esri.tasks.QueryTask(districtURL); var query = new esri.tasks.Query(); query.returnGeometry = true; query.outFields = ["*"]; query.where = "CITY_NAME = 'Washington'" query.outSpatialReference = map.spatialReference; queryTask.execute(query); dojo.connect(queryTask, "onComplete", queryResults);
function queryResults(featureSet){ console.log(featureSet.features.length); map.setExtent(featureSet.features[0].geometry);
Jay what's the spatialReference of map? you have set in query map.spatialReference but the map.spatialReference can be <> from spatialReference of your service if you have load in map how first layer (service) another service with spatial reference <> your service.
function queryResults(featureSet){ console.log(esri.geometry.webMercatorToGeographic(featureSet.features[0].geometry)); console.log(featureSet.features[0].geometry);
Jay what's the spatialReference of map? you have set in query map.spatialReference but the map.spatialReference can be <> from spatialReference of your service if you have load in map how first layer (service) another service with spatial reference <> your service.
Hi,
Even I am facing the same issue, what Jay has faced.
1. Task : Migrating of Arcgis server from 10.0 to 10.2.1
2. Development : Silverlight application version 5.0
3. All original map service layers render in correct location in the Map control
4. But after the using Query task on route event layer, the result objects are set to wrong projection system, it pans to the coast of Africa near Nigeria and Cameroon.
I have also set outSpatialReference [source from map] on query result features no use,
Any one can help on this, please...
Thanks
Sadanand