Retrieving Current Location and Zip using Geolocation Button(使用地理位置按钮检索当前位置和邮编)
问题描述
我想在我的 UISearchBar 附近放置一个 Geolocation 按钮,点击该按钮时,它应该返回 zip(例如 20043).我将使用 ZIP 中的值来获取我附近的建筑物列表.
I want to place a Geolocation button near my UISearchBar, which on clicking, it should return the zip (eg. 20043). I will be using the value from the ZIP to get the list of buildings near me.
如果有人可以帮助我使用位置按钮,我将不胜感激,以及实现仅返回 ZIP (integer) 的方法是什么?custom UIButton 是否适用于位置按钮?
I would appreciate it if someone could help me with the location Button, and what are the methods to implement to return just the ZIP (integer) ? And would a custom UIButton work for the location button ?
谢谢!
推荐答案
在 iOS 4 中没有转发地理编码(将地址转换为 lat/long),在 iOS 5 中有一些增强(这是在 NDA 下,所以你需要访问 Apple 开发者网站).
In iOS 4 there is no forward geocoded (turning an address into lat/long), there are some enhancements to this in iOS 5 (this is under NDA, so you'll need to visit the Apple developers site).
如果您现在正在寻找东西,这里有一个可以使用的正向地理编码器:http://blog.sallarp.com/ipad-iphone-forward-geocoding-api-google/
If you're looking for something now, here is a forward geocoder you can use: http://blog.sallarp.com/ipad-iphone-forward-geocoding-api-google/
至于按钮,有这个项目有很多常用的地图套件按钮:https://github.com/myell0w/MTLocation
As for the button, there is this project that has many of the commonly used map kit buttons: https://github.com/myell0w/MTLocation
这篇关于使用地理位置按钮检索当前位置和邮编的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用地理位置按钮检索当前位置和邮编
基础教程推荐
- 在 appComponent dagger 2 中动态添加测试模块? 2022-01-01
- 突出显示朗读文本(在 iPhone 的故事书类型应用程序中) 2022-01-01
- 可可/目标C(OSX不是iOS)从子对象访问父对象 2022-01-01
- Android:STATE_SELECTED不工作 2022-01-01
- 在 iOS8 中无法获得正确的键盘高度值 2022-01-01
- - (CGRect)convertRect:(CGRect)rect toView:(UIView *)view 如何工作 2022-01-01
- 在 Android 模拟器中激活网络位置提供程序? 2022-01-01
- 我的 UIImageView 的任务 2022-01-01
- 如何将多个组件添加到 PickerView? 2022-01-01
- 新的@SystemApi 注解是什么意思,和@hide 有什么区别 2022-01-01
