@maplayr/react-native
    Preparing search index...

    Interface CoordinateAnnotationLayerProps<T>

    Props for the CoordinateAnnotationLayer component

    interface CoordinateAnnotationLayerProps<T> {
        allowsMultipleSelection?: boolean;
        anchor?: Anchor | ((item: T) => Anchor);
        annotationType?: (item: T) => string;
        coordinates: (item: T) => Coordinate;
        data: readonly T[];
        keyExtractor: (item: T) => string;
        onDeselect?: (item: T) => void;
        onSelect?: (item: T) => void;
        renderAnnotation: (info: AnnotationRenderInfo<T>) => ReactElement;
        selectedKeys?: readonly string[];
    }

    Type Parameters

    • T
    Index
    allowsMultipleSelection?: boolean

    Whether a tap adds to the selection instead of replacing it. Defaults to false

    anchor?: Anchor | ((item: T) => Anchor)

    Where each annotation sits on its coordinates. Defaults to { x: '50%', y: '50%' }

    annotationType?: (item: T) => string

    Groups items whose annotations have different structures, so reused annotations keep the same shape. Defaults to one type for every item

    coordinates: (item: T) => Coordinate

    Where the item sits on the map. Read for every item, including those not currently rendered

    data: readonly T[]

    The items to annotate. Every render must derive from an item and its selection, so any state that should last belongs here

    keyExtractor: (item: T) => string

    A stable, unique key for each item. It identifies the item for selection and recycling

    onDeselect?: (item: T) => void

    Called when the user deselects an annotation, by tapping it again, another one, or the map

    onSelect?: (item: T) => void

    Called when the user taps an annotation to select it

    renderAnnotation: (info: AnnotationRenderInfo<T>) => ReactElement

    Renders an item's annotation, sized by Yoga like any React Native view. The rendered component may be reused for a different item, so render only from item and isSelected

    selectedKeys?: readonly string[]

    The keys of the selected items. Selection is controlled: taps are reported through onSelect and onDeselect, and the map shows whatever this prop says. Defaults to none