diff options
-rw-r--r-- | addon/index.mjs | 22 | ||||
-rw-r--r-- | src/dumbymap.mjs | 1 |
2 files changed, 17 insertions, 6 deletions
diff --git a/addon/index.mjs b/addon/index.mjs index 77716b6..4de11e0 100644 --- a/addon/index.mjs +++ b/addon/index.mjs | |||
@@ -34,10 +34,20 @@ const simpleRender = window.mapclay.renderWith(config => ({ | |||
34 | }, | 34 | }, |
35 | })) | 35 | })) |
36 | 36 | ||
37 | window.generateMaps(document.querySelector('main') ?? document.body, { | 37 | if (!document.querySelector('.Dumby')) { |
38 | crs: url.searchParams.get('crs') ?? 'EPSG:4326', | 38 | window.generateMaps(document.querySelector('main') ?? document.body, { |
39 | addBlocks, | 39 | crs: url.searchParams.get('crs') ?? 'EPSG:4326', |
40 | initialLayout: 'sticky', | 40 | addBlocks, |
41 | render: simpleRender, | 41 | initialLayout: 'sticky', |
42 | autoMap: true, | 42 | render: simpleRender, |
43 | autoMap: true, | ||
44 | }) | ||
45 | } | ||
46 | |||
47 | new window.MutationObserver((ms) => { | ||
48 | for (const m of ms) { | ||
49 | console.log(m) | ||
50 | } | ||
51 | }).observe(document.querySelector('#doc'), { | ||
52 | childList: true, | ||
43 | }) | 53 | }) |
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs index 13f4574..e9cb473 100644 --- a/src/dumbymap.mjs +++ b/src/dumbymap.mjs | |||
@@ -457,6 +457,7 @@ export const generateMaps = (container, { | |||
457 | const mapContainer = document.createElement('pre') | 457 | const mapContainer = document.createElement('pre') |
458 | mapContainer.className = 'mapclay-container' | 458 | mapContainer.className = 'mapclay-container' |
459 | mapContainer.textContent = '#Created by DumbyMap' | 459 | mapContainer.textContent = '#Created by DumbyMap' |
460 | mapContainer.style.cssText = 'display: none;' | ||
460 | htmlHolder.insertBefore(mapContainer, htmlHolder.firstElementChild) | 461 | htmlHolder.insertBefore(mapContainer, htmlHolder.firstElementChild) |
461 | elementsWithMapConfig.push(mapContainer) | 462 | elementsWithMapConfig.push(mapContainer) |
462 | } | 463 | } |