Skip to content

Commit

Permalink
Fix IOS bug: onMarkerClick
Browse files Browse the repository at this point in the history
  • Loading branch information
lovebing committed Oct 28, 2016
1 parent 955ab13 commit 0acc29b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"dependencies": {
"react": "15.2.1",
"react-native": "^0.30.0",
"react-native-baidu-map": "^0.4.5"
"react-native-baidu-map": "^0.4.6"
}
}
14 changes: 14 additions & 0 deletions ios/RCTBaiduMap/RCTBaiduMapViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ -(void)mapViewDidFinishLoading:(BMKMapView *)mapView {
[self sendEvent:event];
}

-(void)mapView:(BMKMapView *)mapView
didSelectAnnotationView:(BMKAnnotationView *)view {
NSDictionary* event = @{
@"type": @"onMarkerClick",
@"params": @{
@"title": [[view annotation] title],
@"position": @{
@"latitude": @([[view annotation] coordinate].latitude),
@"longitude": @([[view annotation] coordinate].longitude)
}
}
};
[self sendEvent:event];
}

- (void) mapView:(BMKMapView *)mapView
onClickedMapPoi:(BMKMapPoi *)mapPoi {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-baidu-map",
"version": "0.4.5",
"version": "0.4.6",
"description": "Baidu Map SDK modules and view for React Native(Android & IOS), support react native 0.30+.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 0acc29b

Please sign in to comment.