iOS swift-高德地图,反编译地图中心点位置

2017-05-31  本文已影响74人  青菜白玉堂

var search: AMapSearchAPI!//搜索

search = AMapSearchAPI()

search.delegate = self

let request = AMapReGeocodeSearchRequest()

request.location = AMapGeoPoint.location(withLatitude: CGFloat(gdMapView.centerCoordinate.latitude), longitude: CGFloat(gdMapView.centerCoordinate.longitude))

search.aMapReGoecodeSearch(request)

func onReGeocodeSearchDone(_ request: AMapReGeocodeSearchRequest!, response: AMapReGeocodeSearchResponse!) {

if response.regeocode == nil {

return

//解析response返回数据

let pc = response.regeocode.addressComponent.province + response.regeocode.addressComponent.city

let address = response.regeocode.formattedAddress.substringFrom(pc.length())

print("response返回\(address)")

print("response返回\(pc)")

}

}

上一篇下一篇

猜你喜欢

热点阅读