@swr-data-lab/components 2.0.0 → 2.1.0
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/maplibre/GeoJSONSource/GeoJSONSource.svelte +13 -0
- package/dist/maplibre/GeoJSONSource/GeoJSONSource.svelte.d.ts +15 -0
- package/dist/maplibre/GeoJSONSource/index.d.ts +2 -0
- package/dist/maplibre/GeoJSONSource/index.js +2 -0
- package/dist/maplibre/VectorLayer/VectorLayer.svelte +1 -1
- package/dist/maplibre/VectorLayer/VectorLayer.svelte.d.ts +1 -1
- package/dist/maplibre/VectorTileSource/VectorTileSource.svelte +4 -4
- package/dist/maplibre/VectorTileSource/VectorTileSource.svelte.d.ts +4 -2
- package/package.json +3 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">// See: https://maplibre.org/maplibre-gl-js/docs/API/classes/GeoJSONSource/
|
|
2
|
+
import {} from 'maplibre-gl';
|
|
3
|
+
import MapSource from '../Source/MapSource.svelte';
|
|
4
|
+
const { maxZoom = 24, id, data, attribution = '' } = $props();
|
|
5
|
+
const sourceSpec = {
|
|
6
|
+
type: 'geojson',
|
|
7
|
+
data,
|
|
8
|
+
maxzoom: maxZoom,
|
|
9
|
+
attribution
|
|
10
|
+
};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<MapSource {id} {sourceSpec} />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface GeoJSONSourceProps {
|
|
2
|
+
id: string;
|
|
3
|
+
/**
|
|
4
|
+
* GeoJSON object or URL
|
|
5
|
+
*/
|
|
6
|
+
data: GeoJSON.GeoJSON | string;
|
|
7
|
+
/**
|
|
8
|
+
* Attribution string for your data, usually rendered using an `<AttributionControl>`
|
|
9
|
+
*/
|
|
10
|
+
attribution?: string;
|
|
11
|
+
maxZoom?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const GeoJsonSource: import("svelte").Component<GeoJSONSourceProps, {}, "">;
|
|
14
|
+
type GeoJsonSource = ReturnType<typeof GeoJsonSource>;
|
|
15
|
+
export default GeoJsonSource;
|
|
@@ -2,7 +2,7 @@ import type { CircleLayoutProps, CirclePaintProps, FillLayoutProps, FillPaintPro
|
|
|
2
2
|
interface VectorLayerProps {
|
|
3
3
|
id: string;
|
|
4
4
|
sourceId: string;
|
|
5
|
-
sourceLayer
|
|
5
|
+
sourceLayer?: string;
|
|
6
6
|
type: 'line' | 'fill' | 'circle' | 'symbol';
|
|
7
7
|
placeBelow: string;
|
|
8
8
|
visible?: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script lang="ts">import {} from '
|
|
2
|
-
import {} from 'maplibre-gl';
|
|
1
|
+
<script lang="ts">import {} from 'maplibre-gl';
|
|
3
2
|
import MapSource from '../Source/MapSource.svelte';
|
|
4
|
-
const { minZoom = 0, maxZoom = 24, id, url } = $props();
|
|
3
|
+
const { minZoom = 0, maxZoom = 24, id, url, attribution = '' } = $props();
|
|
5
4
|
const sourceSpec = {
|
|
6
5
|
type: 'vector',
|
|
7
6
|
tiles: [url],
|
|
8
7
|
maxzoom: maxZoom,
|
|
9
|
-
minzoom: minZoom
|
|
8
|
+
minzoom: minZoom,
|
|
9
|
+
attribution
|
|
10
10
|
};
|
|
11
11
|
</script>
|
|
12
12
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { type Snippet } from 'svelte';
|
|
2
1
|
interface VectorTileSourceProps {
|
|
3
2
|
id: string;
|
|
4
3
|
url: string;
|
|
5
4
|
minZoom?: number;
|
|
6
5
|
maxZoom?: number;
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Attribution string for your data, usually rendered using an `<AttributionControl>`
|
|
8
|
+
*/
|
|
9
|
+
attribution?: string;
|
|
8
10
|
}
|
|
9
11
|
declare const VectorTileSource: import("svelte").Component<VectorTileSourceProps, {}, "">;
|
|
10
12
|
type VectorTileSource = ReturnType<typeof VectorTileSource>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swr-data-lab/components",
|
|
3
3
|
"description": "SWR Data Lab component library",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"author": "SWR Data Lab",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@sveltejs/kit": "^2.22.2",
|
|
50
50
|
"@sveltejs/package": "^2.3.12",
|
|
51
51
|
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
|
52
|
+
"@types/geojson": "^7946.0.16",
|
|
52
53
|
"@versatiles/style": "^5.6.0",
|
|
53
54
|
"@vitest/browser": "^3.2.4",
|
|
54
55
|
"@vitest/coverage-v8": "^3.2.4",
|
|
@@ -61,9 +62,9 @@
|
|
|
61
62
|
"sass-embedded": "^1.89.2",
|
|
62
63
|
"semantic-release": "^24.2.6",
|
|
63
64
|
"storybook": "^9.0.15",
|
|
64
|
-
"svelte-preprocess": "^6.0.3",
|
|
65
65
|
"svelte": "^5.23.0",
|
|
66
66
|
"svelte-check": "^4.0.0",
|
|
67
|
+
"svelte-preprocess": "^6.0.3",
|
|
67
68
|
"typescript": "^5.8.3",
|
|
68
69
|
"vite": "^6.0.0",
|
|
69
70
|
"vitest": "^3.1.1",
|