var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶 var contentStr = null; var stationList = [ {"latlng":[35.162177300000000, 136.920591599999970], name:"NIKITA 本店", 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/nikita/", shopName:"NIKITA 本店", shopTel:"052-269-3450", reserve:"", time:"11:00~21:00(最終受付19:00)", closed:"日曜", mapDisable:"0" }, {"latlng":[35.173394173649314, 136.911169892030780], name:"Kewl(クール)", 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/kewl/", shopName:"Kewl(クール)", shopTel:"052-684-6888", reserve:"", time:"11:00~20:00", closed:"月曜、毎週月曜日、第1・第2日曜日", mapDisable:"0" }, {"latlng":[35.168406500000000, 136.905176100000060], name:"NIKITA 栄 丸栄店", 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/nikita-marusakae/", shopName:"NIKITA 栄 丸栄店", shopTel:"052-264-6425", reserve:"", time:"10:00~20:00", closed:"1月1日(元旦)のみ", mapDisable:"0" }, {"latlng":[35.163934800000000, 136.903784699999960], name:"RYO-NAIL", 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/ryo-nail/", shopName:"RYO-NAIL", shopTel:"052-269-6616", reserve:"(完全予約制)", time:"11:00~20:00/日11:00~18:00", closed:"不定休", mapDisable:"0" }, {"latlng":[35.163342656454000, 136.909644868682450], name:"NAILX-avenir", 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/nailist-avenir/", shopName:"NAILX-avenir", shopTel:"052-251-2882", reserve:"(予約優先)", time:"11:00~20:00", closed:"月曜、不定休", mapDisable:"0" }, {"latlng":[35.166261540580330, 136.907439706116860], name:"NAILX 栄ガスビル", 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/nailist-sakaegasubiru/", shopName:"NAILX 栄ガスビル", shopTel:"052-251-1105", reserve:"(予約優先)", time:"10: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; }