I'm using the ArcGIS API for JavaScript to query features in a web map. After sending an identify request to my ArcGIS Server 10.2.2 Map Service (added as ArcGISDynamicMapServiceLayer
, the response is missing a spatialReference object, which in my application causes the parsed feature to default to WGS 1984 (EPSG: 4326).
This is my request:
Notably, is specifyes using the Spherical Mercator projection (Google/OSM etc) in these three parameters:
sr: 102100,
geometry:{"x":1452552.552270479,"y":7513080.65512973,"spatialReference":{"wkid":102100}}
mapExtent:{"xmin":1400269.6249234888,"ymin":7501309.352773828,"xmax":1547028.7192308295,"ymax":7531884.164087858,"spatialReference":{"wkid":102100}}
The response comes back like this (indented for legibility):
{
"results": [{
"layerId":1,
"layerName":"MyLayer",
"displayFieldName":"objectTitle",
"value":"TestTitle",
"attributes": {
"geom":"Polygon",
"objectTitle":"TestTitle",
"ESRI_OID":"5"
},
"geometryType":"esriGeometryPolygon",
"geometry": {
"rings": [
[
[1454668.8173357714,7517201.4526984785],
[1455184.6049274686,7515021.5271282298],
[1454315.3831670529,7513419.0967461951],
[1453618.9498499723,7512120.8890253156],
[1452935.2001523944,7510514.1489123777],
[1452177.4970599019,7510191.5673684804],
[1450715.0293152332,7515680.0804733364],
[1453744.8112331014,7517255.1012338968],
[1454668.8173357714,7517201.4526984785]
]
]
}
}]
}
The same request sent to my ArcGIS Server 10.2.1 server returns the same response but with a spatialReference at the end of the feature:
{
"results": [{
"layerId":1,
"layerName":"MyLayer",
"displayFieldName":"objectTitle",
"value":"TestTitle",
"attributes": {
"geom":"Polygon",
"objectTitle":"TestTitle",
"ESRI_OID":"5"
},
"geometryType":"esriGeometryPolygon",
"geometry": {
"rings": [
[
[1454668.8173357714,7517201.4526984785],
[1455184.6049274686,7515021.5271282298],
[1454315.3831670529,7513419.0967461951],
[1453618.9498499723,7512120.8890253156],
[1452935.2001523944,7510514.1489123777],
[1452177.4970599019,7510191.5673684804],
[1450715.0293152332,7515680.0804733364],
[1453744.8112331014,7517255.1012338968],
[1454668.8173357714,7517201.4526984785]
]
],
"spatialReference":{"wkid":102100,"latestWkid":3857}
}
}]
}
Could there be something wrong with my request or is there a server/service option I've missed?