使用地理位置按钮检索当前位置和邮编

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

这篇关于使用地理位置按钮检索当前位置和邮编的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How to stop UIBarButtonItem text from truncating?(如何阻止UIBarButtonItem文本被截断?)
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type(异常:不应为错误类型创建SimpleTypeImpl)
Android IllegalArgumentException: The tag for fragment_XXX is invalid. Received: layout-sw600dp/fragment_XXX_0(Android IlLegalArgumentException:Fragment_XXX的标签无效。收到:Layout-sw600dp/Fragment_XXX_0)
iOS convert audio sample rate from 16 kHz to 8 kHz(IOS将音频采样率从16 kHz转换为8 kHz)
Enforcing an audio sampling rate in iOS(在iOS中强制音频采样率)