API to add and remove floating labels on the map.
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, "Apple Store");
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
Remove a floating label from a single polygon or node.
// Remove the label currently on this polygon's first entrance
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
Resets the priority of an existing floating label (or labels, in the case of a polygon)
// Labels should now behave as they did by default
Update the appearance attributes of an already-existing label. If the provided polygon or node does not have a label already, this is a no-op.
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