Select to view content in your preferred language

Basemap errors when changing map spatial reference

2724
3
Jump to solution
05-13-2016 09:44 AM
SteveBurdette
Regular Contributor


I have a web application that is referencing several ArcGIS web services that all use spatial reference 26916.  When I set a custom extent in my map to force the map spatial reference to 26916 I am not able to use the streets basemap that I'm able to use with the default map spatial reference (3857).  The following instantiates the map correctly (with just a white background but all of the layers working correctly):

        var customExtentAndSpatialReference = new Extent({ "xmin": 360685, "ymin": 3344235, "xmax": 693879, "ymax": 3874530, "spatialReference": { "wkid": 26916 } });

        map = new Map("divMap", { "extent": customExtentAndSpatialReference });

but when I set the basemap to streets, like this:

        var customExtentAndSpatialReference = new Extent({ "xmin": 360685, "ymin": 3344235, "xmax": 693879, "ymax": 3874530, "spatialReference": { "wkid": 26916 } });

        map = new Map("divMap", { "extent": customExtentAndSpatialReference, "basemap": "streets" });

The map spatial reference is set to 3857.  When I add one of the feature layers (26916 srid) first and then try to use map.setBasemap("streets") to set the basemap it does not successfully set the basemap. 

Any suggestions or documentation on good basemaps to use with spatial reference 26916?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Steve,

  The issue is that the basemap used sets the maps WKID and LODs. The basemaps can not be re-projected as they are just tile/images of the map using the basemaps spatial reference. Re-projecting rasters is a very costly operation thus the basemap will not be re-projected. If your layers are in 26916 and they are not cached then they can re-projected on the fly by ArcGIS Server to match the basemaps WKID. This will have minor performance impact as your layers will have to re-projected when panning or zooming, but it is workable. The best solution is to create a child replicate of your data in WKID 102100 / 3857 and have a batch routine that runs nightly (assuming your data changes frequently). Esri has a whitepaper on this and I have used this method for years.

34129 - Create a replica where the child replica data is in a different coordinate system than the p...

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Steve,

  The issue is that the basemap used sets the maps WKID and LODs. The basemaps can not be re-projected as they are just tile/images of the map using the basemaps spatial reference. Re-projecting rasters is a very costly operation thus the basemap will not be re-projected. If your layers are in 26916 and they are not cached then they can re-projected on the fly by ArcGIS Server to match the basemaps WKID. This will have minor performance impact as your layers will have to re-projected when panning or zooming, but it is workable. The best solution is to create a child replicate of your data in WKID 102100 / 3857 and have a batch routine that runs nightly (assuming your data changes frequently). Esri has a whitepaper on this and I have used this method for years.

34129 - Create a replica where the child replica data is in a different coordinate system than the p...

SteveBurdette
Regular Contributor

Thank you Robert...very helpful answer. 

0 Kudos
PanagiotisPapadopoulos
Esri Regular Contributor

an another option is to create your basemap with 26916 WKID on your server. but because is difficult to find data for basemap it is better to follow Robert's suggestion.

The behavior you describing happening because the first layer loaded on the map setting the application/ map spatial reference.