// Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { fn = 'skiboard.png'; } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // ski stock/pole else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } // wetsuit / life jacket (separately written) else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { fn = 'skiboard.png'; } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // ski stock/pole else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } // wetsuit / life jacket (separately written) else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { fn = 'skiboard.png'; } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // ski stock/pole else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } // wetsuit / life jacket (separately written) else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { fn = 'skiboard.png'; } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // ski stock/pole else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } // wetsuit / life jacket (separately written) else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { fn = 'skiboard.png'; } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // ski stock/pole else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } // wetsuit / life jacket (separately written) else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml);e = card.getAttribute('data-fname') || ''; box.innerHTML = '
読み込み中...
'; ensureRentalsReady().then(function(){ var items = cleanItems(getRentals({ name: name })); if (Array.isArray(items) && items.length) { box.innerHTML = renderRentalIcons(items); // after insertion, resolve images before showing to avoid flicker hydrateRentalIcons(box); // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k icon filename (put files under ./icons/) var RENTAL_ICONS = { // ski "スキー": "skiboard.png", "スキー板": "skiboard.png", // ski boots "スキーブーツ": "skibouts.png", "スキー ブーツ": "skibouts.png", "ブーツ(スキー)": "skibouts.png", // ski pole "スキーストック": "skistock.png", "ストック": "skistock.png", "ポール": "skistock.png", // snowboard "スノーボード": "snowboard.png", "スノーボード板": "snowboard.png", // snowboard boots "スノーボードブーツ": "snowboots.png", "スノーブーツ": "snowboots.png", "ボードブーツ": "snowboots.png", // binding "バインディング": "binding.png", "ビンディング": "binding.png", // safety "ヘルメット": "helmet.png", // water "ウェットスーツ": "wetsuit.png", "ライフジャケット": "wetsuit.png", "ライジャケ": "wetsuit.png" }; function canonicalizeItem(label){ var s = String(label||'').trim(); // unify spaces (remove all), normalize slashes, drop simple parentheses notes // - handles: 'スキー 板' -> 'スキー板', 'スキー ストック' -> 'スキーストック' // - handles: fullwidth slash -> ascii, combined labels like 'ウェットスーツ/ライフジャケット' s = s.replace(/[((].*?[))]/g, ''); // remove parenthetical notes s = s.replace(/[/]/g, '/'); // normalize fullwidth slash s = s.replace(/\s+/g, ''); // remove all spaces // unify combined water-safety label into a canonical key if (s === 'ウェットスーツ/ライフジャケット' || s === 'ライフジャケット/ウェットスーツ') { s = 'ウェットスーツ'; } // normalize split ski terms just in case (redundant after space removal, but safe) s = s.replace(/スキー板/g, 'スキー板'); s = s.replace(/スキー(ストック|ポール)/g, 'スキーストック'); return s; } function getIconInfo(label){ var key = canonicalizeItem(label); // group: water safety (wetsuit/lifejacket) if (key === 'ウェットスーツ' || key === 'ライフジャケット' || key === 'ライジャケ') { return { icon: 'wetsuit.png', group: 'water_safety' }; } var fn = RENTAL_ICONS[key] || RENTAL_ICONS[label]; // fuzzy fallbacks for common variants (in case CSV/header wording differs) if (!fn) { // ski board if (key.indexOf('スキー板') >= 0 || (/スキー.*板/.test(key)) || (/板.*スキー/.test(key)) || (/スキー/.test(key) && !/(ブーツ|ストック|ポール)/.test(key))) { fn = 'skiboard.png'; } var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // ski stock/pole else if (key.indexOf('スキーストック') >= 0 || key.indexOf('ストック') >= 0 || key.indexOf('ポール') >= 0) { fn = 'skistock.png'; } // snowboard board (not boots) else if ((/スノーボード/.test(key) || /スノボ/.test(key)) && !/ブーツ/.test(key)) { fn = 'snowboard.png'; } // wetsuit / life jacket (separately written) else if (key.indexOf('ウェットスーツ') >= 0 || key.indexOf('ライフジャケット') >= 0 || key.indexOf('ライジャケ') >= 0) { fn = 'wetsuit.png'; } } if (fn) return { icon: fn, group: fn }; return { icon: null, group: null }; } // image fallback handler: try multiple paths, then degrade to text pill window.onRentalImgError = function(img){ try { var sources = String(img.getAttribute('data-srcs')||'').split('|').filter(Boolean); var idx = parseInt(img.getAttribute('data-f')||'0', 10); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })(); // Try to get the Leaflet map instance var _map = window.map; if (!_map) { try { for (var k in window) { if (window[k] && window[k] instanceof L.Map) { _map = window[k]; break; } } } catch(e) {} } if (!_map) return; if (_map && typeof _map.eachLayer === 'function') { _map.eachLayer(function(layer){ try { if (layer && typeof layer.getLatLng === 'function') { var ll = layer.getLatLng(); var fac = facs.find(function(f){ return Math.abs(f.lat - ll.lat) < 1e-6 && Math.abs(f.lon - ll.lng) < 1e-6; }); if (!fac) return; var extra = "🚗 駐車: " + (fac.parking || "不明"); if (layer.getPopup && layer.getPopup()) { var existing = layer.getPopup().getContent(); if (typeof existing === 'string') { if (existing.indexOf("駐車:") >= 0) return; layer.setPopupContent(existing + (existing ? "
" : "") + extra); } } else if (layer.bindPopup) { var base = "" + (fac.name || "") + ""; if (fac.type) base += "
" + fac.type; if (fac.pref_city) base += "
" + fac.pref_city; layer.bindPopup(base + "
" + extra); } } } catch(e) {} }); } })(); if (idx + 1 < sources.length) { img.setAttribute('data-f', String(idx + 1)); img.src = sources[idx + 1]; return; } // final fallback: replace with pill var title = img.getAttribute('data-title') || ''; var pill = document.createElement('div'); pill.className = 'ri ri-pill'; pill.title = title; pill.textContent = title; var parent = img.parentNode; if (parent && parent.parentNode) { parent.parentNode.replaceChild(pill, parent); } } catch(e) { try { var p = img.parentNode; if (p && p.parentNode) { var d = document.createElement('div'); d.className = 'ri ri-pill'; d.textContent = img.getAttribute('data-title') || ''; p.parentNode.replaceChild(d, p); } } catch(_) {} } }; function renderRentalIcons(items){ var html = ['
']; // group items so synonyms share one icon var byGroup = {}; var pills = []; items.forEach(function(label){ var info = getIconInfo(label); if (info.icon) { if (!byGroup[info.group]) byGroup[info.group] = { icon: info.icon, labels: [] }; byGroup[info.group].labels.push(label); } else { pills.push(label); } }); Object.keys(byGroup).forEach(function(g){ var fn = byGroup[g].icon; var labels = Array.from(new Set(byGroup[g].labels)); var title = labels.join('/'); // Multi-path fallback to avoid path/redirect issues on some hosts var ORG = (typeof location!=='undefined' && /^https?:/i.test(location.origin)) ? location.origin : ''; var src0 = (ORG ? (ORG + '/icons/' + fn + '?v=20251112a') : '/icons/' + fn + '?v=20251112a'); // prefer absolute origin first var src1 = '/icons/' + fn + '?v=20251112a'; var src2 = './icons/' + fn + '?v=20251112a'; var src3 = 'icons/' + fn + '?v=20251112a'; var src4 = '/icons/' + fn; var src5 = (ORG ? (ORG + '/icons/' + fn) : ''); var srcs = [src0, src1, src2, src3, src4, src5].filter(Boolean).join('|'); var itemHtml = '
' + ''+title+'' + '
'+title+'
' + '
'; html.push(itemHtml); }); pills.forEach(function(label){ html.push('
'+label+'
'); }); html.push('
'); return html.join(''); } // hydrate images after DOM insertion: sequentially preload and set final src async function hydrateRentalIcons(root){ try{ var imgs = (root || document).querySelectorAll('img.lazy-rental'); if (!imgs || !imgs.length) return; function tryLoad(url){ return new Promise(function(resolve){ if (!url) { resolve(false); return; } var i = new Image(); i.onload = function(){ resolve(true); }; i.onerror = function(){ resolve(false); }; i.src = url; }); } for (var k=0;k= 0 ? 'ライフジャケット' : 'ウェットスーツ'; } // keep original label for user-facing pill/title, but use normalized key for dedupe var display = (/ライフジャケット|ウェットスーツ/).test(k) ? (k) : p; if (isJunk(p)) return; if (!seen.has(k)) { seen.add(k); out.push(display); } }); }); return out; } window.getRentals = function(f){ try { if (f && Array.isArray(f.rentals)) return f.rentals; var map = window.RENTALS_OF || {}; var key = f && f.name ? f.name : ''; var exact = map[key]; if (Array.isArray(exact)) return exact; // fuzzy by normalized name keys var nk = normalizeName(key); for (var k in map){ if (!Object.prototype.hasOwnProperty.call(map,k)) continue; var nmk = normalizeName(k); if (nmk === nk || nmk.includes(nk) || nk.includes(nmk)) return map[k]; } return []; } catch(e) { return []; } } // optional preset window.RENTALS_OF = window.RENTALS_OF || {}; // tap caption helper: show for 2 seconds window.showRentalCap = (function(){ var timers = new WeakMap(); return function(el){ try { el.classList.add('show-cap'); if (timers.has(el)) clearTimeout(timers.get(el)); var t = setTimeout(function(){ el.classList.remove('show-cap'); }, 2000); timers.set(el, t); } catch(e) {} }; })();