bcward79

Map without initial extent uses WKT for requests rather than WKID

Discussion created by bcward79 on Dec 3, 2012
Latest reply on Dec 3, 2012 by bcward79
We are running into an issue while upgrading our JSAPI stack for Data Basin (www.databasin.org) to version 3.2

We have found that when you create a JSAPI map (e.g., per JSAPI sample: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/map_terraindemographic.html)

All requests to the operational layer use the WKID of the map's spatial reference for the export image request.  For example (URL decoded for clarity):
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer/export?dpi=96&transparent=true&format=png8&bbox=209489.36673707538,5936750.945900621,4123065.214937059,7876416.975664739&bboxSR=102100&imageSR=102100&size=1600,793&f=image

However, if you comment out the line that sets the initial extent of the map, when the map object is created

map = new esri.Map("map",{
    //extent:esri.geometry.geographicToWebMercator(initExtent)
});


The map still initializes fine, but all export image requests use WKT instead.  For example (url decoded):
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer/export?dpi=96&transparent=true&format=png8&bbox=-46962910.178399995,-31308606.7856,46962910.178399995,31308606.7856&bboxSR={"wkt":"PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Mercator_Auxiliary_Sphere\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0],PARAMETER[\"Standard_Parallel_1\",0.0],PARAMETER[\"Auxiliary_Sphere_Type\",0.0],UNIT[\"Meter\",1.0]]"}&imageSR={"wkt":"PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Mercator_Auxiliary_Sphere\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0],PARAMETER[\"Standard_Parallel_1\",0.0],PARAMETER[\"Auxiliary_Sphere_Type\",0.0],UNIT[\"Meter\",1.0]]"}&size=600,400&f=image

Which makes for very large requests, and breaks some of our back-end servers which have implemented the ArcGIS server REST API (to serve NetCDF format files using a custom server).

In both cases, the map.spatialReference parameter looks identical (uses WKID 102100)

Why is this?  Is there another configuration parameter we should be using?

EDIT:
This is related to the wrapAround180 property set when the map is created, and the map being within or outside world extent.
If you turn off wrapAround180 (it defaults to true in the JSAPI now), this issue does not occur.
If you leave it on, but set an extent within world bounds, this issue does not occur.  If you zoom out beyond world extent, this issue DOES occur.

Outcomes