{GoogleMapsAPI: 'JavaScript API V3', Title: 'first geocode', Level: 4}
完成イメージ
一先ず京都周辺でないと困るので、ジオコーディング。
メンドイのでjsに直書きで><
http://code.google.com/intl/ja/apis/maps/documentation/javascript/services.html#Geocoding
add_geocode.js
ファイルフォーマットは、もちろんUTF-8だよね^^
function initialize() { var centerPos = new google.maps.LatLng(35.658613, 139.745525); var mapOptions = { zoom : 18, center : centerPos, mapTypeId: google.maps.MapTypeId.ROADMAP, streetViewControl: true }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); //Geocode var geocoder = new google.maps.Geocoder(); var address = 'kyotoeki';//日本語だとうまく行かなかったのでローマ字綴りw; geocoder.geocode( { 'address': address }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); } else { alert("Geocode was not successful for the following reason: " + status); } }); }