var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶 var contentStr = null; var stationList = [ {"latlng":[35.804616200000000, 139.102613000000020], name:"もえぎの湯", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"1", icon:"/images/googlemap/open/icon_bathhouse.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/okutamas/", shopName:"もえぎの湯", shopTel:"0428-82-7770", reserve:"", time:"9:30~21:30(最終受付20:30)", closed:"月曜日(月曜が祝日の場合は翌日)", mapDisable:"0" }, {"latlng":[35.724139800000000, 139.054096200000000], name:"数馬の湯", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"1", icon:"/images/googlemap/open/icon_bathhouse.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/kazuma/", shopName:"数馬の湯", shopTel:"042-598-6789", reserve:"", time:"10:00~19:00/土日10:00~20:00", closed:"月曜、月曜日が祝日の場合は、翌日が休館日となります。", mapDisable:"0" }, {"latlng":[35.631499300000000, 139.447887499999980], 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/taketorinoyu/", shopName:"竹取の湯", shopTel:"042-337-1126", reserve:"", time:"9:00~翌8:30(男性は9:00~翌8:00(最終受付翌7:30)、女性は9:00~翌7:30(最終受付翌7:00))", closed:"不定休", mapDisable:"0" }, {"latlng":[35.645399600000000, 139.489522900000000], name:"季乃彩", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"1", icon:"/images/googlemap/open/icon_bathhouse.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/tokinoirodori/", shopName:"季乃彩", shopTel:"042-370-2614", reserve:"", time:"9:00~翌1:00(最終受付0:00)", closed:"3月・6月・9月・12月の第3火曜日です。", mapDisable:"0" }, {"latlng":[35.676948900000000, 139.426887099999930], name:"国立温泉 湯楽の里", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"1", icon:"/images/googlemap/open/icon_bathhouse.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/yuranosato/", shopName:"国立温泉 湯楽の里", shopTel:"042-580-1726", reserve:"", time:"9:00~翌1:00(最終受付0:00)", closed:"不定休", mapDisable:"0" }, {"latlng":[35.644719100000000, 139.420839200000050], name:"おふろの王様 多摩百草店", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"1", icon:"/images/googlemap/open/icon_bathhouse.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/ousama-tamamogusa/", shopName:"おふろの王様 多摩百草店", shopTel:"042-311-2603", reserve:"", time:"9:00~翌1:00(最終受付0:00)", closed:"年中無休", mapDisable:"0" }, {"latlng":[35.779483600000000, 139.192096200000040], name:"つるつる温泉", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"1", icon:"/images/googlemap/open/icon_bathhouse.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"スーパー銭湯", url:"/shop/turuturu/", shopName:"つるつる温泉", shopTel:"042-597-1126", reserve:"", time:"10:00~20:00(最終受付19: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; }