例如,在MKLocalSearch查询中,我将nautral langauge查询设置为:" Coffee"。我得到几个注释来放下咖啡店的地方,但我只获得地址,尽管他们登陆了商业名称/地点。为了检索这些数据,我需要包含哪些内容?
这是我到目前为止所做的:
request.naturalLanguageQuery = address
request.region = self.mapView.region
let search = MKLocalSearch(request: request)
search.startWithCompletionHandler { (response, error) -> Void in
if error != nil {
print("error: \(error)")
return
}
if response != nil {
self.mapView.removeAnnotations(self.mapView.annotations)
for item in response!.mapItems {
self.plotPlacemarkOnMap(item.placemark)
}
}
}