「Widget:Custom map」の版間の差分
提供:メタファー リファンタジオ 攻略Wiki
ヘイグ運営用アカウント (トーク | 投稿記録) 編集の要約なし |
ヘイグ運営用アカウント (トーク | 投稿記録) 編集の要約なし |
||
20行目: | 20行目: | ||
<!-- Global Configuration --> | <!-- Global Configuration --> | ||
<script> | <script> | ||
// Initialize | // Initialize WidgetMap namespace with explicit function placeholder | ||
window. | window.WidgetMap = { | ||
map: null, | map: null, | ||
drawnItems: null, | drawnItems: null, | ||
73行目: | 73行目: | ||
<!-- Load scripts sequentially --> | <!-- Load scripts sequentially --> | ||
<script> | <script> | ||
// Clear any existing | // Clear any existing WidgetMap object | ||
if (window. | if (window.WidgetMap) { | ||
console.log('[Init] Clearing existing | console.log('[Init] Clearing existing WidgetMap object'); | ||
delete window. | delete window.WidgetMap; | ||
} | } | ||
// Initialize fresh | // Initialize fresh WidgetMap namespace | ||
window. | window.WidgetMap = { | ||
map: null, | map: null, | ||
drawnItems: null, | drawnItems: null, | ||
98行目: | 98行目: | ||
script.onload = () => { | script.onload = () => { | ||
console.log('[Script Loader] Successfully loaded:', src); | console.log('[Script Loader] Successfully loaded:', src); | ||
if (src.includes(' | if (src.includes('WidgetMap-core.js')) { | ||
// コア読み込み後の検証を強化 | // コア読み込み後の検証を強化 | ||
const verification = { | const verification = { | ||
hasWidgetMap: !!window.WidgetMap, | |||
initializeMapType: typeof window. | initializeMapType: typeof window.WidgetMap.initializeMap, | ||
isFunction: typeof window. | isFunction: typeof window.WidgetMap.initializeMap === 'function' | ||
}; | }; | ||
console.log('[Script Loader] Core verification:', verification); | console.log('[Script Loader] Core verification:', verification); | ||
122行目: | 122行目: | ||
// スクリプトの順次読み込み | // スクリプトの順次読み込み | ||
return Promise.resolve() | return Promise.resolve() | ||
.then(() => loadScript('https://dq.h1g.jp/leaflet/ | .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-core.js')) | ||
.then(() => loadScript('https://dq.h1g.jp/leaflet/ | .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-icons.js')) | ||
.then(() => loadScript('https://dq.h1g.jp/leaflet/ | .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-popups.js')) | ||
.then(() => loadScript('https://dq.h1g.jp/leaflet/ | .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-api.js')) | ||
.then(() => loadScript('https://dq.h1g.jp/leaflet/ | .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-init.js')); | ||
} | } | ||