@versatiles/svelte 2.1.7 → 2.1.8
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/components/BBoxMap/AutoComplete.svelte +0 -13
- package/dist/components/BBoxMap/BBoxMap.svelte +8 -2
- package/dist/components/BBoxMap/BBoxMap.svelte.d.ts +2 -0
- package/dist/components/BasicMap/BasicMap.svelte +0 -1
- package/dist/components/LocatorMap/LocatorMap.svelte +7 -1
- package/dist/components/LocatorMap/LocatorMap.svelte.d.ts +6 -17
- package/dist/components/MapEditor/MapEditor.svelte +7 -0
- package/dist/components/MapEditor/MapEditor.svelte.d.ts +5 -1
- package/package.json +1 -1
|
@@ -34,19 +34,6 @@
|
|
|
34
34
|
// Escape special characters in search string for use in regex
|
|
35
35
|
const regExpEscape = (s: string) => s.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
36
36
|
|
|
37
|
-
$effect(() => {
|
|
38
|
-
if (inputText.length >= minChar) {
|
|
39
|
-
const r = filterResults();
|
|
40
|
-
if (r.length > 0) {
|
|
41
|
-
const { key, value } = r[0];
|
|
42
|
-
inputText = key;
|
|
43
|
-
change(JSON.parse(JSON.stringify(value)));
|
|
44
|
-
} else {
|
|
45
|
-
inputText = '';
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
37
|
// Handle input change
|
|
51
38
|
function onChange() {
|
|
52
39
|
if (inputText.length >= minChar) {
|
|
@@ -7,7 +7,13 @@
|
|
|
7
7
|
import { loadBBoxes } from './BBoxMap.js';
|
|
8
8
|
import { BBoxDrawer, isSameBBox, type BBox } from './lib/bbox_drawer.js';
|
|
9
9
|
|
|
10
|
-
let {
|
|
10
|
+
let {
|
|
11
|
+
selectedBBox = $bindable(),
|
|
12
|
+
onMapLoad
|
|
13
|
+
}: {
|
|
14
|
+
selectedBBox?: BBox;
|
|
15
|
+
onMapLoad?: (map: MaplibreMapType, maplibre: typeof import('maplibre-gl')) => void;
|
|
16
|
+
} = $props();
|
|
11
17
|
|
|
12
18
|
const startTime = Date.now();
|
|
13
19
|
let bboxDrawer: BBoxDrawer | undefined;
|
|
@@ -95,7 +101,7 @@
|
|
|
95
101
|
/>
|
|
96
102
|
</div>
|
|
97
103
|
{/if}
|
|
98
|
-
<BasicMap {onMapInit}></BasicMap>
|
|
104
|
+
<BasicMap {onMapInit} {onMapLoad}></BasicMap>
|
|
99
105
|
</div>
|
|
100
106
|
|
|
101
107
|
<style>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { Map as MaplibreMapType } from 'maplibre-gl';
|
|
1
2
|
import { type BBox } from './lib/bbox_drawer.js';
|
|
2
3
|
type $$ComponentProps = {
|
|
3
4
|
selectedBBox?: BBox;
|
|
5
|
+
onMapLoad?: (map: MaplibreMapType, maplibre: typeof import('maplibre-gl')) => void;
|
|
4
6
|
};
|
|
5
7
|
declare const BBoxMap: import("svelte").Component<$$ComponentProps, {}, "selectedBBox">;
|
|
6
8
|
type BBoxMap = ReturnType<typeof BBoxMap>;
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
import BasicMap from '../BasicMap/BasicMap.svelte';
|
|
4
4
|
let map: MaplibreMapType;
|
|
5
5
|
|
|
6
|
+
let {
|
|
7
|
+
onMapLoad
|
|
8
|
+
}: {
|
|
9
|
+
onMapLoad?: (map: MaplibreMapType, maplibre: typeof import('maplibre-gl')) => void;
|
|
10
|
+
} = $props();
|
|
11
|
+
|
|
6
12
|
function onMapInit(_map: MaplibreMapType) {
|
|
7
13
|
map = _map;
|
|
8
14
|
map.on('load', async () => {
|
|
@@ -66,7 +72,7 @@
|
|
|
66
72
|
</script>
|
|
67
73
|
|
|
68
74
|
<div class="container">
|
|
69
|
-
<BasicMap {onMapInit}></BasicMap>
|
|
75
|
+
<BasicMap {onMapInit} {onMapLoad}></BasicMap>
|
|
70
76
|
</div>
|
|
71
77
|
|
|
72
78
|
<style>
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const LocatorMap: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type LocatorMap = InstanceType<typeof LocatorMap>;
|
|
1
|
+
import type { Map as MaplibreMapType } from 'maplibre-gl';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
onMapLoad?: (map: MaplibreMapType, maplibre: typeof import('maplibre-gl')) => void;
|
|
4
|
+
};
|
|
5
|
+
declare const LocatorMap: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type LocatorMap = ReturnType<typeof LocatorMap>;
|
|
18
7
|
export default LocatorMap;
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
import { GeometryManagerInteractive } from './lib/geometry_manager_interactive.js';
|
|
8
8
|
import { StateReader } from './lib/state/reader.js';
|
|
9
9
|
|
|
10
|
+
let {
|
|
11
|
+
onMapLoad
|
|
12
|
+
}: {
|
|
13
|
+
onMapLoad?: (map: MaplibreMapType, maplibre: typeof import('maplibre-gl')) => void;
|
|
14
|
+
} = $props();
|
|
15
|
+
|
|
10
16
|
let showSidebar = $state(false);
|
|
11
17
|
let geometryManager: GeometryManager | GeometryManagerInteractive | undefined = $state();
|
|
12
18
|
|
|
@@ -52,6 +58,7 @@
|
|
|
52
58
|
<div class="container">
|
|
53
59
|
<BasicMap
|
|
54
60
|
{onMapInit}
|
|
61
|
+
{onMapLoad}
|
|
55
62
|
emptyStyle={true}
|
|
56
63
|
mapOptions={{ attributionControl: false }}
|
|
57
64
|
styleOptions={{ darkMode: false }}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Map as MaplibreMapType } from 'maplibre-gl';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
onMapLoad?: (map: MaplibreMapType, maplibre: typeof import('maplibre-gl')) => void;
|
|
4
|
+
};
|
|
5
|
+
declare const MapEditor: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
2
6
|
type MapEditor = ReturnType<typeof MapEditor>;
|
|
3
7
|
export default MapEditor;
|