美文网首页
iOS swift-高德地图,反编译地图中心点位置

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

作者: 青菜白玉堂 | 来源:发表于2017-05-31 12:02 被阅读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)")

}

}

相关文章

网友评论

      本文标题:iOS swift-高德地图,反编译地图中心点位置

      本文链接:https://www.haomeiwen.com/subject/tyodfxtx.html