var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶 var contentStr = null; var stationList = [ {"latlng":[34.655665687032470, 135.817705065641380], name:"Moon light(ムーンライト)", shopImg:"https://www.refle.info/salonImg/NzY2NkAxMEA2M2JlMGNiYTMwOWUzQDkwQDQyMA%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/moonlight-nara/", shopName:"Moon light(ムーンライト)", shopTel:"080-1519-2828", reserve:"(完全予約制)", time:"10:00~翌1:00(24時間受付)", closed:"不定休", mapDisable:"0" }, {"latlng":[34.682371915475200, 135.817424673016380], name:"NAROMA 奈良店(ナロマ)", shopImg:"https://www.refle.info/salonImg/MjUwNkAwQGZjZTQ0ODM5ODkwZmVhNDk2N2E0MmEyOTU3MmQ0Yjg2QDkwQDQyMA%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/naroma/", shopName:"NAROMA 奈良店(ナロマ)", shopTel:"090-8828-0016", reserve:"(完全予約制)", time:"10:00~翌5:30(最終受付翌3:00)", closed:"年中無休", mapDisable:"0" }, {"latlng":[34.554139102216894, 135.784037975990100], name:"HEAVENLY(ヘブンリー)", shopImg:"https://www.refle.info/salonImg/NjQ5MkAxMEA2MTA3Zjc3Mzg1MGM0QDkwQDQyMA%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/heavenly-nara/", shopName:"HEAVENLY(ヘブンリー)", shopTel:"080-8943-2214", reserve:"(完全予約制)", time:"10:00~翌3:00(受付時間10:00~翌2:00)", closed:"不定休", mapDisable:"0" }, {"latlng":[34.600044200000000, 135.737366729430400], name:"エステラボ", shopImg:"https://www.refle.info/salonImg/NDQzNkAxMEA2NTM3YTUyZWYzY2Y4QDkwQDQyMA%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/este-lab/", shopName:"エステラボ", shopTel:"080-4244-9624", reserve:"(要予約)", time:"10:00~翌3:00", closed:"不定休", mapDisable:"0" }, {"latlng":[34.682257259267340, 135.817644830094200], name:"fable(フェーブル)", shopImg:"https://www.refle.info/salonImg/NTc1M0AxMEA2MDYzYjkwODYzMDI2QDkwQDQyMA%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/fable/", shopName:"fable(フェーブル)", shopTel:"090-4278-1011", reserve:"(完全予約制)", time:"12:00~翌1:00(最終受付22:00)", closed:"不定休", mapDisable:"0" }, {"latlng":[34.685424655134800, 135.807590910799100], name:"Curacion(クラシオン)", shopImg:"https://www.refle.info/salonImg/NjI2OEAxMEA1ZTk4ZmNiNTZiOTQ3QDkwQDQyMA%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/curacion-nara/", shopName:"Curacion(クラシオン)", shopTel:"080-3853-7643", reserve:"(予約優先)", time:"10:00~翌2:00(最終受付翌1:30)", 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; }