var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶 var contentStr = null; var stationList = [ {"latlng":[35.122467177443970, 137.136240498950200], name:"竜泉寺の湯 豊田浄水店", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bathhouse_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/ryusenjinoyu-josui/", shopName:"竜泉寺の湯 豊田浄水店", shopTel:"0565-43-3050", reserve:"", time:"6:00~翌3:00(最終受付翌2:30)", closed:"年中無休", mapDisable:"0" }, {"latlng":[35.183181600000000, 137.151648700000000], name:"猿投温泉", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bathhouse_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/sanageonsen/", shopName:"猿投温泉", shopTel:"0565-45-6111", reserve:"", time:"9:00~23:00/土日8:00~23:00(最終受付22:30)", closed:"年中無休", mapDisable:"0" }, {"latlng":[35.214070000000000, 137.502872900000060], name:"稲武温泉 どんぐりの湯", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bathhouse_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/dongurinosato/", shopName:"稲武温泉 どんぐりの湯", shopTel:"0565-82-3135", reserve:"", time:"10:00~21:00/土日9:30~21:00(最終受付20:00)", closed:"毎週木曜日(祝祭日の場合は翌日)12月17~21日設備点検、臨時休館日はトップページでご覧ください。", mapDisable:"0" }, {"latlng":[35.071940100000000, 137.150336400000010], name:"おいでんの湯", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bathhouse_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/oiden/", shopName:"おいでんの湯", shopTel:"0565-37-1126", reserve:"", time:"8:00~翌2:00(最終受付1:30)", closed:"年中無休", mapDisable:"0" }, {"latlng":[35.078662500000010, 137.117847500000040], name:"ほっとかんの湯", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bathhouse_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/hotkan/", shopName:"ほっとかんの湯", shopTel:"0565-36-3000", reserve:"", time:"10:00~翌9:00", closed:"毎月第1月曜日(第1月曜日が祝日の場合は翌週が定休日になります)、年末年始12/30~1/1", mapDisable:"0" }, {"latlng":[35.182625500000000, 137.152026500000030], name:"金泉の湯", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bathhouse_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/kinsenyu/", shopName:"金泉の湯", shopTel:"0565-45-5800", reserve:"", time:"9:30~23:30/土日8:00~23:30(最終受付23:00)", closed:"年中無休", mapDisable:"0" }]; function createMarker(map, i) { //マーカーを作成 station = stationList[i]; latlng = new google.maps.LatLng(station.latlng[0], station.latlng[1]); title = station.name; genreName = station.genreName; manage = station.manage; if(station.url){ imgurl = ''+station.shopName+''; url = ''+station.shopName+''; }else{ imgurl = station.shopName; url = station.shopName; } if(manage <= 5){ contentStr = '
'; contentStr += '

'+url+'

'; contentStr += '

'+genreName+'

'; contentStr += '
'; }else if(manage <= '10'){ contentStr = '
'; contentStr += '

'+url+'

'; contentStr += '
'+imgurl+'
'; contentStr += '
'; contentStr += '

'+genreName+'

'; contentStr += '

'+station.time+'

'; contentStr += '

'+station.closed+'

'; contentStr += '
'; contentStr += '
'; }else{ contentStr = '
'; contentStr += '

'+url+'

'; contentStr += '
'+imgurl+'
'; contentStr += '
'; contentStr += '

'+genreName+'

'; contentStr += '

'+station.time+'

'; contentStr += '

'+station.closed+'

'; contentStr += '
'; contentStr += '
'; } image = "image"+i; var image = { url: station.icon, scaledSize : station.scaledSize } var marker = new google.maps.Marker({ position : latlng, icon : image, map : map, title : title }); var infoWnd = new google.maps.InfoWindow({ content : contentStr }); //マーカーがクリックされたら、情報ウィンドウを表示 google.maps.event.addListener(marker, "click", function(){ if (currentInfoWindow) { currentInfoWindow.close(); } infoWnd.open(map, marker); currentInfoWindow = infoWnd; }); return marker; }