「Widget:Custom map」の版間の差分

提供:メタファー リファンタジオ 攻略Wiki
移動先:案内検索
編集の要約なし
編集の要約なし
20行目: 20行目:
<!-- Global Configuration -->
<!-- Global Configuration -->
<script>
<script>
// Initialize GTP8 namespace with explicit function placeholder
// Initialize WidgetMap namespace with explicit function placeholder
window.GTP8 = {
window.WidgetMap = {
     map: null,
     map: null,
     drawnItems: null,
     drawnItems: null,
73行目: 73行目:
<!-- Load scripts sequentially -->
<!-- Load scripts sequentially -->
<script>
<script>
// Clear any existing GTP8 object
// Clear any existing WidgetMap object
if (window.GTP8) {
if (window.WidgetMap) {
     console.log('[Init] Clearing existing GTP8 object');
     console.log('[Init] Clearing existing WidgetMap object');
     delete window.GTP8;
     delete window.WidgetMap;
}
}


// Initialize fresh GTP8 namespace
// Initialize fresh WidgetMap namespace
window.GTP8 = {
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('gtp8-core.js')) {
                 if (src.includes('WidgetMap-core.js')) {
                     // コア読み込み後の検証を強化
                     // コア読み込み後の検証を強化
                     const verification = {
                     const verification = {
                         hasGTP8: !!window.GTP8,
                         hasWidgetMap: !!window.WidgetMap,
                         initializeMapType: typeof window.GTP8.initializeMap,
                         initializeMapType: typeof window.WidgetMap.initializeMap,
                         isFunction: typeof window.GTP8.initializeMap === 'function'
                         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/gtp8-core.js'))
         .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-core.js'))
         .then(() => loadScript('https://dq.h1g.jp/leaflet/gtp8-icons.js'))
         .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-icons.js'))
         .then(() => loadScript('https://dq.h1g.jp/leaflet/gtp8-popups.js'))
         .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-popups.js'))
         .then(() => loadScript('https://dq.h1g.jp/leaflet/gtp8-api.js'))
         .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-api.js'))
         .then(() => loadScript('https://dq.h1g.jp/leaflet/gtp8-init.js'));
         .then(() => loadScript('https://dq.h1g.jp/leaflet/widgetmap-init.js'));
}
}



2024年11月10日 (日) 22:31時点における版