var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶 var contentStr = null; var stationList = [ {"latlng":[34.576687000000010, 135.497346500000050], name:"中央カイロプラクティック院 堺", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bodywork_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"整体院", url:"/shop/chiro-sakai/", shopName:"中央カイロプラクティック院 堺", shopTel:"0120-1379-49", reserve:"(完全予約制)", time:"9:30~19:30(12:30~15:30迄休診)", closed:"木曜、日曜", mapDisable:"0" }, {"latlng":[34.561414000000000, 135.512192400000000], name:"からだ工房“動楽”", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bodywork_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"整体院", url:"/shop/kkmtubo/", shopName:"からだ工房“動楽”", shopTel:"072-257-3929", reserve:"", time:"9:00~21:00(最終受付19:30)", closed:"不定休", mapDisable:"0" }, {"latlng":[34.580673200000010, 135.517727299999930], name:"おおいし載整体院", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bodywork_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"整体院", url:"/shop/ohishi-seitai/", shopName:"おおいし載整体院", shopTel:"072-258-9008", reserve:"", time:"10:00~21:00/日祝10:00~17:00(月~土:17時~18時30分迄休診)", closed:"水曜、第3日曜日", mapDisable:"0" }, {"latlng":[34.559866400000000, 135.489567099999930], name:"堺自然整体院", shopImg:"https://www.refle.info/salonImg/QEBAOTBANDIw.jpeg", open:"2", icon:"/images/googlemap/close/icon_bodywork_close.png", scaledSize : new google.maps.Size(20, 23), manage:"5", genreName:"整体院", url:"/shop/otori/", shopName:"堺自然整体院", shopTel:"072-243-2000", reserve:"", time:"未定", 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; }