Setting Spatial Reference to a newly created map

547
3
Jump to solution
04-25-2020 03:54 AM
Vidar
by
Occasional Contributor II

This is a basic question - but seem to be having a hard time getting an answer from the online help.

I want to set a coordinate system when I make a new map pane. You cannot seem to specify when you use the MapFactory and once the map is made the SpatialReference property is readonly.

Could someone point me in the right direction to change or set the spatial ref of a map.

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

The method is on the Map class.  SetSpatialReference method.

Thanks

Uma

View solution in original post

0 Kudos
3 Replies
UmaHarano
Esri Regular Contributor

The method is on the Map class.  SetSpatialReference method.

Thanks

Uma

0 Kudos
Vidar
by
Occasional Contributor II

I'm embarrassed how I missed that!

0 Kudos
by Anonymous User
Not applicable

Sample:

var mv = MapView.Active;
Map m = mv.Map;
var WkidValue = 4326;
m.SetSpatialReference(SpatialReferenceBuilder.CreateSpatialReference(WkidValue));

 

0 Kudos