免費版:
public static final String URL_GEOCODE =
"http://maps.google.com/maps/api/geocode/json?latlng=%1$f,%2$f&sensor=false®ion=cn&language=%3$s";
通配符:經度、緯度、語言
商業版:
客戶端使用商業版的逆地址需要在逆地址的url添加兩個字段:client和signature
clientID
可以從google Enterprise support portal 登錄找到,同時也會看到接下來需要用到的 private key(對應clientID)
signature需要 clientID和private key 一起配合通過算法得到。
1,構造您的網址,並確保其中包含 client 和 sensor 參數。請注意,任何非標準字符都需要進行網址編碼:
2,通過一定的算法,生成signature密鑰,完整的url,如下所示:
這個url,就可以成功的進行商業版的逆地址了。
【注意:signature密鑰不是唯一的,也就是說每一次逆地址前,都需要動態的生成一個url相對應的密鑰,相同的經緯度,生成的會是同一個密鑰】
密鑰生成算法,google 已經給出了不同語言下的示例:java、c#、python,可以直接點擊以下鏈接:
objective-c:
使用限制
使用 Google Geocoding API 時,每天發送的地理位置查詢請求不得超過 2,500 個。(Google Maps API for Business 用戶每天最多可執行 100,000 個請求。)
一些相關的網站
Google Maps Mobile SDK for Business
Google Maps Mobile SDK for Business:Android
Google Maps API for Business
Maps API for Business 網絡參數
Authentication and Authorization
Maps API for Business :Authentication
Google Geocoding API
google Enterprise support portal