Xcode Google Maps Search Bar

给你一囗甜甜゛ 提交于 2019-12-04 07:23:04
Saxon Druce

What you're looking for is geocoding - the process of turning an address in your search bar into a latitude/longitude coordinate, which you can then set the map's position to.

This question has two main answers. This answer shows how to geocode using a Google API, and this answer shows how to geocode using an Apple API.

If you're using MapKit (which uses Apple maps as of iOS 6.0), then you should probably use the Apple API (you are not supposed to use Google Maps APIs with non-Google maps).

If you're using the new Google Maps SDK for iOS, you might want to use the Google API for geocoding. Although note that the answer I've linked to is using the Google API with MapKit (as it was written back when MapKit was using Google Maps), so you would need to modify it a bit.

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