Pushpin.IconDataSource Property
The name of the data source that contains the pushpin icon. String.
Public Dim IconDataSource As String
Member of [Namespace].Pushpin
[C#]
public System.String IconDataSource
Member of [Namespace].Pushpin
Remarks
- The IconDataSource property is required.
- The MapPoint Web Service stock set of icons is located in the MapPoint.Icons data source. For the MapPoint Web Service stock icon images and names, see MapPoint.Icons Data Source.
- As a MapPoint Web Service customer, you can upload your own icon images to a custom data source on the MapPoint Web Service server for use with MapPoint Web Service. For more information about data requirements and procedures for uploading your icons, see the Help topic Prepare source icons for uploading in the MapPoint Web Service Customer Services Web site (https://mappoint-css.partners.extranet.microsoft.com/cscv3/). For information on how to access the site, read the customer information that you received when you enrolled in the service.
Example
[Visual Basic]
'This example assumes that the service instances
''routeService' and 'renderService' have already
'been created and that the MapPoint Web Service namespace
'has been imported
'Route between two locations
Dim latLongs(1) As LatLong
latLongs(0) = New LatLong()
latLongs(1) = New LatLong()
latLongs(0).Latitude = 40
latLongs(0).Longitude = -120
latLongs(1).Latitude = 41
latLongs(1).Longitude = -121
Dim myRoute As Route
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest)
'Get a map of the route and add pushpins to the start and end
Dim myRouteViews(0) As ViewByHeightWidth
myRouteViews(0) = myRoute.Itinerary.View.ByHeightWidth
Dim myPushpins(1) As Pushpin
myPushpins(0) = New Pushpin()
myPushpins(0).IconDataSource = "MapPoint.Icons"
myPushpins(0).IconName = "31"
myPushpins(0).Label = "Start"
myPushpins(0).LatLong = latLongs(0)
myPushpins(1) = New Pushpin()
myPushpins(1).IconDataSource = "MapPoint.Icons"
myPushpins(1).IconName = "29"
myPushpins(1).Label = "End"
myPushpins(1).LatLong = latLongs(1)
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Route = myRoute
mapSpec.Pushpins = myPushpins
mapSpec.Views = myRouteViews
Dim myMaps() As MapImage
myMaps = renderService.GetMap(mapSpec)
[C#]
//This example assumes that the service instances
//'routeService' and 'renderService' have already
//been created and that the MapPoint Web Service namespace
//has been imported
//Route between two locations
LatLong[] latLongs = new LatLong[2];
latLongs[0] = new LatLong();
latLongs[1] = new LatLong();
latLongs[0].Latitude = 40;
latLongs[0].Longitude = -120;
latLongs[1].Latitude = 41;
latLongs[1].Longitude = -121;
Route myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest);
//Get a map of the route and add pushpins to the start and end
ViewByHeightWidth[] myRouteViews = new ViewByHeightWidth[1];
myRouteViews[0] = myRoute.Itinerary.View.ByHeightWidth;
Pushpin[] myPushpins = new Pushpin[2];
myPushpins[0] = new Pushpin();
myPushpins[0].IconDataSource = "MapPoint.Icons";
myPushpins[0].IconName = "31";
myPushpins[0].Label = "Start";
myPushpins[0].LatLong = latLongs[0];
myPushpins[1] = new Pushpin();
myPushpins[1].IconDataSource = "MapPoint.Icons";
myPushpins[1].IconName = "29";
myPushpins[1].Label = "End";
myPushpins[1].LatLong = latLongs[1];
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Route = myRoute;
mapSpec.Pushpins = myPushpins;
mapSpec.Views = myRouteViews;
MapImage[] myMaps = renderService.GetMap(mapSpec);
See Also
Pushpin Class | MapPoint.Icons Data Source