From 4c7d08b6e455198d497b75250d003dd932cbda5e Mon Sep 17 00:00:00 2001 From: Dan Leech Date: Tue, 27 Oct 2026 20:18:44 +0000 Subject: [PATCH 1/2] Document the engine packages, CSP support and upgrading to v1 --- docs/api.md | 49 ++-- docs/examples/add-marker-with-panel.mdx | 4 - docs/examples/add-polygons.mdx | 4 - docs/examples/add-symbols.mdx | 4 - docs/examples/basic-map.mdx | 4 - docs/examples/button-map.mdx | 4 - docs/examples/draw-tools.mdx | 4 - docs/examples/place-marker.mdx | 11 +- docs/examples/search-control.mdx | 4 - docs/examples/select-feature.mdx | 4 - docs/examples/style-switcher.mdx | 4 - docs/examples/toggle-marker-label.mdx | 4 - docs/getting-started.md | 291 ++++++++++++------------ docs/plugins/datasets.md | 8 +- docs/plugins/draw.md | 11 +- docs/plugins/map-key.md | 1 - docs/upgrading-to-v1.md | 102 +++++++++ docusaurus.config.cjs | 8 +- 18 files changed, 283 insertions(+), 238 deletions(-) create mode 100644 docs/upgrading-to-v1.md diff --git a/docs/api.md b/docs/api.md index 5c98d640..748f4a63 100644 --- a/docs/api.md +++ b/docs/api.md @@ -328,51 +328,54 @@ new InteractiveMap('map', { --- -### `mapProvider` -**Type:** `function` -**Required** - -A function that returns a map provider — the abstraction layer that interfaces with the underlying map engine. It is called only when the map is opened so the provider code is not sent to the user unless needed. - -```js -new InteractiveMap('map', { - mapProvider: maplibreProvider() -}) -``` +### `mapProviderOptions` +**Type:** `Object` -#### MapLibre provider options +Settings for the map engine. Which settings apply depends on the package. -`maplibreProvider()` accepts an optional config object. +#### MapLibre (`@defra/interactive-map`) ##### `workerUrl` **Type:** `string` -**Default:** `undefined` -URL of the MapLibre worker file. This is set automatically with webpack, Vite and the UMD build. +URL of the MapLibre worker file. This is set for you with webpack, Vite and the UMD scripts. -With other bundlers (such as Rollup and esbuild), copy `node_modules/maplibre-gl/dist/maplibre-gl-worker.mjs` to your assets and set its URL here. If it's missing, the console explains this. +With Rollup or esbuild, copy `node_modules/maplibre-gl/dist/maplibre-gl-worker.mjs` to your assets and set its URL here. If it's missing, the console explains this. ```js -maplibreProvider({ workerUrl: '/your-assets-path/maplibre-gl-worker.mjs' }) +mapProviderOptions: { workerUrl: '/your-assets-path/maplibre-gl-worker.mjs' } ``` -#### OpenLayers provider options +#### OpenLayers (`@defra/interactive-map-openlayers`) -`openLayersProvider()` accepts an optional config object. The provider renders in British National Grid (EPSG:27700) — this isn't configurable. +The map is always in British National Grid (EPSG:27700). ##### `zoomAlignment` **Type:** `string` **Default:** `'uk'` -Which zoom-level sequence the map's view resolutions follow. +Which zoom levels the map uses. | Possible values | Description | | :--- | :--- | -| `'uk'` | OS tile grid zoom levels (0–13); zoom 0 shows all of Great Britain. | -| `'world'` | ESRI LOD sequence, for zoom levels that match the ESRI SDK; full UK visible around zoom 7. | +| `'uk'` | OS tile grid zoom levels (0–13). Zoom 0 shows all of Great Britain. | +| `'world'` | The same zoom levels as the ArcGIS SDK. All of the UK shows at about zoom 7. | + +```js +mapProviderOptions: { zoomAlignment: 'world' } +``` + +#### Esri (`@defra/interactive-map-esri`) + +##### `setupConfig` +**Type:** `function` + +Called with the ArcGIS SDK's `esriConfig` before the map is created, for example to set an API key. ```js -openLayersProvider({ zoomAlignment: 'world' }) +mapProviderOptions: { + setupConfig: (esriConfig) => { esriConfig.apiKey = 'YOUR_API_KEY' } +} ``` --- diff --git a/docs/examples/add-marker-with-panel.mdx b/docs/examples/add-marker-with-panel.mdx index cb7f16f0..e917a445 100644 --- a/docs/examples/add-marker-with-panel.mdx +++ b/docs/examples/add-marker-with-panel.mdx @@ -13,7 +13,6 @@ Add markers to the map and allow users to select them. Selecting a marker fires language: 'js', code: ` import InteractiveMap from '@defra/interactive-map' - import maplibreProvider from '@defra/interactive-map/providers/maplibre' import createInteractPlugin from '@defra/interactive-map/plugins/interact' const interactPlugin = createInteractPlugin({ @@ -22,7 +21,6 @@ Add markers to the map and allow users to select them. Selecting a marker fires const map = new InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', @@ -70,7 +68,6 @@ Add markers to the map and allow users to select them. Selecting a marker fires language: 'html', code: ` - - @@ -218,7 +215,6 @@ Use the datasets plugin to overlay GeoJSON polygon data on your map. This exampl new defra.InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: defra.maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', diff --git a/docs/examples/add-symbols.mdx b/docs/examples/add-symbols.mdx index 2c2b41b9..309159c2 100644 --- a/docs/examples/add-symbols.mdx +++ b/docs/examples/add-symbols.mdx @@ -13,7 +13,6 @@ Use the datasets plugin to overlay GeoJSON data on your map. Each dataset can co language: 'js', code: ` import InteractiveMap from '@defra/interactive-map' - import maplibreProvider from '@defra/interactive-map/providers/maplibre' import createDatasetsPlugin from '@defra/interactive-map/plugins/datasets' import createMapKeyPlugin from '@defra/interactive-map/plugins/map-key' @@ -81,7 +80,6 @@ Use the datasets plugin to overlay GeoJSON data on your map. Each dataset can co new InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', @@ -100,7 +98,6 @@ Use the datasets plugin to overlay GeoJSON data on your map. Each dataset can co language: 'html', code: ` - @@ -170,7 +167,6 @@ Use the datasets plugin to overlay GeoJSON data on your map. Each dataset can co new defra.InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: defra.maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', diff --git a/docs/examples/basic-map.mdx b/docs/examples/basic-map.mdx index 7a7372e5..49cfef06 100644 --- a/docs/examples/basic-map.mdx +++ b/docs/examples/basic-map.mdx @@ -13,11 +13,9 @@ Embed an interactive map directly on the page, allowing users to explore and int language: 'js', code: ` import InteractiveMap from '@defra/interactive-map' - import maplibreProvider from '@defra/interactive-map/providers/maplibre' new InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', @@ -35,13 +33,11 @@ Embed an interactive map directly on the page, allowing users to explore and int language: 'html', code: ` - - - @@ -174,7 +171,6 @@ This example configures snapping (`snapLayers`) against the base map style's woo const interactiveMap = new defra.InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: defra.maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', diff --git a/docs/examples/place-marker.mdx b/docs/examples/place-marker.mdx index 30f73ac3..75a62e75 100644 --- a/docs/examples/place-marker.mdx +++ b/docs/examples/place-marker.mdx @@ -3,12 +3,9 @@ import CodeTabs from '../../demo/js/codeTabs.js' # Place a marker to continue -Use the interact plugin's `placeMarker` mode to let users drop a location pin on the map before continuing a journey. +Use the interact plugin's `placeMarker` mode to let users drop a location pin on the map before continuing a journey. Two patterns work together in this example, depending on the screen size. -Two patterns work together in this example: - -- **Hybrid behaviour with built-in back and continue** — on mobile the map opens fullscreen and the `backAndContinue` option renders Back and Continue buttons inside the map. The Continue button is enabled declaratively via `continueEnabledWhen` once a marker has been placed. -- **External Continue button for inline** — when the map is inline (tablet/desktop), a Continue button sits outside the map container. It uses `app:opened`, `app:closed`, and `app:fullscreenchange` to show and hide in sync with the map's display mode, and `interact:markerchange` to enable once a marker is placed. +On mobile, the map opens fullscreen and the `backAndContinue` option adds Back and Continue buttons inside the map, with Continue enabled by `continueEnabledWhen` once a marker is placed. On tablet and desktop, the map is inline and a Continue button sits outside it. That button uses `app:opened`, `app:closed` and `app:fullscreenchange` to show and hide with the map, and `interact:markerchange` to enable once a marker is placed. @@ -18,7 +15,6 @@ Two patterns work together in this example: language: 'js', code: ` import InteractiveMap from '@defra/interactive-map' - import maplibreProvider from '@defra/interactive-map/providers/maplibre' import createInteractPlugin from '@defra/interactive-map/plugins/interact' const interactPlugin = createInteractPlugin({ @@ -27,7 +23,6 @@ Two patterns work together in this example: const map = new InteractiveMap('my-map', { behaviour: 'hybrid', - mapProvider: maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', @@ -87,7 +82,6 @@ Two patterns work together in this example: language: 'html', code: ` -
@@ -103,7 +97,6 @@ Two patterns work together in this example: const map = new defra.InteractiveMap('my-map', { behaviour: 'hybrid', - mapProvider: defra.maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', diff --git a/docs/examples/search-control.mdx b/docs/examples/search-control.mdx index c8a56504..2998ba8f 100644 --- a/docs/examples/search-control.mdx +++ b/docs/examples/search-control.mdx @@ -17,7 +17,6 @@ This requires an OS Data Hub API key. Embedding the key in the URL is the simple language: 'js', code: ` import InteractiveMap from '@defra/interactive-map' - import maplibreProvider from '@defra/interactive-map/providers/maplibre' import createSearchPlugin from '@defra/interactive-map/plugins/search' const searchPlugin = createSearchPlugin({ @@ -27,7 +26,6 @@ This requires an OS Data Hub API key. Embedding the key in the URL is the simple new InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', @@ -46,7 +44,6 @@ This requires an OS Data Hub API key. Embedding the key in the URL is the simple language: 'html', code: ` - - @@ -212,7 +209,6 @@ The layer ID used here (`field-parcels`) comes from the datasets plugin — a da const map = new defra.InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: defra.maplibreProvider(), mapStyle: { url: 'https://your-tile-url/style.json', logo: '/path/to/logo.svg', diff --git a/docs/examples/style-switcher.mdx b/docs/examples/style-switcher.mdx index d802ad81..7c191aeb 100644 --- a/docs/examples/style-switcher.mdx +++ b/docs/examples/style-switcher.mdx @@ -17,7 +17,6 @@ The live demo uses OS Open Zoomstack tiles from OS Labs, which do not require an language: 'js', code: ` import InteractiveMap from '@defra/interactive-map' - import maplibreProvider from '@defra/interactive-map/providers/maplibre' import createMapStylesPlugin from '@defra/interactive-map/plugins/map-styles' const mapStyles = [ @@ -58,7 +57,6 @@ The live demo uses OS Open Zoomstack tiles from OS Labs, which do not require an new InteractiveMap('my-map', { behaviour: 'inline', - mapProvider: maplibreProvider(), mapStyle: mapStyles[0], center: [-0.1276, 51.5074], zoom: 12, @@ -72,7 +70,6 @@ The live demo uses OS Open Zoomstack tiles from OS Labs, which do not require an language: 'html', code: ` - - + + + +``` -### Webpack +The Esri package can only be used with a bundler. -```js -import webpack from 'webpack' +## Content Security Policy -export default { - // ... - plugins: [ - new webpack.IgnorePlugin({ resourceRegExp: /^(ol|proj4|@arcgis\/core)(\/|$)/ }) - ] -} -``` +`@defra/interactive-map` and `@defra/interactive-map-openlayers` work under a strict Content Security Policy (CSP). The Esri package doesn't. -### Vite +Serve the map's files from your own site. For scripts, use either: -This applies to production builds; the dev server only warns. +- `script-src 'self'` +- a nonce on each of the map's ` - - + + - - -
- + ] + }) + + ``` - -> [!NOTE] -> Load the scripts with `defer` and create the map inside a `DOMContentLoaded` listener, as above, so the page isn't blocked while they download. Don't use `async`, as the scripts must run in order. -> -> Scripts are loaded dynamically — all files in each `umd/` folder must be served from the same directory as their `index.js`. - -## Using plugins - -**ESM** — add the plugin import alongside your existing core imports, then pass it to `plugins`: - -```js -import createInteractPlugin from '@defra/interactive-map/plugins/interact' - -const interactiveMap = new InteractiveMap('map', { - // ...your existing options - plugins: [createInteractPlugin()] -}) -``` - -**UMD** — copy the plugin's `dist/umd/` folder to your assets if you haven't already, then add its script to your page skeleton: - -```html - -``` - -Then pass the plugin in your initialisation: - -```js -const interactiveMap = new defra.InteractiveMap('map', { - // ...your existing options - plugins: [defra.interactPlugin()] -}) -``` - -The datasets, draw, frame, map-key, map-styles, menu, scale-bar and search plugins also have their own CSS. With ESM, import it alongside the plugin, for example `import '@defra/interactive-map/plugins/datasets/css'`. With UMD, copy the plugin's `dist/css/index.css` to your assets and add it to your page with a ``. diff --git a/docs/plugins/datasets.md b/docs/plugins/datasets.md index 40b8f292..b3ac8d3b 100644 --- a/docs/plugins/datasets.md +++ b/docs/plugins/datasets.md @@ -2,11 +2,8 @@ The datasets plugin renders GeoJSON and vector tile datasets on the map, with support for polygon, line, and symbol (point) layer types, sublayer style rules, layer visibility toggling, and runtime style and data updates. -> [!IMPORTANT] -> **Upgrading?** This plugin no longer renders key of symbols itself — that button and panel have been removed. Add the [Map Key](./map-key.md) plugin to restore it. Your `showInKey` config is unaffected and needs no changes. - -> [!IMPORTANT] -> **Using a bundler (ESM)?** This plugin includes adapters for more than one map provider, so your bundler needs to ignore the map engines you haven't installed. See [Bundler configuration](../getting-started.md#bundler-configuration-esm). +> [!NOTE] +> To show a key of the datasets' symbols, also add the [Map Key](./map-key.md) plugin. Datasets and sublayers with `showInKey: true` appear in the key. ## ESM usage @@ -66,7 +63,6 @@ const datasetsPlugin = defra.datasetsPlugin({ }) const interactiveMap = new defra.InteractiveMap('map', { - mapProvider: defra.maplibreProvider(), plugins: [datasetsPlugin] }) ``` diff --git a/docs/plugins/draw.md b/docs/plugins/draw.md index 08d5977f..2b7eda68 100644 --- a/docs/plugins/draw.md +++ b/docs/plugins/draw.md @@ -1,9 +1,11 @@ # Draw Plugin -The draw plugin lets users draw and edit point, polygon and line features on the map — placing vertices by click, tap, or keyboard, snapping to existing map layers, and validating geometry as it's built. Polygons can also be split and merged. It works identically with both the MapLibre and OpenLayers map providers, determining the correct adapter to use from the `mapProvider` passed to `InteractiveMap` — there's nothing to configure in the plugin itself. +The draw plugin lets users draw and edit point, polygon and line features on the map — placing vertices by click, tap, or keyboard, snapping to existing map layers, and validating geometry as it's built. Polygons can also be split and merged. -> [!IMPORTANT] -> **Using a bundler (ESM)?** This plugin includes adapters for more than one map provider, so your bundler needs to ignore the map engines you haven't installed. See [Bundler configuration](../getting-started.md#bundler-configuration-esm). +It works the same with `@defra/interactive-map` (MapLibre) and `@defra/interactive-map-openlayers`. + +> [!NOTE] +> `@defra/interactive-map-esri` has a separate draw plugin, imported the same way, with limited features. It only draws and edits polygons, and doesn't support the options, validation or most of the methods below. ## ESM usage @@ -26,7 +28,7 @@ interactiveMap.on('map:ready', () => { ## UMD usage -Copy the entire `plugins/draw/dist/umd/` directory to `/your-assets-path/plugins/draw/umd/`. The plugin uses dynamic imports to load MapLibre or OpenLayers support on demand, so all files in the directory must be served from the same location. Then add the script tag: +Copy the entire `plugins/draw/dist/umd/` directory to `/your-assets-path/plugins/draw/umd/`. The plugin loads the rest of its files when it's used, so all files in the directory must be served from the same location. Then add the script tag: ```html @@ -36,7 +38,6 @@ Copy the entire `plugins/draw/dist/umd/` directory to `/your-assets-path/plugins const drawPlugin = defra.drawPlugin() const interactiveMap = new defra.InteractiveMap('map', { - mapProvider: defra.maplibreProvider(), plugins: [drawPlugin] }) ``` diff --git a/docs/plugins/map-key.md b/docs/plugins/map-key.md index a0c4a5ce..04a5d20b 100644 --- a/docs/plugins/map-key.md +++ b/docs/plugins/map-key.md @@ -69,7 +69,6 @@ const datasetsPlugin = defra.datasetsPlugin({ const mapKeyPlugin = defra.mapKeyPlugin() const interactiveMap = new defra.InteractiveMap('map', { - mapProvider: defra.maplibreProvider(), plugins: [datasetsPlugin, mapKeyPlugin] }) ``` diff --git a/docs/upgrading-to-v1.md b/docs/upgrading-to-v1.md new file mode 100644 index 00000000..9010d95f --- /dev/null +++ b/docs/upgrading-to-v1.md @@ -0,0 +1,102 @@ +# Upgrading to v1 + +In v1, each map engine has its own package, and the package sets up the map engine for you. You no longer pass a map provider or tell your bundler to ignore the engines you don't use. + +## 1. Change package if you use OpenLayers or Esri + +`@defra/interactive-map` now uses MapLibre only. If you use another engine, install its package instead: + +| You used | Install | +|---|---| +| `maplibreProvider` | `@defra/interactive-map` | +| `openLayersProvider` | `@defra/interactive-map-openlayers` | +| `esriProvider` | `@defra/interactive-map-esri` | + +Each package installs its own map engine, so you no longer need to install `ol`, `proj4` or `@arcgis/core` yourself. The Esri package can only be used with a bundler. + +## 2. With a bundler + +### Change your imports + +All three packages have the same imports, so only the package name changes. For example: + +```js +// Before +import createDatasetsPlugin from '@defra/interactive-map/plugins/datasets' + +// After, with OpenLayers +import createDatasetsPlugin from '@defra/interactive-map-openlayers/plugins/datasets' +``` + +With Esri, the draw plugin has moved from `plugins/draw-es` to `plugins/draw`. The provider's CSS is now part of `@defra/interactive-map-esri/css`, so remove the `providers/esri/css` import. + +### Remove the map provider + +Remove the provider import and the `mapProvider` option. If you passed settings to the provider, pass them in [`mapProviderOptions`](./api.md#mapprovideroptions) instead: + +```js +// Before +import InteractiveMap from '@defra/interactive-map' +import maplibreProvider from '@defra/interactive-map/providers/maplibre' + +const interactiveMap = new InteractiveMap('map', { + mapProvider: maplibreProvider({ workerUrl: '/your-assets-path/maplibre-gl-worker.mjs' }) +}) + +// After +import InteractiveMap from '@defra/interactive-map' + +const interactiveMap = new InteractiveMap('map', { + mapProviderOptions: { workerUrl: '/your-assets-path/maplibre-gl-worker.mjs' } +}) +``` + +### Remove the engine ignore rules from your bundler config + +Remove the config that told your bundler to ignore the map engines you don't use, such as webpack's `IgnorePlugin` or the `external` option in Vite, Rollup or esbuild. Each package only includes its own engine, so it's no longer needed. + +The MapLibre worker setup for Rollup and esbuild hasn't changed. See [Rollup and esbuild](./getting-started.md#rollup-and-esbuild). + +## 3. Without a bundler + +### Copy the new scripts and CSS + +Replace the map's and plugins' scripts and CSS in your assets with the ones from your v1 package. With OpenLayers, copy them from `@defra/interactive-map-openlayers`. Keep each folder's files together, as the map loads the rest of its scripts when it opens. + +### Remove the map provider + +Remove the provider's ` + + + + + + +``` + +If you passed settings to the provider, such as `zoomAlignment` with OpenLayers, pass them in [`mapProviderOptions`](./api.md#mapprovideroptions) instead: + +```js +// Before +mapProvider: defra.openLayersProvider({ zoomAlignment: 'world' }) + +// After +mapProviderOptions: { zoomAlignment: 'world' } +``` diff --git a/docusaurus.config.cjs b/docusaurus.config.cjs index 51c32304..a7076585 100644 --- a/docusaurus.config.cjs +++ b/docusaurus.config.cjs @@ -134,9 +134,11 @@ const config = { sidebar: [ { text: 'Installation', href: '/getting-started#installation' }, { text: 'GOV.UK Prototype kit', href: '/getting-started#govuk-prototype-kit' }, - { text: 'Manual setup', href: '/getting-started#manual-setup' }, - { text: 'Basic usage', href: '/getting-started#basic-usage' }, - { text: 'Using plugins', href: '/getting-started#using-plugins' } + { text: 'With a bundler', href: '/getting-started#setting-up-a-map-with-a-bundler' }, + { text: 'Without a bundler', href: '/getting-started#setting-up-a-map-without-a-bundler' }, + { text: 'Content Security Policy', href: '/getting-started#content-security-policy' }, + { text: 'Using plugins', href: '/getting-started#using-plugins' }, + { text: 'Upgrading to v1', href: '/upgrading-to-v1' } ], }, { From 116cafcbcf908dc21f4899f037c45c0c33b62bf0 Mon Sep 17 00:00:00 2001 From: Dan Leech Date: Tue, 17 Nov 2026 14:48:52 +0000 Subject: [PATCH 2/2] Add the prototype kit templates to the MapLibre package, and remove unused settings from the root package --- .gitignore | 3 + assets/templates/add-polygons.njk | 2 - assets/templates/add-symbols.njk | 2 - assets/templates/basic-map.njk | 2 - assets/templates/button-map.njk | 2 - assets/templates/draw-tools.njk | 2 - assets/templates/marker-panel.njk | 2 - assets/templates/place-marker.njk | 2 - assets/templates/search-control.njk | 2 - assets/templates/select-feature.njk | 2 - assets/templates/style-switcher.njk | 2 - assets/templates/toggle-marker-label.njk | 2 - docs/getting-started.md | 2 +- engines.mjs | 10 ++- govuk-prototype-kit.config.json | 77 ---------------- package-lock.json | 43 --------- package.json | 89 ------------------- .../maplibre/govuk-prototype-kit.config.json | 58 ++++++++++++ packages/maplibre/package.json | 1 + rollup.engine.mjs | 15 ++++ 20 files changed, 85 insertions(+), 235 deletions(-) delete mode 100644 govuk-prototype-kit.config.json diff --git a/.gitignore b/.gitignore index d7c6ab32..bc9bf190 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,6 @@ stats.json .docusaurus build .playwright-mcp + +# Copied into the engine packages when they are built +packages/*/assets diff --git a/assets/templates/add-polygons.njk b/assets/templates/add-polygons.njk index deb39600..896355b1 100644 --- a/assets/templates/add-polygons.njk +++ b/assets/templates/add-polygons.njk @@ -39,7 +39,6 @@ {% block pageScripts %} - @@ -132,7 +131,6 @@ new defra.InteractiveMap('map', { behaviour: 'inline', - mapProvider: defra.maplibreProvider(), mapStyle: { url: 'https://tiles.openfreemap.org/styles/liberty', attribution: 'OpenFreeMap © OpenMapTiles Data from OpenStreetMap', diff --git a/assets/templates/add-symbols.njk b/assets/templates/add-symbols.njk index a6570f70..5cb82a5c 100644 --- a/assets/templates/add-symbols.njk +++ b/assets/templates/add-symbols.njk @@ -39,7 +39,6 @@ {% block pageScripts %} - @@ -108,7 +107,6 @@ new defra.InteractiveMap('map', { behaviour: 'inline', - mapProvider: defra.maplibreProvider(), mapStyle: { url: 'https://tiles.openfreemap.org/styles/liberty', attribution: 'OpenFreeMap © OpenMapTiles Data from OpenStreetMap', diff --git a/assets/templates/basic-map.njk b/assets/templates/basic-map.njk index db9c1c6e..7372eaf0 100644 --- a/assets/templates/basic-map.njk +++ b/assets/templates/basic-map.njk @@ -37,12 +37,10 @@ {% block pageScripts %} - - - @@ -54,7 +53,6 @@ const interactiveMap = new defra.InteractiveMap('map', { behaviour: 'hybrid', - mapProvider: defra.maplibreProvider(), mapStyle: { id: 'default', url: 'https://tiles.openfreemap.org/styles/liberty', diff --git a/assets/templates/marker-panel.njk b/assets/templates/marker-panel.njk index 60f3000d..13d6e57e 100644 --- a/assets/templates/marker-panel.njk +++ b/assets/templates/marker-panel.njk @@ -37,7 +37,6 @@ {% block pageScripts %} - - - - @@ -113,7 +112,6 @@ const map = new defra.InteractiveMap('map', { behaviour: 'inline', - mapProvider: defra.maplibreProvider(), mapStyle: { url: 'https://tiles.openfreemap.org/styles/liberty', attribution: 'OpenFreeMap © OpenMapTiles Data from OpenStreetMap', diff --git a/assets/templates/style-switcher.njk b/assets/templates/style-switcher.njk index d48cac90..e6baf1be 100644 --- a/assets/templates/style-switcher.njk +++ b/assets/templates/style-switcher.njk @@ -38,7 +38,6 @@ {% block pageScripts %} - -