@@ -108,7 +108,7 @@ export function initMaps(config = {}) {
108108 } = config
109109 const locations = document . querySelectorAll ( '.app-location-field' )
110110
111- // TODO: Fix this in `defra -map`
111+ // TODO: Fix this in `interactive -map`
112112 // If there are location components on the page fix up the main form submit
113113 // handler so it doesn't fire when using the integrated map search feature
114114 if ( locations . length ) {
@@ -268,7 +268,7 @@ function createMap(mapId, initConfig, mapsConfig) {
268268 const defra = window . defra
269269
270270 /** @type {DefraMap } */
271- const map = new defra . DefraMap ( mapId , {
271+ const map = new defra . InteractiveMap ( mapId , {
272272 ...initConfig ,
273273 mapProvider : defra . maplibreProvider ( ) ,
274274 reverseGeocodeProvider : defra . openNamesProvider ( {
@@ -278,6 +278,7 @@ function createMap(mapId, initConfig, mapsConfig) {
278278 minZoom : 6 ,
279279 maxZoom : 18 ,
280280 containerHeight : '400px' ,
281+ enableZoomControls : true ,
281282 transformRequest : makeTileRequestTransformer ( apiPath ) ,
282283 plugins : [
283284 defra . mapStylesPlugin ( {
@@ -286,8 +287,8 @@ function createMap(mapId, initConfig, mapsConfig) {
286287 id : 'outdoor' ,
287288 label : 'Outdoor' ,
288289 url : data . VTS_OUTDOOR_URL ,
289- thumbnail : `${ assetPath } /defra -map/assets/images/outdoor-map-thumb.jpg` ,
290- logo : `${ assetPath } /defra -map/assets/images/os-logo.svg` ,
290+ thumbnail : `${ assetPath } /interactive -map/assets/images/outdoor-map-thumb.jpg` ,
291+ logo : `${ assetPath } /interactive -map/assets/images/os-logo.svg` ,
291292 logoAltText,
292293 attribution : `Contains OS data ${ String . fromCodePoint ( COMPANY_SYMBOL_CODE ) } Crown copyright and database rights ${ new Date ( ) . getFullYear ( ) } ` ,
293294 backgroundColor : '#f5f5f0'
@@ -298,17 +299,17 @@ function createMap(mapId, initConfig, mapsConfig) {
298299 url : data . VTS_DARK_URL ,
299300 mapColorScheme : 'dark' ,
300301 appColorScheme : 'dark' ,
301- thumbnail : `${ assetPath } /defra -map/assets/images/dark-map-thumb.jpg` ,
302- logo : `${ assetPath } /defra -map/assets/images/os-logo-white.svg` ,
302+ thumbnail : `${ assetPath } /interactive -map/assets/images/dark-map-thumb.jpg` ,
303+ logo : `${ assetPath } /interactive -map/assets/images/os-logo-white.svg` ,
303304 logoAltText,
304305 attribution : `Contains OS data ${ String . fromCodePoint ( COMPANY_SYMBOL_CODE ) } Crown copyright and database rights ${ new Date ( ) . getFullYear ( ) } `
305306 } ,
306307 {
307308 id : 'black-and-white' ,
308309 label : 'Black/White' ,
309310 url : data . VTS_BLACK_AND_WHITE_URL ,
310- thumbnail : `${ assetPath } /defra -map/assets/images/black-and-white-map-thumb.jpg` ,
311- logo : `${ assetPath } /defra -map/assets/images/os-logo-black.svg` ,
311+ thumbnail : `${ assetPath } /interactive -map/assets/images/black-and-white-map-thumb.jpg` ,
312+ logo : `${ assetPath } /interactive -map/assets/images/os-logo-black.svg` ,
312313 logoAltText,
313314 attribution : `Contains OS data ${ String . fromCodePoint ( COMPANY_SYMBOL_CODE ) } Crown copyright and database rights ${ new Date ( ) . getFullYear ( ) } `
314315 }
@@ -325,7 +326,6 @@ function createMap(mapId, initConfig, mapsConfig) {
325326 width : '300px' ,
326327 showMarker : false
327328 } ) ,
328- defra . zoomControlsPlugin ( ) ,
329329 defra . scaleBarPlugin ( {
330330 units : 'metric'
331331 } )
0 commit comments