だるろぐ

だるいぶろぐです

google maps apiでジオコーディング

http://sites.google.com/site/gmapsapi3/Home/services この辺に書いてあるけど。
住所から緯度と経度を得ようとか。

    function setGeo() {
        var geocoder = new google.maps.Geocoder();
        var address = document.getElementById('address').value;

        if (geocoder && address) {
            geocoder.geocode({'address': address}, function(results, status) {
                if (status == google.maps.GeocoderStatus.OK) {
                    document.getElementById('lat').value = results[0].geometry.location.lat();
                    document.getElementById('lng').value = results[0].geometry.location.lng();
                } else {
                    alert("その住所からは緯度・経度が取得できませんでした\n" + status);
                }
            });
        };
    }


javascriptでdumpとかsprintfとか標準装備してくれねーかな。特にdumpを。