var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶 var contentStr = null; var stationList = [ {"latlng":[35.689412900000000, 139.703642299999960], name:"ゴリラクリニック 新宿本院", shopImg:"https://www.refle.info/salonImg/MzU2M0AxMEA1ZWUwOTE1YzhkYTliQDkwQDQyMA%3D%3D.jpeg", open:"2", icon:"/images/googlemap/close/icon_mbeauty.png", scaledSize : new google.maps.Size(30, 34.5), manage:"25", genreName:"メンズ脱毛", url:"/shop/gorilla-clinic-sinzyuku/", shopName:"ゴリラクリニック 新宿本院", shopTel:"0120-987-118", reserve:"(要予約)", time:"11:00~22:00/土日祝11:00~20:00", closed:"不定休", mapDisable:"0" }, {"latlng":[35.689381800000000, 139.703659000000000], name:"メンズリゼクリニック 新宿南口院", shopImg:"https://www.refle.info/salonImg/MzU3OUAwQDFlNDhmZWI5OWZlNWUyYzgzN2M5Yzg5YmNjNDNmYTFiQDkwQDQyMA%3D%3D.jpeg", open:"2", icon:"/images/googlemap/close/icon_mbeauty.png", scaledSize : new google.maps.Size(30, 34.5), manage:"25", genreName:"メンズ脱毛", url:"/shop/rsclinic-shinjuku/", shopName:"メンズリゼクリニック 新宿南口院", shopTel:"0120-562-535", reserve:"(完全予約制)", time:"14:00~23:00", closed:"不定休", mapDisable:"0" }, {"latlng":[35.691632000000000, 139.702160700000040], name:"ダンディハウス 新宿本店", shopImg:"https://www.refle.info/salonImg/MTcwMUAwQDY2Yzc4ZWQwMDc4NTVjNjU2MDJiMGRjYWNmMmUyYTc1QDkwQDQyMA%3D%3D.jpeg", open:"2", icon:"/images/googlemap/close/icon_mbeauty.png", scaledSize : new google.maps.Size(30, 34.5), manage:"25", genreName:"メンズエステティック", url:"/shop/dandy-shinjuku/", shopName:"ダンディハウス 新宿本店", shopTel:"0120-552-011", reserve:"(完全予約制)", time:"11:00~21:30/土日10:00~19:00", closed:"不定休", mapDisable:"0" }, {"latlng":[35.690909500000000, 139.691037000000050], name:"ジュール", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_reflexology_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"リフレクソロジー", url:"/shop/joule/", shopName:"ジュール", shopTel:"03-3348-1234", reserve:"(完全予約制)", time:"10:00~22:00", closed:"不定休", mapDisable:"0" }, {"latlng":[35.698009100000000, 139.705312899999970], name:"PANTHEON(パンテオン) 新宿店", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_massage_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"店舗マッサージ", url:"/shop/olivespa-pantheon-kabukityou/", shopName:"PANTHEON(パンテオン) 新宿店", shopTel:"03-5291-5353", reserve:"", time:"12:30~翌5:00", closed:"不定休", mapDisable:"0" }, {"latlng":[35.689237700000000, 139.696653100000050], name:"Goo-it!(グイット)新宿西口店", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_reflexology_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"リフレクソロジー", url:"/shop/gooit-shinjuku-west/", shopName:"Goo-it!(グイット)新宿西口店", shopTel:"03-3342-5550", reserve:"", time:"11:00~23:00/土日10:00~23:00", closed:"年中無休(年末年始の一部を除く)", mapDisable:"0" }, {"latlng":[35.696042299999990, 139.691645099999960], name:"セルフィール新宿", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_massage_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"店舗マッサージ", url:"/shop/selfeel/", shopName:"セルフィール新宿", shopTel:"03-3365-2880", reserve:"(完全予約制)", time:"11:00~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; }