var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶 var contentStr = null; var stationList = [ {"latlng":[34.666502618269845, 135.498822301223400], name:"VISCONTI(ヴィスコンティ)", shopImg:"https://www.refle.info/salonImg/NTA4MkAxMEA1ZWUwMjIwNWVhZjQ5QDkwQDQyMA%3D%3D.jpeg", open:"1", icon:"/images/googlemap/open/icon_massage.png", scaledSize : new google.maps.Size(30, 34.5), manage:"30", genreName:"メンズエステ", url:"/shop/visconti/", shopName:"VISCONTI(ヴィスコンティ)", shopTel:"080-9601-0184", reserve:"(完全予約制)", time:"10:00~翌3:00(最終受付)", closed:"年中無休", mapDisable:"0" }, {"latlng":[34.668144323762220, 135.493661392046000], name:"Like A Angel(ライク ア エンジェル)", shopImg:"https://www.refle.info/salonImg/Nzg0MUA1QDY1MTQwMmZjYTlmNWRAOTBANDIw.jpeg", open:"1", icon:"/images/googlemap/open/icon_massage.png", scaledSize : new google.maps.Size(30, 34.5), manage:"30", genreName:"メンズエステ", url:"/shop/like-a-angel/", shopName:"Like A Angel(ライク ア エンジェル)", shopTel:"080-4978-7257", reserve:"(完全予約制)", time:"11:00~翌2:00(受付時間10:30~24:30)", closed:"不定休", mapDisable:"0" }, {"latlng":[34.664066008092250, 135.496517511639470], name:"XILLIA(エクシリア)", shopImg:"https://www.refle.info/salonImg/NDYxMEAxMEA2MjI1NTA3MDU3ZmVkQDkwQDQyMA%3D%3D.jpeg", open:"1", icon:"/images/googlemap/open/icon_massage.png", scaledSize : new google.maps.Size(30, 34.5), manage:"30", genreName:"メンズエステ", url:"/shop/xillia777/", shopName:"XILLIA(エクシリア)", shopTel:"080-4493-7672", reserve:"(予約優先)", time:"10:00~翌5:00(最終受付翌4:00)", closed:"年末年始", mapDisable:"0" }, {"latlng":[34.670030767109380, 135.497534953392800], name:"my graduation(マイグラジュエーション)", shopImg:"https://www.refle.info/salonImg/NzkyNUAxMEA2NThiZGQwMTg1ZWQyQDkwQDQyMA%3D%3D.jpeg", open:"1", icon:"/images/googlemap/open/icon_massage.png", scaledSize : new google.maps.Size(30, 34.5), manage:"30", genreName:"メンズエステ", url:"/shop/my-graduation/", shopName:"my graduation(マイグラジュエーション)", shopTel:"080-4480-9738", reserve:"(完全予約制)", time:"9:00~翌6:00(受付時間8:00~翌5:00)", closed:"不定休", mapDisable:"0" }, {"latlng":[34.668003971491220, 135.505784764417970], name:"俺のエステ", shopImg:"https://www.refle.info/salonImg/MTczMUAxMEA1ZThmNTVhZTg1NDQzQDkwQDQyMA%3D%3D.jpeg", open:"1", icon:"/images/googlemap/open/icon_massage.png", scaledSize : new google.maps.Size(30, 34.5), manage:"30", genreName:"店舗マッサージ", url:"/shop/oreno-esute/", shopName:"俺のエステ", shopTel:"06-6213-6900", reserve:"(予約優先)", time:"10:00~翌5:00", closed:"年中無休", mapDisable:"0" }, {"latlng":[34.666668500000000, 135.503526900000000], name:"AMZA(アムザ)", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/shop_s_close.png", scaledSize : new google.maps.Size(10, 10), manage:"5", genreName:"銭湯(公衆浴場)", url:"/shop/amza/", shopName:"AMZA(アムザ)", shopTel:"06-6633-1000", reserve:"", time:"12:00~翌10: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; }