Show / Hide Table of Contents

Method SetSpatialReference

SetSpatialReference(SpatialReference)

Update the spatial reference for this map.

Declaration
public void SetSpatialReference(SpatialReference spatialReference)
Parameters
Type Name Description
SpatialReference spatialReference

The spatial reference to set.

Remarks

This method allows you to update the map's spatial reference. This can be useful, for example, if you want to specify a particular spatial reference for a programmatically created map, or if you want to change the spatial reference of a pre-authored web map or mobile map to match a custom basemap.

You can update the map’s spatial reference at any time, even after it has loaded or while it is rendering.

When the spatial reference changes, existing layers in the map that support reprojection need to update their content to display in the new coordinate system. This includes layers in the operational layers collection and the basemap.

The following layer types support reprojection based on the underlying web service:

  • Map Image Layer
  • WMS Layer

The following layer types support reprojection directly on the device:

  • Feature Layer (including Feature Collection Layer and Subtype Feature Layer)
  • Annotation and Dimension Layers
  • Dynamic Entity Layer
  • ENC Layer
  • Raster Layer
  • KML Layer

Reprojection on the device leads to additional CPU utilization, and if these layers contain a lot of data it could negatively impact rendering performance.

Tiled Layers are strictly bound to their tiling scheme's spatial reference and cannot be reprojected.

This includes:

  • ArcGIS Tiled and Vector Tiled Layers
  • WMTS Layers
  • Web Tiled Layers

You can inspect the layer’s LayerViewState to get information about the underlying error when these layers fail to render.

GeoView content, such as Graphics Overlays, Grids, Location Display, and the Geometry Editor, and operations, such as identify and set viewpoints, can handle updates to the map’s spatial reference. However, Image Overlays do not support reprojection and will not be rendered if their spatial reference does not match the map’s spatial reference.

See Also
Basemap

Applies to

Platforms and versions
TargetVersions
.NET300
.NET Windows300
.NET Android300
.NET iOS300
In this article
Provide feedback
Back to top Copyright © 2025 Esri.