Constructor

Marker
(
  • MapView
  • options
)

Parameters:

  • MapView Object

    mapView The MapView this Marker will be added to.

  • options Object

    Object

    • html

      The body of the Marker. You can put any HTML in here you like.

    • position

      Where on the map the Marker should be anchored. You need to use one of the MapView.getPositionX functions to get a position.

    • [class] optional

      The name of the CSS class the Marker should inherit.

    • [map=mapView.currentMap] optional

      The map the Marker is attached to.

    • [MarkerBuffer=2] optional

      Keep this much space between this Marker and other nearby Markers.

    • [lockToAnchor=false] optional

      Make the Marker stay firmly attached to its anchor and not get pushed away by other Markers or camera movement. Still hits other Markers.

    • [ignoreCollisions=false] optional

      Allow other Markers to overlap this Marker. Combine with lockToAnchor=true to completely opt out of the physics engine for this Marker.

    • [rotateWithCamera=false] optional

      Make the Marker rotate with the rotation of the camera.

    • [rotation=0] optional

      Set the initial rotation of the Marker. Use this, combined with rotateWithCamera=true to create turn indicators that always point the right direction.

A Marker is a div with whatever HTML you provide, anchored it to a position in 3D space. It will always maintain the same size on the screen. Make your own and add it directly to the map with createMarker, or use the constructor and add it when you want.

You will need to specify at least options.html and options.position to have a useful Marker.

Show: