2017-06-12 3 views
-1

私はGoogle GeoCodingサービス(ブラウザからのリクエストを使用して)で作業していて、きれいな通りの名前(前後方向と接尾辞なし) :私の住所が "3307 W Bertona St Apt 3、Seattle、WA" "Bertona"のようになります。 マイリクエストURL: https://maps.googleapis.com/maps/api/geocode/json?address=3307%20W%20Bertona%20St%20Apt%203%20%2C%20Seattle%20%2C%20WA%20%2C%20&sensor=false&client= {}のclientId &署名= {}のPrivateKeyGoogleジオコーディングサービス - 清潔な通りの名前を取得する

サービスからきれいな通りの名前を取得する方法はありますか?

答えて

0

あなたが応答でaddress_components配列から通りの名前を取得できます。

{ 
    "results":[ 
    { 
     "address_components":[ 
     { 
      "long_name":"3", 
      "short_name":"3", 
      "types":[ 
      "subpremise" 
      ] 
     }, 
     { 
      "long_name":"3307", 
      "short_name":"3307", 
      "types":[ 
      "street_number" 
      ] 
     }, 
     { 
      "long_name":"West Bertona Street", 
      "short_name":"W Bertona St", 
      "types":[ 
       "route" 
      ] 
     }, 

タイプrouteの構成要素は、ロングとショート通りの名前が含まれています。これは、Geocoding APIリクエストから取得できる最もクリーンな名前です。

関連する問題