Share via


RenderServiceSoap.GetBestMapView Method

RenderServiceSoap.GetBestMapView Method

Creates a single, best map view for displaying a set of locations. A best map view is the largest scale map that can be centered over the set of locations while displaying the entire location along with a small buffer. Returns a MapViewRepresentations object for a specified Location object or array of Location[] objects.


Public Function GetBestMapView ( ByVal locations As
Location(), ByVal dataSourceName As System.String )
  As MapViewRepresentations



[C#]

public MapViewRepresentations GetBestMapView
  ( Location[] locations ,  System.String dataSourceName );

Parameters

  • locations
    An array of locations (Location[] objects) from which the Entity, BestMapView, or LatLong property is used to generate a best map view. Valid array size is 1 through 500.
  • dataSourceName
    A string representing the name of the data source (DataSource.Name property) for the locations. String.

Remarks

  • Largest scale map means that the map is zoomed in as close as possible.

Example

[Visual Basic]

'Get the best view of two locations
Dim myLocations(1) As Location
myLocations(0) = New Location()
myLocations(1) = New Location()
myLocations(0).LatLong = New LatLong()
myLocations(1).LatLong = New LatLong()
myLocations(0).LatLong.Latitude = 40
myLocations(0).LatLong.Longitude = -120
myLocations(1).LatLong.Latitude = 41
myLocations(1).LatLong.Longitude = -121

Dim renderService As New RenderServiceSoap()
Dim mapRepresentations As MapViewRepresentations
mapRepresentations = renderService.GetBestMapView(myLocations, "MapPoint.NA")



[C#]

//Get the best view of two locations
Location[] myLocations = new Location[2];
myLocations[0] = new Location();
myLocations[1] = new Location();
myLocations[0].LatLong = new LatLong();
myLocations[1].LatLong = new LatLong();
myLocations[0].LatLong.Latitude = 40;
myLocations[0].LatLong.Longitude = -120;
myLocations[1].LatLong.Latitude = 41;
myLocations[1].LatLong.Longitude = -121;

RenderServiceSoap renderService  = new RenderServiceSoap();
MapViewRepresentations mapRepresentations;
mapRepresentations = renderService.GetBestMapView(myLocations, "MapPoint.NA");


See Also

  RenderServiceSoap Class   |   MapViewRepresentations Class   |   Location Class   |   DataSourceCapability Enumeration   |   CommonServiceSoap.GetDataSourceInfo Method