@swr-data-lab/components 1.12.5 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Autocomplete/Autocomplete.stories.svelte.d.ts +27 -0
- package/dist/Autocomplete/Autocomplete.svelte +237 -0
- package/dist/Autocomplete/Autocomplete.svelte.d.ts +34 -0
- package/dist/Autocomplete/index.d.ts +2 -0
- package/dist/Button/Button.stories.svelte +19 -0
- package/dist/Button/Button.stories.svelte.d.ts +19 -0
- package/dist/Button/Button.svelte +38 -0
- package/dist/Button/Button.svelte.d.ts +10 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Caption/Caption.stories.svelte.d.ts +27 -0
- package/dist/Caption/Caption.svelte +21 -0
- package/dist/Caption/Caption.svelte.d.ts +8 -0
- package/dist/Caption/index.js +2 -0
- package/dist/Card/Card.stories.svelte +17 -0
- package/dist/Card/Card.stories.svelte.d.ts +19 -0
- package/dist/Card/Card.svelte +25 -0
- package/dist/Card/Card.svelte.d.ts +7 -0
- package/dist/Card/index.d.ts +2 -0
- package/dist/ChartFooter/ChartFooter.stories.svelte.d.ts +27 -0
- package/dist/ChartFooter/ChartFooter.svelte +38 -0
- package/dist/ChartFooter/ChartFooter.svelte.d.ts +8 -0
- package/dist/ChartFooter/index.d.ts +2 -0
- package/dist/ChartHeader/ChartHeader.stories.svelte.d.ts +27 -0
- package/{src → dist}/ChartHeader/ChartHeader.svelte +4 -12
- package/dist/ChartHeader/ChartHeader.svelte.d.ts +9 -0
- package/dist/ChartHeader/index.d.ts +2 -0
- package/dist/ChartList/ChartList.mdx +13 -0
- package/dist/ChartList/ChartList.stories.svelte +48 -0
- package/dist/ChartList/ChartList.stories.svelte.d.ts +27 -0
- package/dist/ChartList/ChartList.svelte +103 -0
- package/dist/ChartList/ChartList.svelte.d.ts +14 -0
- package/dist/ChartList/index.d.ts +2 -0
- package/dist/ChartList/index.js +2 -0
- package/dist/Copy/Copy.stories.svelte.d.ts +27 -0
- package/dist/Copy/Copy.svelte +21 -0
- package/dist/Copy/Copy.svelte.d.ts +8 -0
- package/dist/Copy/index.js +2 -0
- package/dist/DesignTokens/DesignTokens.svelte +58 -0
- package/dist/DesignTokens/DesignTokens.svelte.d.ts +7 -0
- package/dist/DesignTokens/Tokens.d.ts +26 -0
- package/dist/DesignTokens/Tokens.js +171 -0
- package/dist/DesignTokens/index.d.ts +8 -0
- package/dist/FormLabel/FormLabel.stories.svelte.d.ts +27 -0
- package/{src → dist}/FormLabel/FormLabel.svelte +2 -9
- package/dist/FormLabel/FormLabel.svelte.d.ts +9 -0
- package/dist/FormLabel/index.js +2 -0
- package/dist/Headline/Headline.stories.svelte.d.ts +27 -0
- package/{src → dist}/Headline/Headline.svelte +2 -7
- package/dist/Headline/Headline.svelte.d.ts +7 -0
- package/dist/Headline/index.js +2 -0
- package/{src → dist}/HighlightCard/HighlightCard.stories.svelte +7 -9
- package/dist/HighlightCard/HighlightCard.stories.svelte.d.ts +19 -0
- package/dist/HighlightCard/HighlightCard.svelte +54 -0
- package/dist/HighlightCard/HighlightCard.svelte.d.ts +9 -0
- package/dist/HighlightCard/index.d.ts +2 -0
- package/dist/Input/Input.svelte +32 -0
- package/dist/Input/Input.svelte.d.ts +23 -0
- package/dist/Input/index.d.ts +2 -0
- package/dist/Intro.mdx +7 -0
- package/dist/Logotype/Logotype.stories.svelte +14 -0
- package/dist/Logotype/Logotype.stories.svelte.d.ts +19 -0
- package/dist/Logotype/Logotype.svelte.d.ts +26 -0
- package/dist/Middot/Middot.stories.svelte +14 -0
- package/dist/Middot/Middot.stories.svelte.d.ts +19 -0
- package/dist/Middot/Middot.svelte.d.ts +26 -0
- package/dist/Middot/index.d.ts +2 -0
- package/dist/Note/Note.stories.svelte.d.ts +27 -0
- package/dist/Note/Note.svelte +28 -0
- package/dist/Note/Note.svelte.d.ts +7 -0
- package/dist/Note/index.js +2 -0
- package/{src → dist}/Select/Select.stories.svelte +12 -15
- package/dist/Select/Select.stories.svelte.d.ts +19 -0
- package/dist/Select/Select.svelte +39 -0
- package/dist/Select/Select.svelte.d.ts +4 -0
- package/{src/Select/Select.types.ts → dist/Select/Select.types.d.ts} +1 -2
- package/dist/Select/Select.types.js +1 -0
- package/dist/Select/SelectStoriesTemplate.svelte.d.ts +15 -0
- package/dist/Select/index.d.ts +2 -0
- package/dist/Switcher/Switcher.stories.svelte.d.ts +27 -0
- package/dist/Switcher/Switcher.svelte +111 -0
- package/dist/Switcher/Switcher.svelte.d.ts +21 -0
- package/dist/Switcher/index.d.ts +2 -0
- package/{src → dist}/app.d.ts +1 -1
- package/dist/assets/close-circle.svg.svelte.d.ts +26 -0
- package/dist/assets/grow.svg.svelte.d.ts +26 -0
- package/dist/assets/hand-pointer.svg.svelte.d.ts +26 -0
- package/dist/assets/shrink.svg.svelte.d.ts +26 -0
- package/dist/assets/tap.svg.svelte.d.ts +26 -0
- package/dist/assets/times-circle-solid.svg.svelte.d.ts +26 -0
- package/dist/index.d.ts +29 -0
- package/{src → dist}/index.js +3 -0
- package/dist/maplibre/AttributionControl/AttributionControl.stories.svelte +27 -0
- package/dist/maplibre/AttributionControl/AttributionControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/AttributionControl/AttributionControl.svelte +15 -0
- package/dist/maplibre/AttributionControl/AttributionControl.svelte.d.ts +8 -0
- package/dist/maplibre/AttributionControl/index.d.ts +2 -0
- package/dist/maplibre/GeocoderControl/GeocoderAPIs.d.ts +6 -0
- package/dist/maplibre/GeocoderControl/GeocoderAPIs.js +40 -0
- package/{src → dist}/maplibre/GeocoderControl/GeocoderControl.stories.svelte +10 -14
- package/dist/maplibre/GeocoderControl/GeocoderControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/GeocoderControl/GeocoderControl.svelte +25 -0
- package/dist/maplibre/GeocoderControl/GeocoderControl.svelte.d.ts +27 -0
- package/dist/maplibre/GeocoderControl/index.d.ts +2 -0
- package/dist/maplibre/Map/FallbackStyle.d.ts +3 -0
- package/dist/maplibre/Map/FallbackStyle.js +15 -0
- package/{src → dist}/maplibre/Map/Map.stories.svelte +19 -24
- package/dist/maplibre/Map/Map.stories.svelte.d.ts +19 -0
- package/dist/maplibre/Map/Map.svelte +91 -0
- package/dist/maplibre/Map/Map.svelte.d.ts +23 -0
- package/dist/maplibre/Map/index.d.ts +2 -0
- package/dist/maplibre/MapControl/MapControl.stories.svelte +46 -0
- package/dist/maplibre/MapControl/MapControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/MapControl/MapControl.svelte +29 -0
- package/dist/maplibre/MapControl/MapControl.svelte.d.ts +11 -0
- package/dist/maplibre/MapControl/index.d.ts +2 -0
- package/dist/maplibre/MapStyle/SWRDataLabLight.d.ts +3 -0
- package/dist/maplibre/MapStyle/SWRDataLabLight.js +60 -0
- package/{src → dist}/maplibre/MapStyle/SWRDataLabLight.stories.svelte +10 -12
- package/dist/maplibre/MapStyle/SWRDataLabLight.stories.svelte.d.ts +18 -0
- package/dist/maplibre/MapStyle/components/Admin.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Admin.js +170 -0
- package/dist/maplibre/MapStyle/components/Buildings.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Buildings.js +21 -0
- package/dist/maplibre/MapStyle/components/Landuse.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Landuse.js +497 -0
- package/dist/maplibre/MapStyle/components/Natural.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Natural.js +1 -0
- package/dist/maplibre/MapStyle/components/PlaceLabels.d.ts +4 -0
- package/dist/maplibre/MapStyle/components/PlaceLabels.js +194 -0
- package/dist/maplibre/MapStyle/components/Roads.d.ts +8 -0
- package/dist/maplibre/MapStyle/components/Roads.js +2327 -0
- package/dist/maplibre/MapStyle/components/Transit.d.ts +7 -0
- package/dist/maplibre/MapStyle/components/Transit.js +499 -0
- package/dist/maplibre/MapStyle/components/Walking.d.ts +1 -0
- package/dist/maplibre/MapStyle/components/Walking.js +1530 -0
- package/dist/maplibre/MapStyle/index.d.ts +2 -0
- package/dist/maplibre/MapStyle/tokens.d.ts +20 -0
- package/dist/maplibre/MapStyle/tokens.js +20 -0
- package/{src → dist}/maplibre/NavigationControl/NavigationControl.stories.svelte +9 -11
- package/dist/maplibre/NavigationControl/NavigationControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/NavigationControl/NavigationControl.svelte +9 -0
- package/dist/maplibre/NavigationControl/NavigationControl.svelte.d.ts +12 -0
- package/dist/maplibre/NavigationControl/index.d.ts +2 -0
- package/{src → dist}/maplibre/ScaleControl/ScaleControl.stories.svelte +10 -13
- package/dist/maplibre/ScaleControl/ScaleControl.stories.svelte.d.ts +19 -0
- package/dist/maplibre/ScaleControl/ScaleControl.svelte +9 -0
- package/dist/maplibre/ScaleControl/ScaleControl.svelte.d.ts +9 -0
- package/dist/maplibre/ScaleControl/index.d.ts +2 -0
- package/dist/maplibre/Source/MapSource.stories.svelte +7 -0
- package/dist/maplibre/Source/MapSource.stories.svelte.d.ts +19 -0
- package/dist/maplibre/Source/MapSource.svelte +43 -0
- package/dist/maplibre/Source/MapSource.svelte.d.ts +13 -0
- package/dist/maplibre/Source/index.d.ts +2 -0
- package/dist/maplibre/Source/source.d.ts +28 -0
- package/dist/maplibre/Source/source.js +76 -0
- package/{src → dist}/maplibre/Tooltip/Tooltip.stories.svelte +17 -23
- package/dist/maplibre/Tooltip/Tooltip.stories.svelte.d.ts +19 -0
- package/dist/maplibre/Tooltip/Tooltip.svelte +46 -0
- package/dist/maplibre/Tooltip/Tooltip.svelte.d.ts +25 -0
- package/dist/maplibre/Tooltip/index.d.ts +2 -0
- package/{src → dist}/maplibre/VectorLayer/VectorLayer.stories.svelte +11 -14
- package/dist/maplibre/VectorLayer/VectorLayer.stories.svelte.d.ts +19 -0
- package/dist/maplibre/VectorLayer/VectorLayer.svelte +73 -0
- package/dist/maplibre/VectorLayer/VectorLayer.svelte.d.ts +21 -0
- package/dist/maplibre/VectorLayer/index.d.ts +2 -0
- package/{src → dist}/maplibre/VectorTileSource/VectorTileSource.stories.svelte +11 -13
- package/dist/maplibre/VectorTileSource/VectorTileSource.stories.svelte.d.ts +19 -0
- package/dist/maplibre/VectorTileSource/VectorTileSource.svelte +13 -0
- package/dist/maplibre/VectorTileSource/VectorTileSource.svelte.d.ts +11 -0
- package/dist/maplibre/VectorTileSource/index.d.ts +2 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +27 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte.d.ts +19 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte +44 -0
- package/dist/maplibre/WithLinkLocation/WithLinkLocation.svelte.d.ts +19 -0
- package/dist/maplibre/WithLinkLocation/index.d.ts +2 -0
- package/dist/maplibre/context.svelte.d.ts +33 -0
- package/dist/maplibre/context.svelte.js +73 -0
- package/{src/maplibre/types.ts → dist/maplibre/types.d.ts} +3 -5
- package/dist/maplibre/types.js +1 -0
- package/dist/maplibre/utils.d.ts +4 -0
- package/dist/maplibre/utils.js +34 -0
- package/dist/utils/formatDate.d.ts +5 -0
- package/dist/utils/formatDate.js +17 -0
- package/dist/utils/formatNumber.d.ts +18 -0
- package/{src → dist}/utils/formatNumber.js +5 -5
- package/dist/utils/getColorsBetween.d.ts +9 -0
- package/dist/utils/getColorsBetween.js +25 -0
- package/dist/utils/getComparisonDiffs.d.ts +6 -0
- package/dist/utils/getComparisonDiffs.js +9 -0
- package/dist/utils/getEmbedContext.d.ts +7 -0
- package/dist/utils/getEmbedContext.js +27 -0
- package/dist/utils/getLaenderFromTopo.d.ts +10 -0
- package/dist/utils/getLaenderFromTopo.js +35 -0
- package/dist/utils/getLaenderNicenameFromAgs.d.ts +7 -0
- package/dist/utils/getLaenderNicenameFromAgs.js +27 -0
- package/dist/utils/isSvelteComponent.d.ts +7 -0
- package/{src → dist}/utils/isSvelteComponent.js +1 -1
- package/dist/utils/prepareSophoraModel.d.ts +2 -0
- package/dist/utils/prepareSophoraModel.js +37 -0
- package/dist/utils/scrollIntoViewWithOffset.d.ts +7 -0
- package/{src → dist}/utils/scrollIntoViewWithOffset.js +3 -3
- package/dist/utils/slugify.d.ts +1 -0
- package/dist/utils/slugify.js +11 -0
- package/dist/utils/topoToGeo.d.ts +7 -0
- package/{src → dist}/utils/topoToGeo.js +2 -2
- package/package.json +30 -7
- package/.storybook/blocks/Mermaid.jsx +0 -9
- package/.storybook/main.ts +0 -34
- package/.storybook/preview-head.html +0 -13
- package/.storybook/preview.ts +0 -47
- package/.storybook/vitest.setup.ts +0 -9
- package/src/Autocomplete/Autocomplete.svelte +0 -237
- package/src/Button/Button.stories.svelte +0 -21
- package/src/Button/Button.svelte +0 -52
- package/src/Caption/Caption.svelte +0 -29
- package/src/Card/Card.stories.svelte +0 -19
- package/src/Card/Card.svelte +0 -34
- package/src/ChartFooter/ChartFooter.svelte +0 -46
- package/src/Copy/Copy.svelte +0 -29
- package/src/DesignTokens/DesignTokens.svelte +0 -71
- package/src/DesignTokens/Tokens.ts +0 -186
- package/src/HighlightCard/HighlightCard.svelte +0 -65
- package/src/Input/Input.svelte +0 -21
- package/src/Intro.mdx +0 -7
- package/src/Logotype/Logotype.stories.svelte +0 -16
- package/src/Middot/Middot.stories.svelte +0 -16
- package/src/Note/Note.svelte +0 -38
- package/src/Select/Select.svelte +0 -76
- package/src/Switcher/Switcher.svelte +0 -130
- package/src/maplibre/AttributionControl/AttributionControl.stories.svelte +0 -29
- package/src/maplibre/AttributionControl/AttributionControl.svelte +0 -45
- package/src/maplibre/GeocoderControl/GeocoderAPIs.ts +0 -49
- package/src/maplibre/GeocoderControl/GeocoderControl.svelte +0 -211
- package/src/maplibre/Map/FallbackStyle.ts +0 -18
- package/src/maplibre/Map/Map.svelte +0 -287
- package/src/maplibre/MapControl/MapControl.stories.svelte +0 -56
- package/src/maplibre/MapControl/MapControl.svelte +0 -41
- package/src/maplibre/MapStyle/SWRDataLabLight.ts +0 -72
- package/src/maplibre/MapStyle/components/Admin.ts +0 -173
- package/src/maplibre/MapStyle/components/Buildings.ts +0 -23
- package/src/maplibre/MapStyle/components/Landuse.ts +0 -499
- package/src/maplibre/MapStyle/components/Natural.ts +0 -1
- package/src/maplibre/MapStyle/components/PlaceLabels.ts +0 -199
- package/src/maplibre/MapStyle/components/Roads.ts +0 -2345
- package/src/maplibre/MapStyle/components/Transit.ts +0 -507
- package/src/maplibre/MapStyle/components/Walking.ts +0 -1538
- package/src/maplibre/MapStyle/tokens.ts +0 -21
- package/src/maplibre/NavigationControl/NavigationControl.svelte +0 -36
- package/src/maplibre/ScaleControl/ScaleControl.svelte +0 -25
- package/src/maplibre/Source/MapSource.stories.svelte +0 -9
- package/src/maplibre/Source/MapSource.svelte +0 -61
- package/src/maplibre/Source/source.ts +0 -89
- package/src/maplibre/Tooltip/Tooltip.svelte +0 -183
- package/src/maplibre/VectorLayer/VectorLayer.svelte +0 -142
- package/src/maplibre/VectorTileSource/VectorTileSource.svelte +0 -24
- package/src/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +0 -29
- package/src/maplibre/WithLinkLocation/WithLinkLocation.svelte +0 -83
- package/src/maplibre/context.svelte.ts +0 -89
- package/src/maplibre/utils.ts +0 -52
- package/src/utils/formatDate.js +0 -17
- package/src/utils/getColorsBetween.js +0 -25
- package/src/utils/getComparisonDiffs.js +0 -9
- package/src/utils/getEmbedContext.js +0 -28
- package/src/utils/getLaenderFromTopo.js +0 -35
- package/src/utils/getLaenderNicenameFromAgs.js +0 -27
- package/src/utils/prepareSophoraModel.js +0 -31
- package/src/utils/slugify.ts +0 -12
- package/static/favicon.png +0 -0
- package/svelte.config.js +0 -18
- package/tsconfig.json +0 -19
- package/vite.config.ts +0 -6
- package/vitest.workspace.ts +0 -32
- /package/{src → dist}/Autocomplete/Autocomplete.stories.svelte +0 -0
- /package/{src → dist}/Autocomplete/index.js +0 -0
- /package/{src → dist}/Button/index.js +0 -0
- /package/{src → dist}/Caption/Caption.stories.svelte +0 -0
- /package/{src/Caption/index.ts → dist/Caption/index.d.ts} +0 -0
- /package/{src → dist}/Card/index.js +0 -0
- /package/{src → dist}/ChartFooter/ChartFooter.mdx +0 -0
- /package/{src → dist}/ChartFooter/ChartFooter.stories.svelte +0 -0
- /package/{src → dist}/ChartFooter/index.js +0 -0
- /package/{src → dist}/ChartHeader/ChartHeader.mdx +0 -0
- /package/{src → dist}/ChartHeader/ChartHeader.stories.svelte +0 -0
- /package/{src → dist}/ChartHeader/index.js +0 -0
- /package/{src → dist}/Copy/Copy.stories.svelte +0 -0
- /package/{src/Copy/index.ts → dist/Copy/index.d.ts} +0 -0
- /package/{src → dist}/DesignTokens/DesignTokens.mdx +0 -0
- /package/{src → dist}/DesignTokens/index.js +0 -0
- /package/{src → dist}/FormLabel/FormLabel.mdx +0 -0
- /package/{src → dist}/FormLabel/FormLabel.stories.svelte +0 -0
- /package/{src/FormLabel/index.ts → dist/FormLabel/index.d.ts} +0 -0
- /package/{src → dist}/Headline/Headline.stories.svelte +0 -0
- /package/{src/Headline/index.ts → dist/Headline/index.d.ts} +0 -0
- /package/{src → dist}/HighlightCard/index.js +0 -0
- /package/{src → dist}/Input/index.js +0 -0
- /package/{src → dist}/Logotype/Logotype.svelte +0 -0
- /package/{src → dist}/Middot/Middot.svelte +0 -0
- /package/{src → dist}/Middot/index.js +0 -0
- /package/{src → dist}/Note/Note.stories.svelte +0 -0
- /package/{src/Note/index.ts → dist/Note/index.d.ts} +0 -0
- /package/{src → dist}/Select/Select.mdx +0 -0
- /package/{src → dist}/Select/SelectStoriesTemplate.svelte +0 -0
- /package/{src → dist}/Select/index.js +0 -0
- /package/{src → dist}/Select/mock_data/jobs.json +0 -0
- /package/{src → dist}/Switcher/Switcher.mdx +0 -0
- /package/{src → dist}/Switcher/Switcher.stories.svelte +0 -0
- /package/{src → dist}/Switcher/index.js +0 -0
- /package/{src → dist}/app.html +0 -0
- /package/{src → dist}/assets/close-circle.svg.svelte +0 -0
- /package/{src → dist}/assets/grow.svg.svelte +0 -0
- /package/{src → dist}/assets/hand-pointer.svg.svelte +0 -0
- /package/{src → dist}/assets/shrink.svg.svelte +0 -0
- /package/{src → dist}/assets/tap.svg.svelte +0 -0
- /package/{src → dist}/assets/times-circle-solid.svg.svelte +0 -0
- /package/{src → dist}/maplibre/AttributionControl/index.js +0 -0
- /package/{src → dist}/maplibre/GeocoderControl/index.js +0 -0
- /package/{src → dist}/maplibre/Map/index.js +0 -0
- /package/{src → dist}/maplibre/MapControl/MapControl.mdx +0 -0
- /package/{src → dist}/maplibre/MapControl/index.js +0 -0
- /package/{src → dist}/maplibre/MapStyle/SWRDataLabLight.mdx +0 -0
- /package/{src → dist}/maplibre/MapStyle/index.js +0 -0
- /package/{src → dist}/maplibre/Maplibre.mdx +0 -0
- /package/{src → dist}/maplibre/NavigationControl/index.js +0 -0
- /package/{src → dist}/maplibre/ScaleControl/index.js +0 -0
- /package/{src → dist}/maplibre/Source/index.js +0 -0
- /package/{src → dist}/maplibre/Tooltip/index.js +0 -0
- /package/{src → dist}/maplibre/VectorLayer/index.js +0 -0
- /package/{src → dist}/maplibre/VectorTileSource/VectorTileSource.mdx +0 -0
- /package/{src → dist}/maplibre/VectorTileSource/index.js +0 -0
- /package/{src → dist}/maplibre/WithLinkLocation/WithLinkLocation.mdx +0 -0
- /package/{src → dist}/maplibre/WithLinkLocation/index.js +0 -0
- /package/{src → dist}/styles/base.scss +0 -0
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import maplibre, { type ProjectionSpecification, type StyleSpecification } from 'maplibre-gl';
|
|
3
|
-
import { onMount, onDestroy, type Snippet, getContext, hasContext } from 'svelte';
|
|
4
|
-
import { createMapContext } from '../context.svelte.js';
|
|
5
|
-
import { type Location } from '../types';
|
|
6
|
-
import FallbackStyle from './FallbackStyle';
|
|
7
|
-
|
|
8
|
-
interface MapProps {
|
|
9
|
-
style?: StyleSpecification | string;
|
|
10
|
-
initialLocation?: Location;
|
|
11
|
-
allowRotation?: boolean;
|
|
12
|
-
allowZoom?: boolean;
|
|
13
|
-
minZoom?: number;
|
|
14
|
-
maxZoom?: number;
|
|
15
|
-
zoom?: number;
|
|
16
|
-
center?: maplibre.LngLat;
|
|
17
|
-
pitch?: number;
|
|
18
|
-
bearing?: number;
|
|
19
|
-
loading?: boolean;
|
|
20
|
-
projection?: ProjectionSpecification;
|
|
21
|
-
showDebug?: boolean;
|
|
22
|
-
options?: any;
|
|
23
|
-
children?: Snippet;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let {
|
|
27
|
-
children,
|
|
28
|
-
options,
|
|
29
|
-
style = FallbackStyle,
|
|
30
|
-
minZoom = 0,
|
|
31
|
-
maxZoom = 14.99,
|
|
32
|
-
zoom = $bindable(),
|
|
33
|
-
center = $bindable(),
|
|
34
|
-
pitch = $bindable(0),
|
|
35
|
-
bearing = $bindable(0),
|
|
36
|
-
loading = $bindable(true),
|
|
37
|
-
projection = { type: 'mercator' },
|
|
38
|
-
allowRotation = false,
|
|
39
|
-
allowZoom = true,
|
|
40
|
-
showDebug = false,
|
|
41
|
-
initialLocation = { lat: 51.3, lng: 10.2, zoom: 5 }
|
|
42
|
-
}: MapProps = $props();
|
|
43
|
-
|
|
44
|
-
let container: HTMLElement;
|
|
45
|
-
|
|
46
|
-
const mapContext = createMapContext();
|
|
47
|
-
if (getContext('initialLocation') !== undefined && getContext('initialLocation') !== false) {
|
|
48
|
-
initialLocation = getContext('initialLocation');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
onMount(() => {
|
|
52
|
-
mapContext.map = new maplibre.Map({
|
|
53
|
-
container,
|
|
54
|
-
style,
|
|
55
|
-
minZoom,
|
|
56
|
-
maxZoom,
|
|
57
|
-
pitch,
|
|
58
|
-
bearing,
|
|
59
|
-
attributionControl: false, // Added via component
|
|
60
|
-
center: [initialLocation.lng, initialLocation.lat],
|
|
61
|
-
zoom: initialLocation.zoom,
|
|
62
|
-
...options
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
mapContext.map.on('load', () => {
|
|
66
|
-
zoom = mapContext.map?.getZoom();
|
|
67
|
-
center = mapContext.map?.getCenter();
|
|
68
|
-
pitch = mapContext.map?.getPitch();
|
|
69
|
-
bearing = mapContext.map?.getBearing();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
mapContext.map.on('moveend', () => {
|
|
73
|
-
zoom = mapContext.map?.getZoom();
|
|
74
|
-
center = mapContext.map?.getCenter();
|
|
75
|
-
pitch = mapContext.map?.getPitch();
|
|
76
|
-
bearing = mapContext.map?.getBearing();
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
onDestroy(async () => {
|
|
81
|
-
if (mapContext.map) mapContext.map.remove();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
$effect(() => {
|
|
85
|
-
if (mapContext.map) mapContext.map.setStyle(style);
|
|
86
|
-
});
|
|
87
|
-
$effect(() => {
|
|
88
|
-
if (mapContext.styleLoaded) {
|
|
89
|
-
mapContext.map?.setProjection(projection);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
$effect(() => {
|
|
94
|
-
if (allowZoom === false) {
|
|
95
|
-
mapContext.map?.scrollZoom.disable();
|
|
96
|
-
} else {
|
|
97
|
-
mapContext.map?.scrollZoom.enable();
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
</script>
|
|
101
|
-
|
|
102
|
-
<div bind:this={container} class="container" data-testid="map-container">
|
|
103
|
-
{#if mapContext.map}
|
|
104
|
-
{#if children}
|
|
105
|
-
{@render children()}
|
|
106
|
-
{/if}
|
|
107
|
-
{/if}
|
|
108
|
-
{#if showDebug}
|
|
109
|
-
<pre class="debug">
|
|
110
|
-
{Object.entries({ ...center, zoom, allowZoom, allowRotation })
|
|
111
|
-
.map(([key, val]) => `${key}: ${val}`)
|
|
112
|
-
.join('\n')}</pre>
|
|
113
|
-
{/if}
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<style>
|
|
117
|
-
.container {
|
|
118
|
-
width: 100%;
|
|
119
|
-
height: 100%;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.debug {
|
|
123
|
-
position: absolute;
|
|
124
|
-
top: 0;
|
|
125
|
-
right: 0;
|
|
126
|
-
background: rgba(0, 0, 0, 0.9);
|
|
127
|
-
color: white;
|
|
128
|
-
z-index: 1000;
|
|
129
|
-
padding: 2px;
|
|
130
|
-
font-family: monospace;
|
|
131
|
-
}
|
|
132
|
-
:global {
|
|
133
|
-
.maplibregl-map {
|
|
134
|
-
overflow: hidden;
|
|
135
|
-
position: relative;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.maplibregl-canvas {
|
|
139
|
-
left: 0;
|
|
140
|
-
position: absolute;
|
|
141
|
-
top: 0;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.maplibregl-map:fullscreen {
|
|
145
|
-
height: 100%;
|
|
146
|
-
width: 100%;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.maplibregl-canvas-container.maplibregl-interactive {
|
|
150
|
-
cursor: grab;
|
|
151
|
-
user-select: none;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {
|
|
155
|
-
cursor: pointer;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.maplibregl-canvas-container.maplibregl-interactive:active {
|
|
159
|
-
cursor: grabbing;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,
|
|
163
|
-
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {
|
|
164
|
-
touch-action: pan-x pan-y;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.maplibregl-canvas-container.maplibregl-touch-drag-pan,
|
|
168
|
-
.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {
|
|
169
|
-
touch-action: pinch-zoom;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,
|
|
173
|
-
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan
|
|
174
|
-
.maplibregl-canvas {
|
|
175
|
-
touch-action: none;
|
|
176
|
-
}
|
|
177
|
-
.maplibregl-ctrl-bottom-left,
|
|
178
|
-
.maplibregl-ctrl-bottom-right,
|
|
179
|
-
.maplibregl-ctrl-top-left,
|
|
180
|
-
.maplibregl-ctrl-top-right {
|
|
181
|
-
position: absolute;
|
|
182
|
-
z-index: 2;
|
|
183
|
-
display: flex;
|
|
184
|
-
flex-flow: column;
|
|
185
|
-
gap: 0.75em;
|
|
186
|
-
align-items: flex-start;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.maplibregl-ctrl-top-left {
|
|
190
|
-
left: 0.5em;
|
|
191
|
-
top: 0.5em;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.maplibregl-ctrl-top-right {
|
|
195
|
-
right: 0;
|
|
196
|
-
top: 0;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.maplibregl-ctrl-bottom-left {
|
|
200
|
-
bottom: 0.5em;
|
|
201
|
-
left: 0.5em;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.maplibregl-ctrl-bottom-right {
|
|
205
|
-
bottom: 0.5em;
|
|
206
|
-
right: 0.5em;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.maplibregl-ctrl {
|
|
210
|
-
pointer-events: auto;
|
|
211
|
-
transform: translate(0);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.maplibregl-ctrl-group {
|
|
215
|
-
background: white;
|
|
216
|
-
border: 1px solid rgba(0, 0, 0, 0.75);
|
|
217
|
-
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.075);
|
|
218
|
-
border-radius: var(--br-small);
|
|
219
|
-
overflow: hidden;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.maplibregl-ctrl-group button {
|
|
223
|
-
background-color: transparent;
|
|
224
|
-
border: 0;
|
|
225
|
-
box-sizing: border-box;
|
|
226
|
-
cursor: pointer;
|
|
227
|
-
display: block;
|
|
228
|
-
height: 29px;
|
|
229
|
-
outline: none;
|
|
230
|
-
padding: 0;
|
|
231
|
-
width: 29px;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.maplibregl-ctrl-group button + button {
|
|
235
|
-
border-top: 1px solid rgba(0, 0, 0, 0.35);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.maplibregl-ctrl button .maplibregl-ctrl-icon {
|
|
239
|
-
background-position: 50%;
|
|
240
|
-
background-repeat: no-repeat;
|
|
241
|
-
display: block;
|
|
242
|
-
height: 100%;
|
|
243
|
-
width: 100%;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.maplibregl-ctrl button:disabled {
|
|
247
|
-
cursor: not-allowed;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {
|
|
251
|
-
opacity: 0.5;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.maplibregl-ctrl button:not(:disabled):hover {
|
|
255
|
-
background-color: var(--gray-light-5);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.maplibregl-ctrl-group button:focus:focus-visible {
|
|
259
|
-
box-shadow: 0 0 2px 2px #0096ff;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.maplibregl-ctrl-group button:focus:not(:focus-visible) {
|
|
263
|
-
box-shadow: none;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.maplibregl-ctrl-group button:focus:first-child {
|
|
267
|
-
border-radius: 4px 4px 0 0;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.maplibregl-ctrl-group button:focus:last-child {
|
|
271
|
-
border-radius: 0 0 4px 4px;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.maplibregl-ctrl-group button:focus:only-child {
|
|
275
|
-
border-radius: inherit;
|
|
276
|
-
}
|
|
277
|
-
.maplibregl-marker {
|
|
278
|
-
left: 0;
|
|
279
|
-
top: 0;
|
|
280
|
-
position: absolute;
|
|
281
|
-
will-change: transform;
|
|
282
|
-
}
|
|
283
|
-
.maplibregl-marker path {
|
|
284
|
-
fill: var(--violet-dark-5);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
</style>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import MapControl from './MapControl.svelte';
|
|
4
|
-
import { SWRDataLabLight } from '../MapStyle';
|
|
5
|
-
import DesignTokens from '../../DesignTokens/DesignTokens.svelte';
|
|
6
|
-
import Switcher from '../../Switcher/Switcher.svelte';
|
|
7
|
-
import Map from '../Map/Map.svelte';
|
|
8
|
-
|
|
9
|
-
type ThemeMap = {
|
|
10
|
-
[key: string]: StyleSpecification;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
import { eclipse } from '@versatiles/style';
|
|
14
|
-
import type { StyleSpecification } from 'maplibre-gl';
|
|
15
|
-
const eclipseStyle = eclipse({
|
|
16
|
-
language: 'de',
|
|
17
|
-
baseUrl: 'https://tiles.versatiles.org',
|
|
18
|
-
glyphs: 'https://static.datenhub.net/maps/fonts/{fontstack}/{range}.pbf'
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const { Story } = defineMeta({
|
|
22
|
-
title: 'Maplibre/Control/MapControl',
|
|
23
|
-
component: MapControl
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const themes: ThemeMap = {
|
|
27
|
-
'SWRDL Light': SWRDataLabLight,
|
|
28
|
-
Eclipse: eclipseStyle
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
let currentTheme = $state('SWRDL Light');
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<Story asChild name="Custom HTML Control">
|
|
35
|
-
<DesignTokens>
|
|
36
|
-
<div class="container">
|
|
37
|
-
<Map style={themes[currentTheme]} initialLocation={{ lat: 51, lng: 10, zoom: 20 }}>
|
|
38
|
-
<MapControl position="top-left">
|
|
39
|
-
<Switcher
|
|
40
|
-
options={Object.keys(themes)}
|
|
41
|
-
bind:value={currentTheme}
|
|
42
|
-
label="Select theme"
|
|
43
|
-
size="small"
|
|
44
|
-
/>
|
|
45
|
-
</MapControl>
|
|
46
|
-
</Map>
|
|
47
|
-
</div>
|
|
48
|
-
</DesignTokens>
|
|
49
|
-
</Story>
|
|
50
|
-
|
|
51
|
-
<style>
|
|
52
|
-
.container {
|
|
53
|
-
width: 500px;
|
|
54
|
-
height: 300px;
|
|
55
|
-
}
|
|
56
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { type Snippet } from 'svelte';
|
|
3
|
-
import { type ControlPosition, type IControl } from 'maplibre-gl';
|
|
4
|
-
import { getMapContext } from '../context.svelte.js';
|
|
5
|
-
|
|
6
|
-
interface MapControlProps {
|
|
7
|
-
position: ControlPosition;
|
|
8
|
-
control?: IControl;
|
|
9
|
-
className?: string;
|
|
10
|
-
children?: Snippet;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
let { position, control, className, children }: MapControlProps = $props();
|
|
14
|
-
let el: HTMLDivElement | undefined = $state();
|
|
15
|
-
|
|
16
|
-
const { map } = $derived(getMapContext());
|
|
17
|
-
|
|
18
|
-
let ctrl = $derived.by(() => {
|
|
19
|
-
return control
|
|
20
|
-
? control
|
|
21
|
-
: {
|
|
22
|
-
onAdd: () => el!,
|
|
23
|
-
onRemove: () => el?.parentNode?.removeChild(el)
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
$effect(() => {
|
|
28
|
-
if (map && ctrl) {
|
|
29
|
-
map.addControl(ctrl, position);
|
|
30
|
-
}
|
|
31
|
-
return () => {
|
|
32
|
-
map?.removeControl(control);
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<div bind:this={el} class={`maplibregl-ctrl ${className}`}>
|
|
38
|
-
{#if children}
|
|
39
|
-
{@render children()}
|
|
40
|
-
{/if}
|
|
41
|
-
</div>
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { StyleSpecification } from 'maplibre-gl';
|
|
2
|
-
|
|
3
|
-
import makeAdmin from './components/Admin';
|
|
4
|
-
import makeBuildings from './components/Buildings';
|
|
5
|
-
import makeLanduse from './components/Landuse';
|
|
6
|
-
import makeTransit from './components/Transit';
|
|
7
|
-
import makePlaceLabels from './components/PlaceLabels';
|
|
8
|
-
import makeWalking from './components/Walking';
|
|
9
|
-
import makeRoads from './components/Roads';
|
|
10
|
-
|
|
11
|
-
const { buildings } = makeBuildings();
|
|
12
|
-
const { landuse } = makeLanduse();
|
|
13
|
-
const { placeLabels } = makePlaceLabels();
|
|
14
|
-
const { admin } = makeAdmin();
|
|
15
|
-
const { airports, transitBridges, transitSurface, transitTunnels } = makeTransit();
|
|
16
|
-
const { walkingLabels, walkingTunnels, walkingSurface, walkingBridges } = makeWalking();
|
|
17
|
-
const { roadLabels, roadBridges, roadSurface, roadTunnels } = makeRoads();
|
|
18
|
-
|
|
19
|
-
const style: StyleSpecification = {
|
|
20
|
-
version: 8,
|
|
21
|
-
name: 'swr-datalab-light',
|
|
22
|
-
metadata: { license: 'https://creativecommons.org/publicdomain/zero/1.0/' },
|
|
23
|
-
glyphs: 'https://static.datenhub.net/maps/fonts/{fontstack}/{range}.pbf',
|
|
24
|
-
sources: {
|
|
25
|
-
'versatiles-osm': {
|
|
26
|
-
attribution:
|
|
27
|
-
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
28
|
-
tiles: ['https://tiles.versatiles.org/tiles/osm/{z}/{x}/{y}'],
|
|
29
|
-
bounds: [-180, -85.0511287798066, 180, 85.0511287798066],
|
|
30
|
-
type: 'vector',
|
|
31
|
-
scheme: 'xyz',
|
|
32
|
-
minzoom: 0,
|
|
33
|
-
maxzoom: 14
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
sky: {
|
|
37
|
-
'atmosphere-blend': ['interpolate', ['linear'], ['zoom'], 0, 0.1, 5, 0.1, 7, 0]
|
|
38
|
-
},
|
|
39
|
-
layers: [
|
|
40
|
-
// 1. Landuse
|
|
41
|
-
...landuse,
|
|
42
|
-
...airports,
|
|
43
|
-
|
|
44
|
-
// 2. Buildings
|
|
45
|
-
...buildings,
|
|
46
|
-
|
|
47
|
-
// 3. Tunnels
|
|
48
|
-
...walkingTunnels,
|
|
49
|
-
...roadTunnels,
|
|
50
|
-
...transitTunnels,
|
|
51
|
-
|
|
52
|
-
// 4. Surface ways
|
|
53
|
-
...walkingSurface,
|
|
54
|
-
...roadSurface,
|
|
55
|
-
...transitSurface,
|
|
56
|
-
|
|
57
|
-
// 5. Bridges ways
|
|
58
|
-
...walkingBridges,
|
|
59
|
-
...roadBridges,
|
|
60
|
-
...transitBridges,
|
|
61
|
-
|
|
62
|
-
// 6. Admin boundaries
|
|
63
|
-
...admin,
|
|
64
|
-
|
|
65
|
-
// 7. Labels
|
|
66
|
-
...walkingLabels,
|
|
67
|
-
...roadLabels,
|
|
68
|
-
...placeLabels
|
|
69
|
-
]
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export default style;
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import tokens from '../tokens';
|
|
2
|
-
import { type Layer } from '../../types';
|
|
3
|
-
|
|
4
|
-
export default function makeAdmin(): any {
|
|
5
|
-
const admin: Layer[] = [
|
|
6
|
-
{
|
|
7
|
-
id: 'boundary-country:outline',
|
|
8
|
-
filter: [
|
|
9
|
-
'all',
|
|
10
|
-
['==', 'admin_level', 2],
|
|
11
|
-
['!=', 'maritime', true],
|
|
12
|
-
['!=', 'disputed', true],
|
|
13
|
-
['!=', 'coastline', true]
|
|
14
|
-
],
|
|
15
|
-
paint: {
|
|
16
|
-
'line-color': tokens.background,
|
|
17
|
-
'line-blur': 1,
|
|
18
|
-
'line-width': {
|
|
19
|
-
stops: [
|
|
20
|
-
[2, 0],
|
|
21
|
-
[3, 2],
|
|
22
|
-
[10, 8]
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
'line-opacity': 0.75
|
|
26
|
-
},
|
|
27
|
-
layout: {
|
|
28
|
-
'line-cap': 'round',
|
|
29
|
-
'line-join': 'round'
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: 'boundary-country-disputed:outline',
|
|
34
|
-
filter: [
|
|
35
|
-
'all',
|
|
36
|
-
['==', 'admin_level', 2],
|
|
37
|
-
['==', 'disputed', true],
|
|
38
|
-
['!=', 'maritime', true],
|
|
39
|
-
['!=', 'coastline', true]
|
|
40
|
-
],
|
|
41
|
-
paint: {
|
|
42
|
-
'line-width': {
|
|
43
|
-
stops: [
|
|
44
|
-
[2, 0],
|
|
45
|
-
[3, 2],
|
|
46
|
-
[10, 8]
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
'line-opacity': 0.75,
|
|
50
|
-
'line-color': tokens.background
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'boundary-state:outline',
|
|
55
|
-
filter: [
|
|
56
|
-
'all',
|
|
57
|
-
['==', 'admin_level', 4],
|
|
58
|
-
['!=', 'maritime', true],
|
|
59
|
-
['!=', 'disputed', true],
|
|
60
|
-
['!=', 'coastline', true]
|
|
61
|
-
],
|
|
62
|
-
paint: {
|
|
63
|
-
'line-color': tokens.background,
|
|
64
|
-
'line-blur': 1,
|
|
65
|
-
'line-width': {
|
|
66
|
-
stops: [
|
|
67
|
-
[7, 0],
|
|
68
|
-
[8, 2],
|
|
69
|
-
[10, 4]
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
'line-opacity': 0.75
|
|
73
|
-
},
|
|
74
|
-
layout: {
|
|
75
|
-
'line-cap': 'round',
|
|
76
|
-
'line-join': 'round'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: 'boundary-country',
|
|
81
|
-
filter: [
|
|
82
|
-
'all',
|
|
83
|
-
['==', 'admin_level', 2],
|
|
84
|
-
['!=', 'maritime', true],
|
|
85
|
-
['!=', 'disputed', true],
|
|
86
|
-
['!=', 'coastline', true]
|
|
87
|
-
],
|
|
88
|
-
paint: {
|
|
89
|
-
'line-color': {
|
|
90
|
-
stops: [
|
|
91
|
-
[7, '#cecdcd'],
|
|
92
|
-
[10, 'black']
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
'line-width': {
|
|
97
|
-
stops: [
|
|
98
|
-
[2, 0],
|
|
99
|
-
[5, 1],
|
|
100
|
-
[8, 1],
|
|
101
|
-
[12, 3]
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
layout: {
|
|
106
|
-
'line-cap': 'round',
|
|
107
|
-
'line-join': 'round'
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
id: 'boundary-country-disputed',
|
|
112
|
-
filter: [
|
|
113
|
-
'all',
|
|
114
|
-
['==', 'admin_level', 2],
|
|
115
|
-
['==', 'disputed', true],
|
|
116
|
-
['!=', 'maritime', true],
|
|
117
|
-
['!=', 'coastline', true]
|
|
118
|
-
],
|
|
119
|
-
paint: {
|
|
120
|
-
'line-width': {
|
|
121
|
-
stops: [
|
|
122
|
-
[2, 0],
|
|
123
|
-
[3, 1],
|
|
124
|
-
[10, 4]
|
|
125
|
-
]
|
|
126
|
-
},
|
|
127
|
-
'line-color': 'hsl(246,0%,77%)',
|
|
128
|
-
'line-dasharray': [2, 1]
|
|
129
|
-
},
|
|
130
|
-
layout: {
|
|
131
|
-
'line-cap': 'square'
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
id: 'boundary-state',
|
|
136
|
-
filter: [
|
|
137
|
-
'all',
|
|
138
|
-
['==', 'admin_level', 4],
|
|
139
|
-
['!=', 'maritime', true],
|
|
140
|
-
['!=', 'disputed', true],
|
|
141
|
-
['!=', 'coastline', true]
|
|
142
|
-
],
|
|
143
|
-
paint: {
|
|
144
|
-
'line-color': 'hsl(37, 34%, 79%)',
|
|
145
|
-
'line-width': {
|
|
146
|
-
stops: [
|
|
147
|
-
[7, 1],
|
|
148
|
-
[8, 1.5]
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
'line-opacity': {
|
|
152
|
-
stops: [
|
|
153
|
-
[7, 0],
|
|
154
|
-
[8, 1]
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
layout: {
|
|
159
|
-
'line-cap': 'round',
|
|
160
|
-
'line-join': 'round'
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
].map((el) => {
|
|
164
|
-
return {
|
|
165
|
-
source: 'versatiles-osm',
|
|
166
|
-
'source-layer': 'boundaries',
|
|
167
|
-
type: 'line',
|
|
168
|
-
...el
|
|
169
|
-
} as Layer;
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
return { admin };
|
|
173
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type Layer } from '../../types';
|
|
2
|
-
|
|
3
|
-
export default function makeBuildings(): any {
|
|
4
|
-
const buildings: Layer[] = [
|
|
5
|
-
{
|
|
6
|
-
id: 'building-fill',
|
|
7
|
-
type: 'fill',
|
|
8
|
-
source: 'versatiles-osm',
|
|
9
|
-
'source-layer': 'buildings',
|
|
10
|
-
paint: {
|
|
11
|
-
'fill-color': 'hsl(240, 4%, 95%)',
|
|
12
|
-
'fill-opacity': {
|
|
13
|
-
stops: [
|
|
14
|
-
[14, 0],
|
|
15
|
-
[15, 1]
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
return { buildings };
|
|
23
|
-
}
|