MapSpecification.DataSourceName Property
A string representing the name of the data source (DataSource.Name property) to use to render a map. String. Required.
Public Dim DataSourceName As String
Member of [Namespace].MapSpecification
[C#]
public System.String DataSourceName
Member of [Namespace].MapSpecification
Remarks
The data source must have a DataSource.Capability property value of CanDrawMaps.
Note If rendering a route, the DataSource.Capability property value must be CanRoute and the route must be rendered using the same data source that was used to create the route.
To return the properties of a data source, use the CommonServiceSoap.GetDataSourceInfo method.
For a table of the MapPoint Web Service data sources and the functions they are capable of performing, see MapPoint Web Service Data Sources and Capabilities.
Routing is limited to areas for which the specified data source has street and/or major road information. For more information, see MapPoint.BR Data Source, MapPoint.EU Data Source and MapPoint.NA Data Source.
Example
[Visual Basic]
'This example assumes that the service instance
''renderService' has already been created and that
'the MapPoint Web Service namespace has been imported
'Get a map using height and width
Dim myViews(0) As ViewByHeightWidth
myViews(0) = New ViewByHeightWidth()
myViews(0).CenterPoint = New LatLong()
myViews(0).CenterPoint.Latitude = 40
myViews(0).CenterPoint.Longitude = -120
myViews(0).Height = 200
myViews(0).Width = 300
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews
Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)
[C#]
//This example assumes that the service instance
//'renderService' has already been created and that
//the MapPoint Web Service namespace has been imported
//Get a map using height and width
ViewByHeightWidth[] myViews = new ViewByHeightWidth[1];
myViews[0] = new ViewByHeightWidth();
myViews[0].CenterPoint = new LatLong();
myViews[0].CenterPoint.Latitude = 40;
myViews[0].CenterPoint.Longitude = -120;
myViews[0].Height = 200;
myViews[0].Width = 300;
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
MapImage[] mapImages;
mapImages = renderService.GetMap(mapSpec);
See Also
MapSpecification Class | DataSource.Name Property | DataSource.Capability Property | CommonServiceSoap.GetDataSourceInfo Method | MapPoint Web Service Data Sources and Capabilities