Class FloatingLabels

API to add and remove floating labels on the map.

Hierarchy

  • FloatingLabels

Implements

Methods

  • Add a floating label to one entrance node of each polygons associated with all locations on the venue. The text is automatically determined based on location data.

    // Draw red labels with black outlines on an entrance node of all polygons with a location
    mapView.FloatingLabels.labelAllLocations({
    appearance: {
    text: {
    foregroundColor: 'red',
    backgroundColor: 'black',
    }
    }
    });

    Parameters

    Returns void

  • Remove all floating labels from the venue.

    mapView.FloatingLabels.add(polygon, "Label 1");
    mapView.FloatingLabels.add(node, "Label 2");

    ...

    // Remove all labels from all polygons
    mapView.FloatingLabels.removeAll();

    Returns void

  • Updates the priority of an existing floating label (or labels, in the case of a polygon). This controls whether it is preferred over other labels during collisions.

    // Polygon 1's label should always show above polygon 2's label
    mapView.FloatingLabels.setPriority(polygon0, 0);
    mapView.FloatingLabels.setPriority(polygon1, 1);

    Parameters

    Returns void