// var map; initialize(); // 初期化。bodyのonloadでinitialize()を指定することで呼び出してます function initialize() { var latlng = new google.maps.LatLng(36.233197,137.970761); var opts = { zoom: 18, mapTypeId: google.maps.MapTypeId.ROADMAP, center: latlng }; map = new google.maps.Map(document.getElementById("map_canvas"), opts); var image=new google.maps.MarkerImage( "/share/img/map/map_icon03.png", new google.maps.Size(35.0,35.0), new google.maps.Point(0,0), new google.maps.Point(17.5,17.5) ); var shadow=new google.maps.MarkerImage( "/share/img/map/map_icon04.png", new google.maps.Size(35.0,35.0), new google.maps.Point(0,0), new google.maps.Point(17.5,17.5) ); var marker1 = new google.maps.Marker({ position: new google.maps.LatLng(36.233197,137.970761), map: map, icon:image, shadow:shadow }); var infowin1 = new google.maps.InfoWindow({content:"藤森病院 
松本市中央2-9-8
TEL:0263-33-3672"}); infowin1.open(map, marker1); flag = 0; google.maps.event.addListener(marker1, 'click', function(){ if(flag == 0){ infowin1.open(map, marker1); flag = 1; }else{ infowin1.close(); flag = 0; } }); } //