問題描述
我想在我的 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
這篇關于使用地理位置按鈕檢索當前位置和郵編的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!