Skip to content

Add onPress to ViewAnnotation #1290

@kalwinskidawid

Description

@kalwinskidawid

Motivation

I would like the onPress signal to be sent every time you press ViewAnnotation.
I have a function that zooms in on a point when it is already pressed. It would be very helpful if it were possible to manage which point is selected by the RN side.

Now it works like this: 1 press (select), 2nd press (deselect), 3th press (select), 4th press (deselect), and so on...

Another scenario:
I close the modal window (visible only after pressing the point), I try to press the same point to reopen the modal window. The onSelected function will not be triggered because the onDeselected function will be triggered.

Implementation

<VietwAnnotation
      id={id}
      lngLat={coordinate}
      selected={false}
      onPress={() => {console.log('Pressed', id);  }}
      anchor={'center'}
    >

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions