diff options
Diffstat (limited to 'addon')
| -rw-r--r-- | addon/index.mjs | 17 | ||||
| -rw-r--r-- | addon/manifest.json | 10 |
2 files changed, 25 insertions, 2 deletions
diff --git a/addon/index.mjs b/addon/index.mjs new file mode 100644 index 0000000..323edf1 --- /dev/null +++ b/addon/index.mjs | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | const { Leaflet } = window.mapclay.renderers | ||
| 2 | const simpleRender = window.mapclay.renderWith(config => ({ | ||
| 3 | use: 'Leaflet', | ||
| 4 | width: '100%', | ||
| 5 | height: '200px', | ||
| 6 | XYZ: 'https://tile.openstreetmap.jp/styles/osm-bright/512/{z}/{x}/{y}.png', | ||
| 7 | ...config, | ||
| 8 | aliases: { | ||
| 9 | use: { Leaflet }, | ||
| 10 | ...(config.aliases ?? {}), | ||
| 11 | }, | ||
| 12 | })) | ||
| 13 | |||
| 14 | window.generateMaps(document.querySelector('main') ?? document.body, { | ||
| 15 | initialLayout: '', | ||
| 16 | render: simpleRender, | ||
| 17 | }) | ||
diff --git a/addon/manifest.json b/addon/manifest.json index 27433b3..9cc6607 100644 --- a/addon/manifest.json +++ b/addon/manifest.json | |||
| @@ -11,8 +11,14 @@ | |||
| 11 | 11 | ||
| 12 | "content_scripts": [ | 12 | "content_scripts": [ |
| 13 | { | 13 | { |
| 14 | "matches": ["*://*.mozilla.org/*"], | 14 | "matches": [ |
| 15 | "js": ["index.mjs"], | 15 | "*://*.mozilla.org/*", |
| 16 | "*://hackmd.io/*" | ||
| 17 | ], | ||
| 18 | "js": [ | ||
| 19 | "dumbymap.mjs", | ||
| 20 | "index.mjs" | ||
| 21 | ], | ||
| 16 | "css": [ | 22 | "css": [ |
| 17 | "css/dumbymap.css" | 23 | "css/dumbymap.css" |
| 18 | ] | 24 | ] |