2013-09-23 78 views
0

我有使用谷歌地圖API的問題。我使用地理定位服務來協調街道,但面臨問題。當我選擇我需要的街道時,API不會計算出街道的座標。 JSON響應顯示API僅搜索城市。這種情況只發生在一些街道上。谷歌地圖API未採取街頭

http://maps.googleapis.com/maps/api/geocode/json?address=1+Schorsa+Kyiv&sensor=false

{ "results" : [ { "address_components" : [ { "long_name" : "Kiev", "short_name" : "Kiev", "types" : [ "locality", "political" ] }, { "long_name" : "Kiev city", "short_name" : "Kiev city", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "Kyiv city", "short_name" : "Kyiv city", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "Ukraine", "short_name" : "UA", "types" : [ "country", "political" ] } ], "formatted_address" : "Kiev, Kyiv city, Ukraine", "geometry" : { "bounds" : { "northeast" : { "lat" : 50.590798, "lng" : 30.825941 }, "southwest" : { "lat" : 50.213273, "lng" : 30.2394401 } }, "location" : { "lat" : 50.4501, "lng" : 30.5234 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 50.590798, "lng" : 30.825941 }, "southwest" : { "lat" : 50.213273, "lng" : 30.2394401 } } }, "partial_match" : true, "types" : [ "locality", "political" ] } ], "status" : "OK" } 

如果您單擊瀏覽器,我把它的鏈接

{ 
    "results" : [ 
     { 
     "address_components" : [ 
      { 
       "long_name" : "1", 
       "short_name" : "1", 
       "types" : [ "street_number" ] 
      }, 
      { 
       "long_name" : "улица Щорса", 
       "short_name" : "улица Щорса", 
       "types" : [ "route" ] 
      }, 
      { 
       "long_name" : "Деснянский район", 
       "short_name" : "Деснянский район", 
       "types" : [ "sublocality", "political" ] 
      }, 
      { 
       "long_name" : "Киев", 
       "short_name" : "Киев", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "город Киев", 
       "short_name" : "город Киев", 
       "types" : [ "administrative_area_level_2", "political" ] 
      }, 
      { 
       "long_name" : "город Киев", 
       "short_name" : "город Киев", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Украина", 
       "short_name" : "UA", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "улица Щорса, 1, Киев, город Киев, Украина", 
     "geometry" : { 
      "location" : { 
       "lat" : 50.52287399999999, 
       "lng" : 30.59185099999999 
      }, 
      "location_type" : "ROOFTOP", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 50.5242229802915, 
        "lng" : 30.59319998029149 
       }, 
       "southwest" : { 
        "lat" : 50.5215250197085, 
        "lng" : 30.5905020197085 
       } 
      } 
     }, 
+0

可能有不同的名稱,這些街道,地圖圖塊說什麼? – geocodezip

+0

將[「Street」添加到街道名稱中](http://www.geocodezip.com/v3_example_geo2.asp?addr1=1+Schorsa%20Steet+Kyiv&geocode=1)http://maps.googleapis.com/地圖/ API /地理編碼/ JSON?地址= 1 + Schorsa +街+基輔&傳感器=假 – geocodezip

回答