问题
I have a question regarding to the default points of interest.
I can show the default POIs using mapView.showsPointsOfInterest = true
But I cannot tap on /select those POIs (restaurant, hotel, etc ..). All I want is that when I tap on it, I can get its info (long/lat, name ...)
I tried different delegate methods, such as func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView)
and func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView?
but none of those give me the right result
Can anyone help me with it? Thanks :)
回答1:
Unfortunately, Apple doesn't expose POIs to developers. You won't be able to get latitude and longitude, or a callout, from POIs.
You'd be better off using the Google Maps SDK, or the Google Places API to add your own annotations on top of Mapkit.
回答2:
There is no built in API for selecting those points of interest. But you can use Google's API for Google maps and it has a lot more things that you can do.
Here is a link to the Google Maps API: https://developers.google.com/maps/documentation/ios-sdk/
来源:https://stackoverflow.com/questions/41878955/how-to-select-apple-default-points-of-interest