Class Markers

Mappedin JS allows adding and removing Markers on a map. Markers are elements containing HTML that Mappedin JS anchors to a Door, Space, Coordinate or Node. They are automatically rotated and repositioned when the camera moves.

This class is accessed using MapView.Markers.

Refer to the Markers Guide for more information and interactive examples.

Methods

  • Adds a marker to the map.

    Parameters

    Returns Marker

    The created Marker, or undefined if creation failed.

    // Add an interactive Marker to the map with custom HTML content.
    mapView.Markers.add(coordinate, '<div>Marker Content</div>', { interactive: true });
  • Update the position of a marker with an animation.

    Parameters

    Returns Promise<void>

    A promise that resolves when the animation is complete.

    const marker = mapView.Markers.add(coordinate, '<div>Marker Content</div>');
    mapView.Markers.animateTo(marker, newCoordinate, { duration: 1000 });
  • Removes a marker from the map.

    Parameters

    Returns void

    mapView.Markers.remove(marker);
    
  • Remove all the markers from the map.

    Returns Marker[]

    mapView.Markers.removeAll();
    
  • Update the position of a marker.

    Parameters

    Returns void

    const marker = mapView.Markers.add(coordinate, '<div>Marker Content</div>');
    mapView.Markers.setPosition(marker, newCoordinate);
MMNEPVFCICPMFPCPTTAAATR