Class: IWTruckAttributes

IWTruckAttributes

A class to easily show or hide truck attributes on a map.

new IWTruckAttributes(map)

Creates a new instance of IWTruckAttributes.
Parameters:
Name Type Description
map IWMap the map to show the truck attributes on.

Members


<static, constant> RESTRICTION_TYPE_HARD :number

This is a hard restriction
Type:
  • number

<static, constant> RESTRICTION_TYPE_SOFT :number

Residents and delivery traffic are allowed to drive on this road
Type:
  • number

Methods


hideTruckattributes()

Removes all TruckAttributes Markers from the map and sets truckAttributesDisplayed to false
Returns:
Type
void

isVisible()

Returns true if the TruckAttributes are shown on the map.
Returns:
Type
boolean

setClickHandler(handler)

Sets a handler function for clicks on truck attribute markers. After a click on the marker of a truck attribute, the handler is called with the marker, the truck attributes for this road segment, the geometry of the segment as an array of coordinates, the click event, and the OpenLR code of the road segment. Example:
let truckAttributes = new IWTruckAttributes(map);
truckAttributes.setClickHandler((marker, attributes, coordinates, event, openLR) => {
    console.log(marker, attributes, coordinates, event, openLR);
});
truckAttributes.showTruckattributes();
Parameters:
Name Type Description
handler function Your click handler
Returns:
Type
void

setZoomLevelThreshold(threshold)

Sets the max ZoomLevel for drawing the TruckAttributes
Parameters:
Name Type Description
threshold int
Returns:
Type
void

showRestrictionTypes(types)

Sets the restriction types to show in the map (see constants RESTRICTION_TYPE_HARD and RESTRICTION_TYPE_SOFT). To turn on both hard and soft restrictions call
let truckAttributes = new IWTruckAttributes(map);
truckAttributes.showRestrictionTypes([
	IWTruckAttributes.RESTRICTION_TYPE_HARD,
	IWTruckAttributes.RESTRICTION_TYPE_SOFT
]);
truckAttributes.showTruckattributes();
At least one type must be present, use hideTruckattributes() to completely turn off truck attributes.
Parameters:
Name Type Description
types Array.<number> the types to show
See:
Returns:
Type
void

showTruckattributes()

Show TruckAttribute on the map
Returns:
Type
void