VIAMICHELIN JAVASCRIPT API


Marker

Marker is responsible for graphic object of marker type (identifying single locations on the map). Launched via new and extends Layer.

Layer is the base class responsible for graphic objects displayed on the map. Not instanciated directly.

Constructor

PropertyTypeDescriptionDefault
coords GeoPoint Geographical coordinates of the marker. N/A
icon {url: string, offset: Point , size: Size} Defines an image to be used as the icon with offset relative to its top left corner. internal icon
shadowIcon {url: string, offset: Point, size: Size} Defines a shadow image with offset relative to the top left corner of the front icon.
autoOpen boolean Indicates whether info window is opened automatically. false
htm string HTML content to be displayed in the Info-bubble. -
title string Marker title displayed as rollover text. -
zIndex int Defines the value of the CSS z-index. 2
visibility boolean Indicates whether info window is displayed or not when added to the map. true
overlayText {text: string, offset: Point, style: object} Text displayed above the marker icon with offset from icon top left corner. style defines complementary CSS settings (in JavaScript notation) applied to the text. -
shapeCoords [[x:int, y:int],...] Coordinates of the hot area shape.

 

Methods

MethodsReturn valueDescription
getZindex() int Returns the value of the CSS z-index.
setZindex(z-index: int) - Sets the value of the CSS z-index.
getVisibility() boolean Returns the visibility status of the marker (can be true even if the marker is added to a map, so not visible).
setVisibility(visibility: boolean) - Sets the visibility level.
getOverlayText() string Retrieves current text displayed above the marker.
setOverlayText(text: string) - Changes text displayed above the marker.
getIcon() string Retrieves current marker icon URL.
setIcon(url: string) - Changes the marker icon URL.
getPosition() GeoPoint Gets current marker position.
setPosition(GeoPoint}) - Changes marker position.
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 marker.
onExpandOpen - Fired when info-bubble of the marker is opened.
onExpandClose - Fired when info-bubble of the marker is closed.
onMouseover - Fired when mouse starts being over the marker.
onMouseout - Fired when mouse ends being over the marker.

 

Back to top