VIAMICHELIN JAVASCRIPT API


PolyLine

PolyLine is responsible for graphic object of polyline type. Launched via new and extends Layer.

Constructor

PropertyTypeDescriptionDefault
coords [GeoPoint] ou [[float], [float]] Array of geographical coordinates representing vertices of the polyline. N/A
strokeColor string Colour of the polyline stroke path in HTML hex style '#000'
strokeOpacity float Opacity of the polyline stroke path between 0.0 (fully transparent) and 1.0 (fully opaque). 1.0
strokeWeight int Pixel width of the polyline stroke path. 2
htm string HTML content to be displayed in the Info-bubble. ''

 

Methods

MethodsReturn valueDescription
getGeoBoundaries() [GeoPoint,GeoPoint] Returns the geographical coordinates of the polyline boundaries as north-west and south-east corners.
getPath() [GeoPoint] Retrieves vertices from the path.
setPath([GeoPoint] ou [[float], [float]]) - Replaces path vertices and automatically updates the polyline on the map.
getStrokeColor() string Retrieves current stroke colour of the polyline.
setStrokeColor(newColor: string) - Sets new stroke colour of the polyline.
getStrokeOpacity() float Retrieves current polyline stroke opacity.
setStrokeOpacity(newOpacity: float) - Sets new polyline stroke opacity.
getStrokeWeight() int Retrieves current polyline stroke width
setStrokeWeight(newWeight: int) - Sets new polyline stroke width.
setBubbleContent(htm: string) - HTML content to be displayed in the Info-bubble.

 

Events

EventsArgumentsDescription
onClick GeoPoint Fired when a mouse click takes place on the polyline.
onExpandOpen - Fired when polyline info-bubble is opened.
onExpandClose - Fired when polyline info-bubble is closed.

Back to top