|
|
23行目: |
23行目: |
| <script> | | <script> |
| // Initialize global namespace | | // Initialize global namespace |
| window.widgetmap = { | | window.GTP8 = {}; |
| initializeMap: null,
| |
| map: null,
| |
| drawnItems: null,
| |
| drawControl: null,
| |
| editMode: false,
| |
| api: {},
| |
| popups: {},
| |
| icons: {}
| |
| }; | |
|
| |
|
| // Initialize API base URL | | // Initialize API base URL |
66行目: |
57行目: |
| } | | } |
| }; | | }; |
| // Load scripts sequentially | | </script> |
| function loadScript(url) {
| |
| return new Promise((resolve, reject) => {
| |
| const script = document.createElement('script');
| |
| script.src = url;
| |
| script.onload = resolve;
| |
| script.onerror = reject;
| |
| document.head.appendChild(script);
| |
| });
| |
| }
| |
|
| |
|
| async function loadAllScripts() {
| | <!-- Application Scripts --> |
| try {
| | <script src="https://dq.h1g.jp/leaflet/gtp8-core.js"></script> |
| await loadScript('https://dq.h1g.jp/leaflet/widgetmap-core.js');
| | <script src="https://dq.h1g.jp/leaflet/gtp8-icons.js"></script> |
| console.log('Core loaded:', !!window.widgetmap.initializeMap);
| | <script src="https://dq.h1g.jp/leaflet/gtp8-popups.js"></script> |
|
| | <script src="https://dq.h1g.jp/leaflet/gtp8-api.js"></script> |
| await loadScript('https://dq.h1g.jp/leaflet/widgetmap-icons.js');
| | <script src="https://dq.h1g.jp/leaflet/gtp8-init.js"></script> |
| console.log('Icons loaded');
| |
|
| |
| await loadScript('https://dq.h1g.jp/leaflet/widgetmap-popups.js');
| |
| console.log('Popups loaded');
| |
|
| |
| await loadScript('https://dq.h1g.jp/leaflet/widgetmap-api.js');
| |
| console.log('API loaded');
| |
|
| |
| await loadScript('https://dq.h1g.jp/leaflet/widgetmap-init.js');
| |
| console.log('Init loaded');
| |
|
| |
| console.log('All scripts loaded successfully');
| |
| } catch (error) {
| |
| console.error('Script loading error:', error);
| |
| alert('スクリプトの読み込みに失敗しました。');
| |
| }
| |
| }
| |
| | |
| // Start loading scripts when document is ready
| |
| $(document).ready(function() {
| |
| loadAllScripts();
| |
| });
| |
| </script> | |
| </includeonly> | | </includeonly> |