RouteHighlightColor Enumeration
The possible colors to use for highlighting a route on a map.
Public Enum RouteHighlightColor
Member of [Namespace]
[C#]
public enum RouteHighlightColor : System.Enum
Member of [Namespace]
Members
| Name | Description |
|---|---|
| Cyan | Cyan (greenish blue) highlight. |
| DefaultColor | Default highlight color for a MapOptions route highlight property. |
| Green | Green highlight (default for the MapOptions.RouteHighlightColor property). |
| Red | Red highlight (default for the MapOptions.ConstructionClosureHighlightColor property). |
| Yellow | Yellow highlight (default for the MapOptions.ConstructionDelayHighlightColor property). |
Remarks
- The RouteHighlightColor enumeration is used with the following properties of the MapOptions object: ConstructionClosureHighlightColor, ConstructionDelayHighlightColor, and RouteHighlightColor.
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, changing the route highlight colors
Dim myRouteViews(0) As ViewByHeightWidth
myRouteViews(0) = myRoute.Itinerary.View.ByHeightWidth
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Route = myRoute
mapSpec.Views = myRouteViews
mapSpec.Options = New MapOptions()
mapSpec.Options.ConstructionClosureHighlightColor = RouteHighlightColor.Green
mapSpec.Options.ConstructionDelayHighlightColor = RouteHighlightColor.Red
mapSpec.Options.RouteHighlightColor = RouteHighlightColor.Cyan
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, changing the route highlight colors
ViewByHeightWidth[] myRouteViews = new ViewByHeightWidth[1];
myRouteViews[0] = myRoute.Itinerary.View.ByHeightWidth;
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Route = myRoute;
mapSpec.Views = myRouteViews;
mapSpec.Options = new MapOptions();
mapSpec.Options.ConstructionClosureHighlightColor = RouteHighlightColor.Green;
mapSpec.Options.ConstructionDelayHighlightColor = RouteHighlightColor.Red;
mapSpec.Options.RouteHighlightColor = RouteHighlightColor.Cyan;
MapImage[] myMaps = renderService.GetMap(mapSpec);
See Also
MapOptions.ConstructionClosureHighlightColor Property | MapOptions.ConstructionDelayHighlightColor Property | MapOptions.RouteHighlightColor Property