Skip to content

Commit

Permalink
Merge pull request #14 from zhangjunhou/master
Browse files Browse the repository at this point in the history
ios add geocode
  • Loading branch information
lovebing authored Sep 29, 2016
2 parents d74c3d7 + 938ec41 commit 2be13cc
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion ios/RCTBaiduMap/BaiduMapModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ @implementation BaiduMapModule {
[[self getBaiduMapView] setZoomLevel:zoom];
}

RCT_EXPORT_METHOD(geocode:(NSString *)city addr:(NSString *)addr) {

[self getGeocodesearch].delegate = self;

BMKGeoCodeSearchOption *geoCodeSearchOption = [[BMKGeoCodeSearchOption alloc]init];

geoCodeSearchOption.city= city;
geoCodeSearchOption.address = addr;

BOOL flag = [[self getGeocodesearch] geoCode:geoCodeSearchOption];

if(flag)
{
NSLog(@"geo检索发送成功");
}else{
NSLog(@"geo检索发送失败");
}
}

RCT_EXPORT_METHOD(reverseGeoCode:(double)lat lng:(double)lng) {

[self getGeocodesearch].delegate = self;
Expand Down Expand Up @@ -164,4 +183,4 @@ -(RCTBaiduMapView *) getBaiduMapView {
return [RCTBaiduMapViewManager getBaiduMapView];
}

@end
@end

0 comments on commit 2be13cc

Please sign in to comment.