@tileflow/svelte 0.1.0-alpha.21 → 0.1.0-alpha.23
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/README.md +21 -4
- package/package.json +6 -9
- package/src/TileflowMap.svelte +3 -1
- package/src/index.d.ts +4 -0
- package/src/index.js +1 -0
- package/src/maplibre.js +36 -4
- package/GENERATED_OUTPUT_LICENSE.md +0 -21
- package/NOTICE +0 -9
- package/TRADEMARKS.md +0 -10
package/README.md
CHANGED
|
@@ -22,6 +22,23 @@ Install `maplibre-gl` alongside the package and import its CSS once in your app.
|
|
|
22
22
|
/>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## MapLibre 6 worker
|
|
26
|
+
|
|
27
|
+
With MapLibre GL JS 6, configure the application-owned worker once before mounting an interactive
|
|
28
|
+
map. The worker URL must come from the same `maplibre-gl` package installed by the application.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
// main.ts
|
|
32
|
+
import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url';
|
|
33
|
+
import {configureTileflowMapLibre} from '@tileflow/svelte';
|
|
34
|
+
|
|
35
|
+
configureTileflowMapLibre({workerUrl});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This is the Vite setup. Run it before `mount(...)`; `mode="image"` remains MapLibre-free. MapLibre
|
|
39
|
+
GL JS 6.4.1-6.x is supported. Use the `@tileflow/next` or `@tileflow/webpack` README for their
|
|
40
|
+
worker-delivery recipes.
|
|
41
|
+
|
|
25
42
|
`mapOptions` accepts native MapLibre options except `container` and `style`, which
|
|
26
43
|
Tileflow resolves from `source`. Direct
|
|
27
44
|
Tileflow props such as `center`, `zoom`, and `interactive` take priority when
|
|
@@ -186,9 +203,9 @@ present. Application capture selects exactly one ready target.
|
|
|
186
203
|
|
|
187
204
|
## Compatibility
|
|
188
205
|
|
|
189
|
-
The supported peer window is Svelte 5.x and MapLibre GL JS
|
|
190
|
-
Svelte 5.0.0 with the
|
|
191
|
-
the public declarations, and compile real Svelte consumers. Future Svelte majors
|
|
192
|
-
peer range until that matrix passes.
|
|
206
|
+
The supported peer window is Svelte 5.x and MapLibre GL JS 6.4.1-6.x. Compatibility smoke tests
|
|
207
|
+
install Svelte 5.0.0 with the exact lower bound and selected current release from packed Tileflow
|
|
208
|
+
tarballs, typecheck the public declarations, and compile real Svelte consumers. Future Svelte majors
|
|
209
|
+
stay outside the peer range until that matrix passes.
|
|
193
210
|
|
|
194
211
|
Docs: https://tileflow.dev/docs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tileflow/svelte",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.23",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Svelte component for rendering Tileflow maps with MapLibre.",
|
|
6
6
|
"type": "module",
|
|
@@ -25,10 +25,7 @@
|
|
|
25
25
|
"types": "./src/index.d.ts",
|
|
26
26
|
"files": [
|
|
27
27
|
"src",
|
|
28
|
-
"LICENSE"
|
|
29
|
-
"NOTICE",
|
|
30
|
-
"GENERATED_OUTPUT_LICENSE.md",
|
|
31
|
-
"TRADEMARKS.md"
|
|
28
|
+
"LICENSE"
|
|
32
29
|
],
|
|
33
30
|
"exports": {
|
|
34
31
|
".": {
|
|
@@ -47,15 +44,15 @@
|
|
|
47
44
|
"access": "public"
|
|
48
45
|
},
|
|
49
46
|
"dependencies": {
|
|
50
|
-
"@tileflow/core": ">=0.1.0-alpha.
|
|
51
|
-
"@tileflow/interactions": ">=0.1.0-alpha.
|
|
47
|
+
"@tileflow/core": ">=0.1.0-alpha.24 <0.1.0-beta.0",
|
|
48
|
+
"@tileflow/interactions": ">=0.1.0-alpha.3 <0.1.0-beta.0"
|
|
52
49
|
},
|
|
53
50
|
"peerDependencies": {
|
|
54
|
-
"maplibre-gl": ">=
|
|
51
|
+
"maplibre-gl": ">=6.4.1 <7",
|
|
55
52
|
"svelte": ">=5 <6"
|
|
56
53
|
},
|
|
57
54
|
"devDependencies": {
|
|
58
|
-
"maplibre-gl": "
|
|
55
|
+
"maplibre-gl": "6.9.0",
|
|
59
56
|
"svelte": "^5.43.17",
|
|
60
57
|
"svelte-check": "^4.3.4"
|
|
61
58
|
},
|
package/src/TileflowMap.svelte
CHANGED
|
@@ -1202,9 +1202,11 @@
|
|
|
1202
1202
|
}
|
|
1203
1203
|
|
|
1204
1204
|
function createTileflowMapLibrePoiMap(map: MapLibreMap): TileflowMapLibrePoiMap {
|
|
1205
|
+
const poiMap = map as unknown as TileflowMapLibrePoiMap;
|
|
1206
|
+
|
|
1205
1207
|
return {
|
|
1206
1208
|
getStyle: () => map.getStyle(),
|
|
1207
|
-
on: (event, listener) =>
|
|
1209
|
+
on: (event, listener) => poiMap.on(event, listener),
|
|
1208
1210
|
queryRenderedFeatures(point, options) {
|
|
1209
1211
|
return map
|
|
1210
1212
|
.queryRenderedFeatures(point as PointLike, {layers: [...options.layers]})
|
package/src/index.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ import type {
|
|
|
19
19
|
export type TileflowMapMode = 'interactive' | 'image';
|
|
20
20
|
export type TileflowMapOptions = Omit<MapLibreMapOptions, 'container' | 'style'>;
|
|
21
21
|
export type TileflowMapSource = TileflowRuntimeSource;
|
|
22
|
+
export type TileflowMapLibreConfiguration = Readonly<{workerUrl: string}>;
|
|
23
|
+
|
|
24
|
+
/** Configure the application-owned worker before mounting an interactive Tileflow map. */
|
|
25
|
+
export function configureTileflowMapLibre(configuration: TileflowMapLibreConfiguration): void;
|
|
22
26
|
|
|
23
27
|
export type TileflowMapAnnotationSnippet<
|
|
24
28
|
TAnnotation extends TileflowAnnotation = TileflowAnnotation,
|
package/src/index.js
CHANGED
package/src/maplibre.js
CHANGED
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
/** @typedef {typeof import('maplibre-gl')} TileflowMapLibre */
|
|
2
|
+
/** @typedef {{workerUrl: string}} TileflowMapLibreConfiguration */
|
|
2
3
|
|
|
3
4
|
/** @type {Promise<TileflowMapLibre> | undefined} */
|
|
4
5
|
let mapLibrePromise;
|
|
6
|
+
/** @type {TileflowMapLibre | undefined} */
|
|
7
|
+
let mapLibre;
|
|
8
|
+
/** @type {string | undefined} */
|
|
9
|
+
let workerUrl;
|
|
10
|
+
|
|
11
|
+
/** @param {TileflowMapLibreConfiguration} configuration */
|
|
12
|
+
export function configureTileflowMapLibre(configuration) {
|
|
13
|
+
const nextWorkerUrl = configuration.workerUrl;
|
|
14
|
+
|
|
15
|
+
if (typeof nextWorkerUrl !== 'string' || nextWorkerUrl.trim().length === 0) {
|
|
16
|
+
throw new TypeError('Tileflow MapLibre workerUrl must be a non-empty string.');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (workerUrl !== undefined && workerUrl !== nextWorkerUrl) {
|
|
20
|
+
throw new Error('Tileflow MapLibre workerUrl is already configured.');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
workerUrl = nextWorkerUrl;
|
|
24
|
+
mapLibre?.setWorkerUrl(nextWorkerUrl);
|
|
25
|
+
}
|
|
5
26
|
|
|
6
27
|
/** Load the interactive renderer only after a browser map requests it. */
|
|
7
28
|
export function loadTileflowMapLibre() {
|
|
8
|
-
mapLibrePromise ??= import('maplibre-gl')
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
29
|
+
mapLibrePromise ??= import('maplibre-gl')
|
|
30
|
+
.then(resolveMapLibreModule)
|
|
31
|
+
.then(configureTileflowMapLibreModule)
|
|
32
|
+
.catch((error) => {
|
|
33
|
+
mapLibrePromise = undefined;
|
|
34
|
+
throw error;
|
|
35
|
+
});
|
|
36
|
+
|
|
12
37
|
return mapLibrePromise;
|
|
13
38
|
}
|
|
14
39
|
|
|
@@ -16,3 +41,10 @@ export function loadTileflowMapLibre() {
|
|
|
16
41
|
function resolveMapLibreModule(module) {
|
|
17
42
|
return /** @type {TileflowMapLibre & {default?: TileflowMapLibre}} */ (module).default ?? module;
|
|
18
43
|
}
|
|
44
|
+
|
|
45
|
+
/** @param {TileflowMapLibre} maplibregl */
|
|
46
|
+
function configureTileflowMapLibreModule(maplibregl) {
|
|
47
|
+
if (workerUrl !== undefined) maplibregl.setWorkerUrl(workerUrl);
|
|
48
|
+
mapLibre = maplibregl;
|
|
49
|
+
return maplibregl;
|
|
50
|
+
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Tileflow generated-output grant
|
|
2
|
-
|
|
3
|
-
In addition to the rights granted by the Apache License, Version 2.0, Tileflow.dev contributors
|
|
4
|
-
grant recipients a perpetual, worldwide, non-exclusive, no-charge, royalty-free right to use,
|
|
5
|
-
reproduce, modify, display, perform, distribute, sublicense, and commercialize the Tileflow-owned
|
|
6
|
-
parts of output generated by this SDK.
|
|
7
|
-
|
|
8
|
-
Covered output includes compiled map styles, manifests, receipts, sprites, glyph artifacts, static
|
|
9
|
-
render descriptions, and other build artifacts produced from Tileflow maps or application maps.
|
|
10
|
-
Original Tileflow map definitions, icons, and patterns distributed by `@tileflow/maps` may likewise
|
|
11
|
-
be used, modified, embedded, deployed, and redistributed as part of personal or commercial maps and
|
|
12
|
-
applications.
|
|
13
|
-
|
|
14
|
-
This grant does not relicense third-party software, fonts, icons, map data, datasets, imagery, or
|
|
15
|
-
other input material. Their licenses, attribution requirements, notices, and use restrictions
|
|
16
|
-
continue to apply to the relevant source and generated output. You are responsible for having the
|
|
17
|
-
rights necessary to process and distribute your own inputs.
|
|
18
|
-
|
|
19
|
-
This grant does not provide access to Tileflow hosted services or grant rights in Tileflow names,
|
|
20
|
-
logos, or marks. The SDK and generated output are provided without warranties or conditions beyond
|
|
21
|
-
those required by applicable law.
|
package/NOTICE
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Tileflow SDK
|
|
2
|
-
Copyright 2026 Tileflow.dev contributors
|
|
3
|
-
|
|
4
|
-
This product includes software and original map artwork developed by Tileflow.dev contributors.
|
|
5
|
-
|
|
6
|
-
Third-party materials distributed with a package remain subject to their own license and notice
|
|
7
|
-
files. See THIRD_PARTY_NOTICES.md and asset-adjacent license files where present.
|
|
8
|
-
|
|
9
|
-
The Tileflow names and marks are not licensed under the Apache License 2.0. See TRADEMARKS.md.
|
package/TRADEMARKS.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Tileflow trademarks
|
|
2
|
-
|
|
3
|
-
The Apache License, Version 2.0, and the Tileflow generated-output grant do not grant permission to
|
|
4
|
-
use the Tileflow name, `tileflow.dev`, logos, service marks, product names, or other Tileflow brand
|
|
5
|
-
features except for reasonable and customary use that truthfully describes the origin of the SDK or
|
|
6
|
-
compatibility with Tileflow, and for reproducing required notices.
|
|
7
|
-
|
|
8
|
-
You may not use Tileflow brand features in a way that suggests sponsorship, endorsement, or an
|
|
9
|
-
official Tileflow product when none exists. Third-party names and marks remain the property of their
|
|
10
|
-
respective owners.
|