Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapView annotation press event #1120

Closed
metacortex opened this issue May 3, 2015 · 3 comments
Closed

MapView annotation press event #1120

metacortex opened this issue May 3, 2015 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@metacortex
Copy link

I couldn't find anything about MapView press event.

Should I create custom component?

@brentvatne
Copy link
Collaborator

It looks like this isn't possible yet, do you want to try to implement it? See: http://stackoverflow.com/a/15297919/659988

Something like this on RCTMapManager.m (the delegate):

- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
    // Dispatch event through React stack
}

@dvcrn
Copy link
Contributor

dvcrn commented May 12, 2015

@brentvatne I tried my luck and implemented didSelectAnnotationView.

/ edit: please see the PR here #1247

@brentvatne
Copy link
Collaborator

@dvcrn - Nice one! Closing so we can track this in the PR

frantic pushed a commit to frantic/react-native that referenced this issue Jun 26, 2015
…presses and pin animation

Summary:
Started from here - facebook#1120. Most functionality for annotations were missing so I started implementing and somehow got caught up until the entire thing was done.

![screen shot 2015-05-12 at 10 07 43 pm](https://cloud.githubusercontent.com/assets/688326/7588677/8479a7a4-f8f9-11e4-99a4-1dc3c7691810.png)

2 new events:
- callout presses (left / right)
- annotation presses

6 new properties for annotations:
- hasLeftCallout
- hasRightCallout
- onLeftCalloutPress
- onRightCalloutPress
- animateDrop
- id

1 new property for MapView
- onAnnotationPress

---
Now the important thing is, that I implemented all of this the way "I would do it". I am not sure this is the 'reacty' way so please let me know my mistakes 😄

The problem is that there is no real way to identify annotations which makes it difficult to distinguish which one got clicked. The idea is to pass a `id` and whether it has callouts the entire way with the annotation. I had to
Closes facebook#1247
Github Author: David Mohl <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
@facebook facebook locked as resolved and limited conversation to collaborators May 30, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants