index.htmlファイルの内容



<!-- saved from url=(0017)http://localhost/ -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title></title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="mapdata.js"></script>
<script type="text/javascript">
var geocoder;
var map;
var currentInfoWindow = null;
function initialize() {
  geocoder = new google.maps.Geocoder();
  var myOptions = {zoom: mapzoom, mapTypeId: google.maps.MapTypeId.ROADMAP}
  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  for (var i = 0; i < places.length; i++) {
    var place = places[i];
    var info = '<b>' + place[1] + '</b><br/><br/>' + place[0];
    codeAddress(place[0], info, place[2]);
  }
}
function codeAddress(address, info, flg) {
  geocoder.geocode({'address': address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
      if (flg == 0) {
        map.setCenter(results[0].geometry.location);
      }
      else {
        var marker = new google.maps.Marker({map: map, position: results[0].geometry.location});
        var infowindow = new google.maps.InfoWindow({content: info});
        google.maps.event.addListener(marker, 'click', function() {
          if (currentInfoWindow) {
            currentInfoWindow.close();
          }
          infowindow.open(map,marker);
          currentInfoWindow = infowindow;
        });
      }
    }
  });
}
</script>
</head>
<body onload="initialize()" style="margin:0px; padding:0px">
<div id="map_canvas" style="width:100%; height:100%;"></div>
</body>
</html>







Copyright © T'sWare All rights reserved