{"action":"created","issue":{"url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/218","repository_url":"https://api.github.com/repos/lelandrichardson/react-native-maps","labels_url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/218/comments","events_url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/218/events","html_url":"https://github.com/lelandrichardson/react-native-maps/issues/218","id":153791991,"number":218,"title":"Getting Marker Key from onPress Event","user":{"login":"adam-jakiela","id":5438467,"avatar_url":"https://avatars.githubusercontent.com/u/5438467?v=3","gravatar_id":"","url":"https://api.github.com/users/adam-jakiela","html_url":"https://github.com/adam-jakiela","followers_url":"https://api.github.com/users/adam-jakiela/followers","following_url":"https://api.github.com/users/adam-jakiela/following{/other_user}","gists_url":"https://api.github.com/users/adam-jakiela/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-jakiela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-jakiela/subscriptions","organizations_url":"https://api.github.com/users/adam-jakiela/orgs","repos_url":"https://api.github.com/users/adam-jakiela/repos","events_url":"https://api.github.com/users/adam-jakiela/events{/privacy}","received_events_url":"https://api.github.com/users/adam-jakiela/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lelandrichardson/react-native-maps/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/lelandrichardson/react-native-maps/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/lelandrichardson/react-native-maps/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-09T14:39:56Z","updated_at":"2016-05-18T08:50:34Z","closed_at":null,"body":"I am trying to get the key of a map marker when it is pressed. I have tried the `onMarkerPress` prop from the `MapView` and the `onPress` prop in the 'Marker' class. In both cases, the native event is passed into the callback function. However, the native event returned has all null fields which does not give me any indication as to what marker was pressed. \r\n\r\nIn short, my objective is to determine which marker is pressed when the event is fired.\r\n\r\nMy questions are:\r\n- Should I be using the `onMarkerPress` prop found in the `MapView` or the `onPress` prop in the `Marker`?\r\n- How do I get the ID of the marker?"},"comment":{"url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/comments/219964734","html_url":"https://github.com/lelandrichardson/react-native-maps/issues/218#issuecomment-219964734","issue_url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/218","id":219964734,"user":{"login":"magrinj","id":3551795,"avatar_url":"https://avatars.githubusercontent.com/u/3551795?v=3","gravatar_id":"","url":"https://api.github.com/users/magrinj","html_url":"https://github.com/magrinj","followers_url":"https://api.github.com/users/magrinj/followers","following_url":"https://api.github.com/users/magrinj/following{/other_user}","gists_url":"https://api.github.com/users/magrinj/gists{/gist_id}","starred_url":"https://api.github.com/users/magrinj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magrinj/subscriptions","organizations_url":"https://api.github.com/users/magrinj/orgs","repos_url":"https://api.github.com/users/magrinj/repos","events_url":"https://api.github.com/users/magrinj/events{/privacy}","received_events_url":"https://api.github.com/users/magrinj/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T08:50:34Z","updated_at":"2016-05-18T08:50:34Z","body":"It's not a really nice solution but in the `event` object inside `nativeEvent` you have the coordinate object, that contains the coordinates of your point, so you can use it to find again your object in your array.\r\nThe @jrichardlai solution looks better, but if you want you can do it like above :)"}}