let TipsSearch = AMapPOIKeywordsSearchRequest()
TipsSearch.keywords = "西安市"
// search.aMapPOIKeywordsSearch(TipsSearch)
func onPOISearchDone(_ request: AMapPOISearchBaseRequest!, response: AMapPOISearchResponse!) {
if response.count == 0 {
return
}
for (_, item) in response.pois.enumerated() {
if item.name == "西安市" {
mapView.centerCoordinate = CLLocationCoordinate2D(latitude: CLLocationDegrees(item.location.latitude), longitude: CLLocationDegrees(item.location.longitude))
latitude = item.location.latitude
longitude = item.location.longitude
mapView.setZoomLevel(zoomLevel, animated: false)
break
}
}
}