2017-08-29 145 views
1

我寫了一個C#程序使用谷歌地圖API,發現對於一些緯度& 長的位置,API無法找到地址(當谷歌地球能夠 找到它。 ..)。 下面是展示它的代碼:谷歌地圖API找不到位置

============================ 
... 
using Google.Api.Maps.Service.Geocoding; 
... 
var request = new GeocodingRequest(); 
request.Sensor = "false"; 
request.Language = "iw"; 
request.LatitudeLongitude = "33.00166,35.60089"; 
var response = GeocodingService.GetResponse(request); 

然後:response.Status是:ServiceResponseStatus.Ok

但使用具有以下位置相同的代碼:

request.LatitudeLongitude = "33.14640,35.72904"; 
response.Status became: ServiceResponseStatus.ZeroResults 

不過,谷歌地球找到這個位置的地址,爲什麼谷歌地圖API找不到它呢?

請指教, 很多tnkx的, 戈蘭

回答

0

你有ServiceResponseStatus.ZeroResults迴應,因爲你嘗試在有爭議的地區(33.14640,35.72904)反向地理編碼。

https://google-developers.appspot.com/maps/documentation/utils/geocoder/#q%3D33.1464%252C35.72904

不幸的是,谷歌地圖反地理編碼並不在爭議地區工作。這是一個已知問題,它在Google問題跟蹤器中報告爲issue 35826813。 Google目前正在處理此問題,因爲問題的狀態爲已接受。 Google Maps API目前沒有解決方法。

我可以建議您主演該問題以表達您的興趣並從Google獲得更多更新。