Interface IFloatingLabels<T>

API to add and remove floating labels on the map.

Type Parameters

  • T = void

Hierarchy

  • IFloatingLabels

Implemented by

Methods

  • Add a floating label to a single polygon or node. When labelling a polygon, all entrance nodes of that polygon receive a label.

    // Label the apple store with the label "Apple Store"
    const location = mapView.venue.locations.find((l) => l.name === "Apple")!;
    mapView.FloatingLabels.add(location.nodes[0], "Apple Store");

    Parameters

    Returns T

  • 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 T

  • 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 T

  • Resets the priority of an existing floating label (or labels, in the case of a polygon)

    mapView.FloatingLabels.setPriority(polygon0, 0);
    mapView.FloatingLabels.setPriority(polygon1, 1);

    ...

    // Labels should now behave as they did by default
    mapView.FloatingLabels.resetPriority();

    Parameters

    Returns T

  • 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 T