MapOptions.ConstructionClosureHighlightColor Property

The highlight color (RouteHighlightColor enumeration) to use for parts of a route where stops or closure due to construction can be expected. Default is DefaultColor (red).

Public Dim ConstructionClosureHighlightColor As [Namespace].RouteHighlightColor
    Member of [Namespace].MapOptions
[C#]
public [Namespace].RouteHighlightColor ConstructionClosureHighlightColor
    Member of [Namespace].MapOptions

Remarks

  • MapPoint Web Service determines where to apply the ConstructionClosureHighlightColor property based on a Direction.Action property value of ConstructionStop.
  • The ConstructionClosureHighlightColor property is valid only for routes created using the MapPoint.NA data source.
  • To set the highlight color for the portions of a route that do not have construction warnings, use the RouteHighlightColor property.
  • To set the highlight color for parts of a route where delays due to construction can be expected, use the ConstructionDelayHighlightColor property.

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 Class | RouteHighlightColor Enumeration | Direction.Action Property