From 7a239bdc73e38ea5a24f75ca8c1702348c330d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20K=C3=B6nig?= Date: Thu, 23 May 2024 14:09:09 +0200 Subject: [PATCH] StaticDatasets: rename pmtilesUrl() to createPmtilesUrl() --- .../Map/SourcesAndLayers/SourcesLayersRegionMask.tsx | 4 ++-- .../Map/SourcesAndLayers/SourcesLayersStaticDatasets.tsx | 4 ++-- .../Map/SourcesAndLayers/utils/createPmtilesUrl.ts | 3 +++ .../_components/Map/SourcesAndLayers/utils/pmtilesUrl.ts | 3 --- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/utils/createPmtilesUrl.ts delete mode 100644 src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/utils/pmtilesUrl.ts diff --git a/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/SourcesLayersRegionMask.tsx b/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/SourcesLayersRegionMask.tsx index 274f541b8..542431823 100644 --- a/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/SourcesLayersRegionMask.tsx +++ b/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/SourcesLayersRegionMask.tsx @@ -1,7 +1,7 @@ import React from 'react' import { Layer, Source } from 'react-map-gl/maplibre' import { useRegionSlug } from 'src/app/regionen/[regionSlug]/_components/regionUtils/useRegionSlug' -import { pmtilesUrl } from './utils/pmtilesUrl' +import { createPmtilesUrl } from './utils/createPmtilesUrl' export const SourcesLayersRegionMask: React.FC = () => { const regionSlug = useRegionSlug() @@ -14,7 +14,7 @@ export const SourcesLayersRegionMask: React.FC = () => { if (!regionSlug) return null return ( - + { const { dataParam: selectedDatasetIds } = useDataParam() @@ -31,7 +31,7 @@ export const SourcesLayersStaticDatasets: React.FC = () => { id={datasetSourceId} key={datasetSourceId} type={type} - url={pmtilesUrl(url)} + url={createPmtilesUrl(url)} attribution={attributionHtml} > {layers.map((layer) => { diff --git a/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/utils/createPmtilesUrl.ts b/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/utils/createPmtilesUrl.ts new file mode 100644 index 000000000..d1dc35dc6 --- /dev/null +++ b/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/utils/createPmtilesUrl.ts @@ -0,0 +1,3 @@ +export const createPmtilesUrl = (url: string) => { + return `pmtiles://${url}` +} diff --git a/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/utils/pmtilesUrl.ts b/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/utils/pmtilesUrl.ts deleted file mode 100644 index b66a01a92..000000000 --- a/src/app/regionen/[regionSlug]/_components/Map/SourcesAndLayers/utils/pmtilesUrl.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const pmtilesUrl = (url: string) => { - return `pmtiles://${url}` -}