File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,25 @@ @implementation BaiduMapModule {
6666 [[self getBaiduMapView ] setZoomLevel: zoom];
6767}
6868
69+ RCT_EXPORT_METHOD (geocode:(NSString *)city addr:(NSString *)addr) {
70+
71+ [self getGeocodesearch ].delegate = self;
72+
73+ BMKGeoCodeSearchOption *geoCodeSearchOption = [[BMKGeoCodeSearchOption alloc ]init];
74+
75+ geoCodeSearchOption.city = city;
76+ geoCodeSearchOption.address = addr;
77+
78+ BOOL flag = [[self getGeocodesearch ] geoCode: geoCodeSearchOption];
79+
80+ if (flag)
81+ {
82+ NSLog (@" geo检索发送成功" );
83+ }else {
84+ NSLog (@" geo检索发送失败" );
85+ }
86+ }
87+
6988RCT_EXPORT_METHOD (reverseGeoCode:(double )lat lng:(double )lng) {
7089
7190 [self getGeocodesearch ].delegate = self;
@@ -164,4 +183,4 @@ -(RCTBaiduMapView *) getBaiduMapView {
164183 return [RCTBaiduMapViewManager getBaiduMapView ];
165184}
166185
167- @end
186+ @end
You can’t perform that action at this time.
0 commit comments