带地址的 MKMapView
有没有办法让 MKMapView 放置具有给定地址的图钉?不使用坐标
谢谢
is there a way to make the MKMapView place a pin with a given address? Without using the Coordinates
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这是我在应用程序中使用的代码片段
here is a snippet of code I used in an application
[NSString stringWithContentsOfURL:] 目前已弃用。你必须使用:
[NSString stringWithContentsOfURL:] is deprecated for now. You have to use:
由于当您进行 Google 搜索时,此结果位于第一页,因此我认为提供比 Google 地理编码(有限)更新鲜的解决方案是件好事。最好使用 Apple 地理编码器:
Since this result is in the first page when you make a Google search, I think it's good to give a fresher solution than the Google geocoding (limited). It's better to use an Apple geocoder:
由于 Google 发布了新版本的地理编码 API (升级说明),Google 地图网址@Aaron Saunders 提供的不再有效。此外,响应现在是
json
或xml
,因此我进行了一些更改以在接受的响应中解决此问题。Since google posted a new version to their geocoding API (upgrade notes), the Google Maps URL provided by @Aaron Saunders is no longer valid. Additionally, the response is now either
json
orxml
so I have made some changes to address this in the accepted response.您需要使用地理编码服务将您的地址转换为坐标。我认为谷歌提供了一项服务以及其他一些服务。
You need to use a geocoding service to convert your address to coordinates. Google, I think, offers one, along with a few other services.