Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS Runtime SDK for .NET

Set Initial Center and Scale

Download Samples Repository


Shows how to set the initial center and scale of the map (Map.InitialViewpoint).

"Desktop" "Store" "Phone" Available for Desktop, Store, Phone

Sample Code

<UserControl x:Class="ArcGISRuntime.Samples.Desktop.SetInitialCenterAndScale"
        <esri:MapView x:Name="MyMapView">
					<!--Center on San Diego, at scale 1:50,000, using coordinates in WGS84 spatial reference (4326)-->
					<esri:ViewpointCenter X="-117.15" Y="32.705" Scale="50000" SpatialReferenceID="4326" />
                    ServiceUri="" />
using System.Windows.Controls;

namespace ArcGISRuntime.Samples.Desktop
	/// <summary>
	/// Shows how to set the initial center and scale of the map (Map.InitialViewpoint).
	/// </summary>
	/// <title>Set Initial Center and Scale</title>
	/// <category>Mapping</category>
	public partial class SetInitialCenterAndScale : UserControl
		public SetInitialCenterAndScale()

			// Note: uncomment the following to set the initial center/scale of the map in code.
			//MyMapView.Map.InitialViewpoint = new Esri.ArcGISRuntime.Controls.Viewpoint(new MapPoint(-117.15,32.705,SpatialReferences.Wgs84), 50000); 
Feedback on this topic?