Class used to add and remove a Label on the MapView.

Labels contain text and an image that are anchored to a specific point on the map. They automatically rotate and show and hide based on priority and zoom level. Use them to inform users about location names, points of interest and more!

Effective use of labels allows an app to convey additional information to the user. For example labels can be used to show room names, important points of interest, main entrances or any other piece of contextual information that is useful to the user.

This class is accessed using MapView.Labels.

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

Methods

  • Adds a label (Label) to the map.

    Parameters

    Returns default.Label

    The created label, or undefined if creation failed.

    mapView.Labels.add(space, 'Welcome', { appearance: { color: 'blue' } });
    
  • Automatically adds all the labels (Label) to the map.

    The text, appearance, priority, etc. of the labels will be automatically determined based on the external data.

    Parameters

    • Optionaloptions: TAddLabelOptions

      Optional additional options for the labels, similar to those in the add method.

    Returns default.Label[]

    // Add all the labels to the map
    mapView.Labels.all();
  • Removes a label (Label) from the map.

    Parameters

    Returns void

    mapView.Labels.remove(space);
    
MMNEPVFCICPMFPCPTTAAATR