2016-11-15 3 views
2

私のジオコーダは正常に動作していましたが、現在は郡、州、国だけが返されます。ドキュメント(https://developers.google.com/maps/documentation/geocoding/intro)によれば、ジオコーダは地域(都市)を返す必要があります。 google mapsジオコーダが地域を返さない

"ウィネトカを" 検索

... 期待される結果:

{ 
    "results" : [ 
     { 
     "address_components" : [ 
      { 
       "long_name" : "Winnetka", 
       "short_name" : "Winnetka", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "New Trier", 
       "short_name" : "New Trier", 
       "types" : [ "administrative_area_level_3", "political" ] 
      }, 
      { 
       "long_name" : "Cook County", 
       "short_name" : "Cook County", 
       "types" : [ "administrative_area_level_2", "political" ] 
      }, 
      { 
       "long_name" : "Illinois", 
       "short_name" : "IL", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "United States", 
       "short_name" : "US", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Winnetka, IL, USA", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 42.1282269, 
        "lng" : -87.7108162 
       }, 
       "southwest" : { 
        "lat" : 42.0886089, 
        "lng" : -87.7708629 
       } 
      }, 
      "location" : { 
       "lat" : 42.10808340000001, 
       "lng" : -87.735895 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 42.1282269, 
        "lng" : -87.7108162 
       }, 
       "southwest" : { 
        "lat" : 42.0886089, 
        "lng" : -87.7708629 
       } 
      } 
     }, 
     "place_id" : "ChIJW8Va5TnED4gRY91Ng47qy3Q", 
     "types" : [ "locality", "political" ] 
     } 
    ], 
    "status" : "OK" 
} 

実際の結果:

{ 
    "results" : [ 
     { 
     "address_components" : [ 
      { 
       "long_name" : "New Trier Township", 
       "short_name" : "New Trier Township", 
       "types" : [ "administrative_area_level_3", "political" ] 
      }, 
      { 
       "long_name" : "Cook County", 
       "short_name" : "Cook County", 
       "types" : [ "administrative_area_level_2", "political" ] 
      }, 
      { 
       "long_name" : "Illinois", 
       "short_name" : "IL", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "United States", 
       "short_name" : "US", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "New Trier Township, IL, USA", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 42.1282269, 
        "lng" : -87.71080979999999 
       }, 
       "southwest" : { 
        "lat" : 42.0886089, 
        "lng" : -87.7708629 
       } 
      }, 
      "location" : { 
       "lat" : 42.10808340000001, 
       "lng" : -87.735895 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 42.1282269, 
        "lng" : -87.7108162 
       }, 
       "southwest" : { 
        "lat" : 42.0886089, 
        "lng" : -87.7708629 
       } 
      } 
     }, 
     "place_id" : "ChIJW8Va5TnED4gRY91Ng47qy3Q", 
     "types" : [ "locality", "political" ] 
     } 
    ], 
    "status" : "OK" 
} 
+0

私は戻ってきた結果に "Winnetka"を返します( "種類":["locality"、 "political"])。 – geocodezip

+0

実際に住所をジオコーディングするときに都市が返されないという同じ問題が発生しています。 –

+0

geocodezip、あなたのリクエストを投稿してもよろしいですか?私はあなたが別のバージョンを使用している可能性がありますが、私はまだバージョンを変更する方法と、まだ正しいデータを返すバージョンがわからない。 –

答えて

2

私はあなたと同じ船に乗っています。検索しているレベルが返されていません。地域を検索すると、それが欠落しています。 administrative_area_level_1を検索すると、それが見つかりません。

@geocodezipと同じ問題がある別の質問では、サーバー固有の問題だと思います。これは時々、通常Googleが明らかに変更を行っているときに発生します。すぐに解決したらうまくいけば、今は本当に痛いです。

+0

これが当てはまる場合、PayPalは$ 10- $ 11の取引を停止するようなものです。それは、私がMapBoxに切り替えることを考えるようになるばかげた奇抜です。 –

+0

はい、それは私のアプリがそれのために完全に壊れたので、非常に不便です。それについて私たちができることは何もありません。私は昨晩、一部の人々のために働いていたので、それは真実だと信じています。私はMapBoxについて聞き始めました。あなたの意見は何ですか? –

+0

今はあなたのために働いていますか?私はビジネスに戻っています。少なくとも当分の間は。 –

関連する問題