Marker class
November 24, 2019 ยท View on GitHub
this.map.addMarker(options: MarkerOptions).then((marker: Marker) => {
});
API Reference
Instance methods
-
getId()
Returns the ID of instance.
:arrow_right: Returns
string -
getMap()
Return the map instance.
:arrow_right: Returns GoogleMap instance.
-
setPosition(position)
Set the marker position.
Params Type Details position ILatLng new position -
getPosition()
Returns the marker position.
:arrow_right: Returns ILatLng.
-
showInfoWindow()
Show the normal infoWindow of the marker.
-
hideInfoWindow()
Hide the normal infoWindow of the marker.
-
setAnimation(animation)
Specify the animation either
DROPorBOUNCE.Params Type Details animation string `DROP` or `BOUNCE` -
setDisableAutoPan(disableAutoPan)
Set true if you do not want to move the map when you click on the marker.
Params Type Details disableAutoPan boolean true or false -
setTitle(title)
Changes title of the normal infoWindow.
Params Type Details title string new title -
getTile()
Returns the current title strings.
:arrow_right: Returns
string. -
setSnippet(snippet)
Changes snippet of the normal infoWindow.
Params Type Details snippet string new snippet -
getSnippet()
Returns the current snippet strings.
:arrow_right: Returns
string. -
setIconAnchor(x, y)
Changes the info window anchor. This defaults to 50% from the left of the image and at the bottom of the image.
Params Type Details x number Distance from left of the icon image in pixels. y number Distance from top of the icon image in pixels. -
setInfoWindowAnchor(x, y)
Changes the info window anchor. This defaults to 50% from the left of the image and at the top of the image.
Params Type Details x number Distance from left of the icon image in pixels. y number Distance from top of the icon image in pixels. -
isInfoWindowShown()
Returns true if the infoWindow is shown on the marker
:arrow_right: Returns
boolean. -
setDraggable(draggable)
Set true if you allow all users to drag the marker.
Params Type Details draggable boolean true or false -
isDraggable(draggable)
Returns true if the marker drag is enabled.
:arrow_right: Returns
boolean. -
setFlat(flat)
Set true if you want the marker to become flat.
Params Type Details flat boolean true or false -
setIcon(icon)
Sets the marker's Icon.
Params Type Details icon MarkerIcon new image -
setOpacity(opacity)
Changes the opacity of the marker from 0.0 to 1.0
Params Type Details opacity number from 0.0 to 1.0 -
getOpacity()
Returns the marker rotation angle.
:arrow_right: Returns
number. -
setVisible(visible)
Set marker visibility
Params Type Details visible boolean true or false -
isVisible()
Returns true if the marker is visible.
:arrow_right: Returns
boolean. -
setZIndex(index)
Changes the marker zIndex order.
Params Type Details index number z-index -
getZIndex()
Returns the current marker zIndex.
:arrow_right: Returns
number. -
remove()
Remove the marker.