Widget:Custom map
提供:メタファー リファンタジオ 攻略Wiki
<script> (function() {
// Load required styles const styles = [ "https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.css", "https://unpkg.com/leaflet@1.9.4/dist/leaflet.css", "https://dq.h1g.jp/img/dq10_offline/map/css/leaflet-easy-button.css", "https://dq.h1g.jp/img/dq10_offline/map/css/leaflet-tag-filter-button.css", "https://dq.h1g.jp/img/marker-icon-img/editable-popup.css", "https://dq.h1g.jp/img/lightgallery.min.css" ]; styles.forEach(href => { const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = href; document.head.appendChild(link); });
// Load required scripts in order const scripts = [ "https://code.jquery.com/jquery-3.7.1.min.js", "https://dq.h1g.jp/leaflet/leaflet.js", "https://dq.h1g.jp/img/dq10_offline/map/js/leaflet-easy-button.js", "https://dq.h1g.jp/img/dq10_offline/map/js/leaflet-tag-filter-button.js", "https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.js", "https://dq.h1g.jp/leaflet/custom-leaflet-draw-locale.js", "https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/lightgallery.min.js", "https://dq.h1g.jp/leaflet/leafletmaps-widget.js" // メインのJavaScript実装 ];
function loadScriptSequentially(index) { if (index >= scripts.length) { // 全スクリプトのロードが完了したら初期化 if (window.initLeafletMap) { window.initLeafletMap({ img: , imgwidth: , imgheight: , minzoom: , maxzoom: , geojson: , filters: { filter1: , filter2: , filter3: , filter4: , filter5: , filter6: } }); } return; }
const script = document.createElement('script'); script.src = scripts[index]; script.onload = () => loadScriptSequentially(index + 1); document.body.appendChild(script); }
loadScriptSequentially(0);
})(); </script>