diff --git a/demo/package.json b/demo/package.json index 78583d08..05d2507e 100644 --- a/demo/package.json +++ b/demo/package.json @@ -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" } } diff --git a/ios/RCTBaiduMap/RCTBaiduMapViewManager.m b/ios/RCTBaiduMap/RCTBaiduMapViewManager.m index 47e42cb3..c7f742f4 100644 --- a/ios/RCTBaiduMap/RCTBaiduMapViewManager.m +++ b/ios/RCTBaiduMap/RCTBaiduMapViewManager.m @@ -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 { diff --git a/package.json b/package.json index a75ebabc..46c543e9 100644 --- a/package.json +++ b/package.json @@ -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": {