Class Markers

Methods

  • Adds a marker to the map.

    Parameters

    Returns Marker

    The created Marker, or undefined if creation failed.

    // Add an interactive {@link Marker} to the map with custom HTML content.
    map.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 = map.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[]

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

    Parameters

    Returns void

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