@tileflow/react 0.1.0-alpha.22 → 0.1.0-alpha.24
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 +18 -2
- package/dist/index.d.ts +7 -1
- package/dist/index.js +23 -3
- package/package.json +7 -10
- package/GENERATED_OUTPUT_LICENSE.md +0 -21
- package/NOTICE +0 -9
- package/TRADEMARKS.md +0 -10
package/README.md
CHANGED
|
@@ -24,6 +24,22 @@ export function App() {
|
|
|
24
24
|
}
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
## MapLibre 6 worker
|
|
28
|
+
|
|
29
|
+
With MapLibre GL JS 6, configure the application-owned worker once before mounting an interactive
|
|
30
|
+
map. The worker URL must come from the same `maplibre-gl` package installed by the application.
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import {configureTileflowMapLibre} from '@tileflow/react';
|
|
34
|
+
import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url';
|
|
35
|
+
|
|
36
|
+
configureTileflowMapLibre({workerUrl});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This is the Vite setup. Call it in the client entry before rendering `Map`; `mode="image"` remains
|
|
40
|
+
MapLibre-free. MapLibre GL JS 6.4.1-6.x is supported. Use the `@tileflow/next` or
|
|
41
|
+
`@tileflow/webpack` README for their worker-delivery recipes.
|
|
42
|
+
|
|
27
43
|
## Annotations, tooltips, and popups
|
|
28
44
|
|
|
29
45
|
Use `annotations` for small application-owned marker sets. Annotation data is serializable, while
|
|
@@ -278,8 +294,8 @@ application scenes and requires exactly one target.
|
|
|
278
294
|
|
|
279
295
|
## Compatibility
|
|
280
296
|
|
|
281
|
-
The supported peer window is React 18-19 and MapLibre GL JS
|
|
282
|
-
the exact lower bound and the
|
|
297
|
+
The supported peer window is React 18-19 and MapLibre GL JS 6.4.1-6.x. Compatibility smoke tests
|
|
298
|
+
install the exact lower bound and the selected current release from packed Tileflow tarballs,
|
|
283
299
|
typecheck a consumer, and render the image/SSR path while rejecting any MapLibre import. Future
|
|
284
300
|
majors stay outside the peer range until that matrix passes.
|
|
285
301
|
|
package/dist/index.d.ts
CHANGED
|
@@ -69,4 +69,10 @@ type MapImageProps = MapSharedProps & {
|
|
|
69
69
|
type MapProps<TAnnotation extends TileflowAnnotation = TileflowAnnotation> = (MapInteractiveProps<TAnnotation> | MapImageProps) & TileflowMapStyleSourceProps;
|
|
70
70
|
declare function Map<TAnnotation extends TileflowAnnotation = TileflowAnnotation>(props: MapProps<TAnnotation>): react.JSX.Element;
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
type TileflowMapLibreConfiguration = Readonly<{
|
|
73
|
+
workerUrl: string;
|
|
74
|
+
}>;
|
|
75
|
+
/** Configure the application-owned worker before mounting an interactive Tileflow map. */
|
|
76
|
+
declare function configureTileflowMapLibre(configuration: TileflowMapLibreConfiguration): void;
|
|
77
|
+
|
|
78
|
+
export { Map, type MapProps, type TileflowAnnotationRenderer, type TileflowInteractionRenderer, type TileflowMapLibreConfiguration, type TileflowMapOptions, type TileflowMapSource, configureTileflowMapLibre };
|
package/dist/index.js
CHANGED
|
@@ -189,8 +189,21 @@ function assertTileflowMapStyleInputs(input) {
|
|
|
189
189
|
|
|
190
190
|
// src/maplibre.ts
|
|
191
191
|
var mapLibrePromise;
|
|
192
|
+
var mapLibre;
|
|
193
|
+
var workerUrl;
|
|
194
|
+
function configureTileflowMapLibre(configuration) {
|
|
195
|
+
const nextWorkerUrl = configuration.workerUrl;
|
|
196
|
+
if (typeof nextWorkerUrl !== "string" || nextWorkerUrl.trim().length === 0) {
|
|
197
|
+
throw new TypeError("Tileflow MapLibre workerUrl must be a non-empty string.");
|
|
198
|
+
}
|
|
199
|
+
if (workerUrl !== void 0 && workerUrl !== nextWorkerUrl) {
|
|
200
|
+
throw new Error("Tileflow MapLibre workerUrl is already configured.");
|
|
201
|
+
}
|
|
202
|
+
workerUrl = nextWorkerUrl;
|
|
203
|
+
mapLibre?.setWorkerUrl(nextWorkerUrl);
|
|
204
|
+
}
|
|
192
205
|
function loadTileflowMapLibre() {
|
|
193
|
-
mapLibrePromise ??= import("maplibre-gl").then(resolveMapLibreModule).catch((error) => {
|
|
206
|
+
mapLibrePromise ??= import("maplibre-gl").then(resolveMapLibreModule).then(configureTileflowMapLibreModule).catch((error) => {
|
|
194
207
|
mapLibrePromise = void 0;
|
|
195
208
|
throw error;
|
|
196
209
|
});
|
|
@@ -200,6 +213,11 @@ function resolveMapLibreModule(module) {
|
|
|
200
213
|
const defaultExport = module.default;
|
|
201
214
|
return defaultExport ?? module;
|
|
202
215
|
}
|
|
216
|
+
function configureTileflowMapLibreModule(maplibregl) {
|
|
217
|
+
if (workerUrl !== void 0) maplibregl.setWorkerUrl(workerUrl);
|
|
218
|
+
mapLibre = maplibregl;
|
|
219
|
+
return maplibregl;
|
|
220
|
+
}
|
|
203
221
|
|
|
204
222
|
// src/map.tsx
|
|
205
223
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1218,10 +1236,11 @@ function wrapMapLibrePositioned(positioned) {
|
|
|
1218
1236
|
};
|
|
1219
1237
|
}
|
|
1220
1238
|
function createTileflowMapLibrePoiMap(map) {
|
|
1239
|
+
const poiMap = map;
|
|
1221
1240
|
return {
|
|
1222
1241
|
getStyle: () => map.getStyle(),
|
|
1223
1242
|
on(event, listener) {
|
|
1224
|
-
return
|
|
1243
|
+
return poiMap.on(event, listener);
|
|
1225
1244
|
},
|
|
1226
1245
|
queryRenderedFeatures(point, options) {
|
|
1227
1246
|
return map.queryRenderedFeatures(point, {
|
|
@@ -1298,5 +1317,6 @@ function isPlainObject(value) {
|
|
|
1298
1317
|
return prototype === Object.prototype || prototype === null;
|
|
1299
1318
|
}
|
|
1300
1319
|
export {
|
|
1301
|
-
Map2 as Map
|
|
1320
|
+
Map2 as Map,
|
|
1321
|
+
configureTileflowMapLibre
|
|
1302
1322
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tileflow/react",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.24",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "React components for rendering Tileflow maps with MapLibre.",
|
|
6
6
|
"type": "module",
|
|
@@ -25,10 +25,7 @@
|
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
26
|
"files": [
|
|
27
27
|
"dist",
|
|
28
|
-
"LICENSE"
|
|
29
|
-
"NOTICE",
|
|
30
|
-
"GENERATED_OUTPUT_LICENSE.md",
|
|
31
|
-
"TRADEMARKS.md"
|
|
28
|
+
"LICENSE"
|
|
32
29
|
],
|
|
33
30
|
"exports": {
|
|
34
31
|
".": {
|
|
@@ -46,19 +43,19 @@
|
|
|
46
43
|
"access": "public"
|
|
47
44
|
},
|
|
48
45
|
"dependencies": {
|
|
49
|
-
"@tileflow/core": ">=0.1.0-alpha.
|
|
50
|
-
"@tileflow/interactions": ">=0.1.0-alpha.
|
|
51
|
-
"@tileflow/static": ">=0.1.0-alpha.
|
|
46
|
+
"@tileflow/core": ">=0.1.0-alpha.24 <0.1.0-beta.0",
|
|
47
|
+
"@tileflow/interactions": ">=0.1.0-alpha.3 <0.1.0-beta.0",
|
|
48
|
+
"@tileflow/static": ">=0.1.0-alpha.24 <0.1.0-beta.0"
|
|
52
49
|
},
|
|
53
50
|
"peerDependencies": {
|
|
54
|
-
"maplibre-gl": ">=
|
|
51
|
+
"maplibre-gl": ">=6.4.1 <7",
|
|
55
52
|
"react": ">=18 <20",
|
|
56
53
|
"react-dom": ">=18 <20"
|
|
57
54
|
},
|
|
58
55
|
"devDependencies": {
|
|
59
56
|
"@types/react": "^19.2.17",
|
|
60
57
|
"@types/react-dom": "^19.2.3",
|
|
61
|
-
"maplibre-gl": "
|
|
58
|
+
"maplibre-gl": "6.9.0",
|
|
62
59
|
"react": "^19.2.7",
|
|
63
60
|
"react-dom": "^19.2.7"
|
|
64
61
|
},
|
|
@@ -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.
|