「テンプレート:検索結果カード」の版間の差分
提供: 川西図鑑
その他の操作
編集の要約なし |
編集の要約なし |
||
| 9行目: | 9行目: | ||
| [[File:{{{画像}}}|middle|class=crop-img]] | | [[File:{{{画像}}}|middle|class=crop-img]] | ||
}} | }} | ||
{{#if: {{{ストリートビューURL|}}} | |||
< | | <div class="streetview-placeholder" data-url="{{{ストリートビューURL}}}" style="width: 100%; height: 100%;"></div> | ||
| <div class="streetview-api-placeholder" data-name="{{{座標}}}" style="width: 100%; height: 100%;"></div> | |||
}} | |||
</div> | </div> | ||
<div class="card-info"> | <div class="card-info"> | ||
| 78行目: | 79行目: | ||
} | } | ||
</style> | </style> | ||
<script> | |||
document.querySelectorAll(".streetview-placeholder").forEach(function(el) { | |||
const url = el.getAttribute("data-url"); | |||
if (!url) return; | |||
const iframe = document.createElement("iframe"); | |||
iframe.src = url; | |||
iframe.width = "100%"; | |||
iframe.height = "100%"; | |||
iframe.style.border = "0"; | |||
iframe.loading = "lazy"; | |||
iframe.allowFullscreen = true; | |||
iframe.referrerPolicy = "no-referrer-when-downgrade"; | |||
el.appendChild(iframe); | |||
}); | |||
document.querySelectorAll(".streetview-api-placeholder").forEach(function(el) { | |||
const name = el.getAttribute("data-name"); | |||
if (!name) return; | |||
const src = `https://www.google.com/maps/embed/v1/streetview?key=AIzaSyDOA7e6S9arQa6NvnsFYXxGjX9P_ycwoyM&location=${name}`; | |||
const iframe = document.createElement("iframe"); | |||
iframe.src = src; | |||
iframe.width = "100%"; | |||
iframe.height = "100%"; | |||
iframe.style.border = "0"; | |||
iframe.loading = "lazy"; | |||
iframe.allowFullscreen = true; | |||
iframe.referrerPolicy = "no-referrer-when-downgrade"; | |||
el.appendChild(iframe); | |||
}); | |||
</script> | |||
</html> | </html> | ||
2025年12月5日 (金) 12:39時点における版
[[{{{_pageName}}}|{{{店名}}}]]
昼: - ~- 夜: - ~-