「Widget:Custom map」の版間の差分
提供:メタファー リファンタジオ 攻略Wiki
ヘイグ運営用アカウント (トーク | 投稿記録) 編集の要約なし |
ヘイグ運営用アカウント (トーク | 投稿記録) 編集の要約なし |
||
1行目: | 1行目: | ||
<script> | <script> | ||
// | // Initialize required global objects | ||
window.GTP8 = { | window.GTP8 = { | ||
initializeMap: null, | initializeMap: null, | ||
71行目: | 12行目: | ||
}; | }; | ||
// Initialize API base URL | |||
(function() { | |||
const currentUrl = new URL(window.location.href); | |||
const baseUrl = currentUrl.origin + currentUrl.pathname.split('/').slice(0, -1).join('/'); | |||
window.API_BASE_URL = baseUrl; | |||
})(); | |||
// | // Map configuration must be defined before loading other scripts | ||
window.mapConfig = { | |||
imageUrl: '<!--{$img}-->', | |||
imageWidth: <!--{$imgwidth}-->, | |||
imageHeight: <!--{$imgheight}-->, | |||
minZoom: <!--{$minzoom}-->, | |||
maxZoom: <!--{$maxzoom}-->, | |||
geoJsonPage: '<!--{$geojson}-->', | |||
iconUrls: { | |||
icon1: '<!--{$icon1|default:"https://dq.h1g.jp/img/marker-icon-img/marker-icon-blue.png"}-->', | |||
icon2: '<!--{$icon2|default:"https://dq.h1g.jp/img/marker-icon-img/marker-icon-red.png"}-->', | |||
icon3: '<!--{$icon3|default:"https://dq.h1g.jp/img/marker-icon-img/marker-icon-violet.png"}-->', | |||
icon4: '<!--{$icon4|default:"https://dq.h1g.jp/img/marker-icon-img/marker-icon-green.png"}-->', | |||
icon5: '<!--{$icon5|default:"https://dq.h1g.jp/img/marker-icon-img/marker-icon-gold.png"}-->', | |||
icon6: '<!--{$icon6|default:"https://dq.h1g.jp/img/marker-icon-img/marker-icon-black.png"}-->' | |||
}, | |||
filters: { | |||
filter1: '<!--{$filter1|default:"分類1"}-->', | |||
filter2: '<!--{$filter2|default:"分類2"}-->', | |||
filter3: '<!--{$filter3|default:"分類3"}-->', | |||
filter4: '<!--{$filter4|default:"分類4"}-->', | |||
filter5: '<!--{$filter5|default:"分類5"}-->', | |||
filter6: '<!--{$filter6|default:"分類6"}-->' | |||
} | } | ||
} | }; | ||
// | // Debug verification | ||
console.log('Initial setup complete:', { | |||
GTP8: !!window.GTP8, | |||
mapConfig: !!window.mapConfig, | |||
API_BASE_URL: !!window.API_BASE_URL | |||
}); | }); | ||
</script> | </script> | ||
<!-- | <!-- Load scripts after configuration --> | ||
< | <script src="https://dq.h1g.jp/leaflet/gtp8-core.js"></script> | ||
</ | <script src="https://dq.h1g.jp/leaflet/gtp8-icons.js"></script> | ||
<script src="https://dq.h1g.jp/leaflet/gtp8-popups.js"></script> | |||
<script src="https://dq.h1g.jp/leaflet/gtp8-api.js"></script> | |||
<script src="https://dq.h1g.jp/leaflet/gtp8-init.js"></script> |
2024年11月10日 (日) 21:18時点における版
<script> // Initialize required global objects window.GTP8 = {
initializeMap: null, map: null, drawnItems: null, drawControl: null, editMode: false, api: {}, popups: {}, icons: {}
};
// Initialize API base URL (function() {
const currentUrl = new URL(window.location.href); const baseUrl = currentUrl.origin + currentUrl.pathname.split('/').slice(0, -1).join('/'); window.API_BASE_URL = baseUrl;
})();
// Map configuration must be defined before loading other scripts window.mapConfig = {
imageUrl: , imageWidth: , imageHeight: , minZoom: , maxZoom: , geoJsonPage: , iconUrls: { icon1: , icon2: , icon3: , icon4: , icon5: , icon6: }, filters: { filter1: , filter2: , filter3: , filter4: , filter5: , filter6: }
};
// Debug verification console.log('Initial setup complete:', {
GTP8: !!window.GTP8, mapConfig: !!window.mapConfig, API_BASE_URL: !!window.API_BASE_URL
}); </script>
<script src="https://dq.h1g.jp/leaflet/gtp8-core.js"></script> <script src="https://dq.h1g.jp/leaflet/gtp8-icons.js"></script> <script src="https://dq.h1g.jp/leaflet/gtp8-popups.js"></script> <script src="https://dq.h1g.jp/leaflet/gtp8-api.js"></script> <script src="https://dq.h1g.jp/leaflet/gtp8-init.js"></script>