GClientGeocoder

jQuery

GClientGeocoderで地名から緯度経度を取得できる。

ws0517

GClientGeocoderを使ってテストしてたら、よくテストで入力する用語である「asdf」という地名があった。

geocodingのサンプル実行
jquery使ってます。

住所やsignificant pointから位置情報を得るためのコード抜粋。

function getPoint(address)
{
  var geocoder = new GClientGeocoder();
  geocoder.getLatLng(address,
    function showMap(latlng){
      if (latlng){
        move(marker, latlng.lat(), latlng.lng());
        $('#message').empty();
      }else{
        $('#message').text("住所から緯度経度に変換できません");
      }
    }
  );
}

最近右腕&右肩が痛い!なんでじゃー!

コメント