【问题标题】:How to get the latitude and longitude from address with out using google maps in Xcode,iPhone如何在不使用 Xcode、iPhone 中的谷歌地图的情况下从地址获取纬度和经度
【发布时间】:2012-07-20 06:51:39
【问题描述】:

请告诉我如何在不使用谷歌地图的情况下从地址获取位置纬度和经度。提前致谢。

【问题讨论】:

标签: ios maps latitude-longitude


【解决方案1】:

试试Yahoo! Maps Web Services - Geocoding API怎么样

获取app id后,使用如下get请求

http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&street=701+First+Ave&city=Sunnyvale&state=CA

你会得到一个类似的 xml 响应

<?xml version="1.0" encoding="UTF-8"?>
 <ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="urn:yahoo:maps"
  xsi:schemaLocation="urn:yahoo:maps    
 http://local.yahooapis.com/MapsService/V1/GeocodeResponse.xsd">
 <Result precision="address">
  <Latitude>37.416384</Latitude>
  <Longitude>-122.024853</Longitude>
  <Address>701 FIRST AVE</Address>
   <City>SUNNYVALE</City>
   <State>CA</State>
   <Zip>94089-1019</Zip>
   <Country>US</Country>
  </Result>
 </ResultSet>

【讨论】:

    【解决方案2】:

    你看过CLLocation?

    【讨论】:

    • 我尝试使用 CLGeocoder 并在地图视图中显示位置。但我需要在地图视图中显示从起点到终点的路线方向。你能给我任何想法如何显示使用谷歌地图。
    猜你喜欢
    • 1970-01-01
    • 2012-09-28
    • 1970-01-01
    • 2021-03-22
    • 1970-01-01
    • 1970-01-01
    • 2013-07-13
    • 2014-04-11
    • 1970-01-01
    相关资源
    最近更新 更多