ここでやりたいことは、場所を指定してマップ表現を取得することです
<script type="text/javascript">
var geocoder;
var map;
function getmaploc() {
geocoder = new google.maps.Geocoder();
var myOptions = {
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
geocoder.geocode( 'cairo', 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);
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
});
}
</script>
<body onload="getmaploc()">
<div id="map_canvas" style="width: 320px; height: 480px;"></div>
</body>
これで何が問題なのかわかりませんか??