How to select apple default points of interest

妖精的绣舞 提交于 2019-12-11 04:28:22

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!