Share via


ViewByScale.MapScale Property

ViewByScale.MapScale Property

The denominator from a map scale ratio representing the number of units in the real world that a single unit on the map represents, as displayed on the screen and given the assumed resolution. Double. Default is 0.


Public MapScale As System.Double = 0



[C#]

public System.Double MapScale;

Remarks

  • For example, a ratio of 1:50,000 centimeters means that one centimeter on the screen represents 50,000 centimeters on the Earth. The MapScale property in this case is 50,000.

  • For information about map views, including display resolution and the relationship between scale and image size, see Working with Map Views.

  • MapPoint Web Service constrains the map view in terms of how far the map is zoomed out or zoomed in. The constraints vary per data source and map style. If the Scale property is set such that these limits are exceeded, the returned map image is modified to meet the limit and the MapImage.View property contains the returned view.

  • The minimum MapScale property value for rendering a map depends on the data source, the CenterPoint property, and the size of the map image (set in the MapOptions.Format property). If the MapScale property sent is smaller than is valid for a particular location and image size, MapPoint Web Service renders the map at the smallest possible scale and returns the MapScale property used in the MapImage.View property. To return a map of the smallest possible scale, set the MapScale property to 1.

  • The assumed resolution of pixels per inch in a rendered map image is 96 (MapPointConstants.AssumedDpi property).

Example

[Visual Basic]

'Get a map using scale
Dim myViews(0) As ViewByScale
myViews(0) = New ViewByScale()
myViews(0).CenterPoint = New LatLong()
myViews(0).CenterPoint.Latitude = 40
myViews(0).CenterPoint.Longitude = -120
myViews(0).MapScale = 5000

Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews

Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)



[C#]

//Get a map using scale
ViewByScale[] myViews = new ViewByScale[1];
myViews[0] = new ViewByScale();
myViews[0].CenterPoint = new LatLong();
myViews[0].CenterPoint.Latitude = 40;
myViews[0].CenterPoint.Longitude = -120;
myViews[0].MapScale = 5000;

MapSpecification mapSpec  = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;

MapImage[] mapImages;
mapImages = renderService.GetMap(mapSpec);


See Also

  ViewByScale Class   |   LatLong Class   |   Working with Map Views   |   MapOptions.Format Property   |   MapImage.View Property