Skip to main content

<PointAnnotation />

PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.

Consider using ShapeSource and SymbolLayer instead, if you have many points, and you have static images,
they'll offer much better performance.

If you need interactive views please use MarkerView,
as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.

Props

PropTypeDefaultRequiredDescription
idstringnonetrueA string that uniquely identifies the annotation
titlestringnonefalseThe string containing the annotation’s title. Note this is required to be set if you want to see a callout appear on iOS.
snippetstringnonefalseThe string containing the annotation’s snippet(subtitle). Not displayed in the default callout.
selectedbooleannonefalseManually selects/deselects annotation
draggablebooleanfalsefalseEnable or disable dragging. Defaults to false.
coordinateArraynonetrueThe center point (specified as a map coordinate) of the annotation.
anchorshape{ x: 0.5, y: 0.5 }falseSpecifies the anchor being set on a particular point of the annotation.
The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
Note this is only for custom annotations not the default pin view.
Defaults to the center of the view.
  xnumbernonetrueSee anchor
  ynumbernonetrueSee anchor
childrenReactElement | [ReactElement, ReactElement]nonetrueExpects one child, and an optional callout can be added as well
styleViewProps["style"]nonefalseFIX ME NO DESCRIPTION

Methods

refresh()

On android point annotation is rendered offscreen with a canvas into an image.
To rerender the image from the current state of the view call refresh.
Call this for example from Image#onLoad.