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 src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script> <script src="mapdata.js"></script> <script> var map; var currentInfoWindow = null; function initialize() { 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]; SetMarker(place[0], info, place[2], place[3], place[4]); } } function SetMarker(address, info, lat, lng, flg) { if (flg == 0) { var geocoder = new google.maps.Geocoder(); geocoder.geocode({'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var latlng = results[0].geometry.location; map.setCenter(latlng); } }); } else { var latlng = new google.maps.LatLng(lat, lng); var marker = new google.maps.Marker({map: map, position: latlng}); var infowindow = new google.maps.InfoWindow({content: info, maxWidth: 230}); google.maps.event.addListener(marker, "mouseover", function() { infowindow.open(map, marker); currentInfoWindow = infowindow; }); google.maps.event.addListener(marker, "mouseout", function() { if (currentInfoWindow) { currentInfoWindow.close(); } }); } } google.maps.event.addDomListener(window, "load", initialize); </script> </head> <body style="margin:0px; padding:0px"> <div id="map_canvas" style="width:100%; height:100%;"></div> </body> </html> |
Copyright © T'sWare All rights reserved |