var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶 var contentStr = null; var stationList = [ {"latlng":[35.002273300000000, 135.758885900000000], name:"nailsalon LYS(ネイルサロンリス)", 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/nail-lys/", shopName:"nailsalon LYS(ネイルサロンリス)", shopTel:"075-748-1505", reserve:"", time:"11:00~22:00/土日11:00~20:00", closed:"不定休", mapDisable:"0" }, {"latlng":[35.005120300000000, 135.755813900000020], name:"Dix Bijoux(ディスビジュー)", 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/Dix-Bijoux/", shopName:"Dix Bijoux(ディスビジュー)", shopTel:"075-213-2383", reserve:"", time:"10:00~18:00(最終受付)", closed:"不定休", mapDisable:"0" }, {"latlng":[35.002412199999990, 135.756916600000070], name:"estnail(エストネイル)京都店", 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/estnail-kyoto/", shopName:"estnail(エストネイル)京都店", shopTel:"075-741-6001", reserve:"", time:"12:00~21:00/土日祝10:00~19:00", closed:"月曜、月曜日(祝日を除く)祝日の場合は火曜日定休日", mapDisable:"0" }, {"latlng":[35.004767500000000, 135.762485500000030], name:"SEPT 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/septnail-sijyo/", shopName:"SEPT NAIL(セプトネイル)四条烏丸店", shopTel:"075-241-3334", reserve:"", time:"10:00~21:00/日祝10:00~20: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; }