diff options
Diffstat (limited to 'addon/index.mjs')
-rw-r--r-- | addon/index.mjs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addon/index.mjs b/addon/index.mjs index b5d71ba..77716b6 100644 --- a/addon/index.mjs +++ b/addon/index.mjs | |||
@@ -1,4 +1,5 @@ | |||
1 | const url = new URL(window.location) | 1 | const url = new URL(window.location) |
2 | const use = url.searchParams.get('use') | ||
2 | if (url.host === 'www.ptt.cc') { | 3 | if (url.host === 'www.ptt.cc') { |
3 | const content = document.querySelector('#main-content') | 4 | const content = document.querySelector('#main-content') |
4 | Array.from(content.childNodes) | 5 | Array.from(content.childNodes) |
@@ -22,7 +23,7 @@ const addBlocks = blockSelector | |||
22 | : undefined | 23 | : undefined |
23 | 24 | ||
24 | const simpleRender = window.mapclay.renderWith(config => ({ | 25 | const simpleRender = window.mapclay.renderWith(config => ({ |
25 | use: 'Leaflet', | 26 | use: use ?? 'Leaflet', |
26 | width: '100%', | 27 | width: '100%', |
27 | height: '200px', | 28 | height: '200px', |
28 | XYZ: 'https://tile.openstreetmap.jp/styles/osm-bright/512/{z}/{x}/{y}.png', | 29 | XYZ: 'https://tile.openstreetmap.jp/styles/osm-bright/512/{z}/{x}/{y}.png', |
@@ -36,7 +37,7 @@ const simpleRender = window.mapclay.renderWith(config => ({ | |||
36 | window.generateMaps(document.querySelector('main') ?? document.body, { | 37 | window.generateMaps(document.querySelector('main') ?? document.body, { |
37 | crs: url.searchParams.get('crs') ?? 'EPSG:4326', | 38 | crs: url.searchParams.get('crs') ?? 'EPSG:4326', |
38 | addBlocks, | 39 | addBlocks, |
39 | initialLayout: '', | 40 | initialLayout: 'sticky', |
40 | render: simpleRender, | 41 | render: simpleRender, |
41 | autoMap: true, | 42 | autoMap: true, |
42 | }) | 43 | }) |