diff --git a/packages/leaflet-map/src/base-map.tsx b/packages/leaflet-map/src/base-map.tsx index 267e8e193..39038f716 100644 --- a/packages/leaflet-map/src/base-map.tsx +++ b/packages/leaflet-map/src/base-map.tsx @@ -132,6 +132,9 @@ const BaseMap = ({ center.lat && center.lng ? { lat: center.lat, lng: center.lng } : { lat: 52.37104644463586, lng: 4.900402911007405 }; + + tilesVariant = props?.map?.tilesVariant || tilesVariant ||'nlmaps'; + const customUrlSetting = tilesVariant === 'custom' ? props?.map?.customUrl : undefined; // clustering geeft errors; ik begrijp niet waarom: het gebeurd alleen in de gebuilde widgets, niet in de dev componenten @@ -375,6 +378,7 @@ const BaseMap = ({ // ToDo: waarom kan ik die niet gewoon als props meesturen const tileLayerProps = { tilesVariant, + customUrlSetting, tiles, minZoom, maxZoom, diff --git a/packages/leaflet-map/src/tile-layer.tsx b/packages/leaflet-map/src/tile-layer.tsx index fa334844d..78d96167e 100644 --- a/packages/leaflet-map/src/tile-layer.tsx +++ b/packages/leaflet-map/src/tile-layer.tsx @@ -6,6 +6,7 @@ export default function TileLayer({ tiles = null, minZoom = 0, maxZoom = 25, + customUrl = '', ...props }: MapTilesProps) { @@ -52,7 +53,7 @@ export default function TileLayer({ maxZoom={ typeof maxZoom != 'undefined' ? maxZoom : 19 } minZoom={ typeof minZoom != 'undefined' ? minZoom : 0 } subdomains={tiles && tiles.subdomains || ''} - url={tiles && tiles.url || 'https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:3857/{z}/{x}/{y}.png'} + url={customUrl || 'https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:3857/{z}/{x}/{y}.png'} />) default: diff --git a/packages/leaflet-map/src/types/map-tiles-props.ts b/packages/leaflet-map/src/types/map-tiles-props.ts index 5aa68baea..f5b0885db 100644 --- a/packages/leaflet-map/src/types/map-tiles-props.ts +++ b/packages/leaflet-map/src/types/map-tiles-props.ts @@ -6,6 +6,7 @@ type MapTiles = { export type MapTilesProps = { tilesVariant?: string, + customUrl?: string, tiles?: MapTiles | null, minZoom?: number, maxZoom?: number, diff --git a/packages/types/project-setting-props.ts b/packages/types/project-setting-props.ts index 39be3605e..76d464afe 100644 --- a/packages/types/project-setting-props.ts +++ b/packages/types/project-setting-props.ts @@ -71,5 +71,7 @@ export type ProjectSettingProps = { minZoom: string; maxZoom: string; areaId: string; + tilesVariant?: string; + customUrl?: string; }; };