在我的iPhone应用程序中,我使用的是MKMapKit。目前,我根据Google Place API提供的结果在地图上绘制地点,但根据Google的文档,我必须仅在Google地图中使用此值。不幸的是,从iOS 6开始,MKMapKit将转到Apple Map本身。
有没有像Apple Place Search API这样的Apple API?
现在我使用这样的URL:
https://maps.googleapis.com/maps/api/place/search/json?location=10.0036830,74.318723&rankby=distance&types=restaurant&sensor=false&key="my API Key"
您可以通过MKLocalSearchRequest和MapKit实现此目的。
它显示自动填充的地方就像google places API一样,并且可以将注释点放在Apple的地图上(而不是谷歌地图上,我希望这只是你在寻找的。)
您可以从here下载示例项目,使用MKLocalSearchRequest获取位置并在自动完成的tableview控制器中显示。
但是,它无法显示您从Google Places API获得的准确结果。问题在于地理编码数据库显然并不完整,而苹果并不是领导这一领域的公司 - 谷歌就是。