@tileflow/svelte 0.1.0-alpha.17 → 0.1.0-alpha.19
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 +4 -0
- package/package.json +2 -2
- package/src/TileflowMap.svelte +9 -7
- package/src/index.d.ts +0 -1
package/README.md
CHANGED
|
@@ -26,6 +26,10 @@ Tileflow resolves from the map name, manifest, or explicit style props. Direct
|
|
|
26
26
|
Tileflow props such as `center`, `zoom`, and `interactive` take priority when
|
|
27
27
|
provided.
|
|
28
28
|
|
|
29
|
+
Hosted maps automatically preflight a short-lived commercial session grant before eligible
|
|
30
|
+
resources. Setting `analytics={{enabled: false}}` disables the optional beacon only; it does not
|
|
31
|
+
remove hosted authorization or override a user `mapOptions.transformRequest` callback.
|
|
32
|
+
|
|
29
33
|
## Headless capture readiness
|
|
30
34
|
|
|
31
35
|
Use `captureId` to disambiguate repeated named maps:
|
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.19",
|
|
4
4
|
"description": "Svelte component for rendering Tileflow maps with MapLibre.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@tileflow/core": ">=0.1.0-alpha.
|
|
45
|
+
"@tileflow/core": ">=0.1.0-alpha.19 <0.1.0-beta.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"maplibre-gl": ">=5",
|
package/src/TileflowMap.svelte
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
} from 'maplibre-gl';
|
|
8
8
|
import {createEventDispatcher, onMount, tick} from 'svelte';
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
createTileflowSessionController,
|
|
11
11
|
defaultTileflowManifestUrl,
|
|
12
12
|
loadTileflowManifest,
|
|
13
13
|
mergeTileflowAnalytics,
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
export let styleBaseUrl: string | undefined = undefined;
|
|
59
59
|
export let styleUrl: string | undefined = undefined;
|
|
60
60
|
export let themes: TileflowProjectThemes | undefined = undefined;
|
|
61
|
-
export let tileBaseUrl: string | undefined = undefined;
|
|
62
61
|
export let zoom: number | undefined = undefined;
|
|
63
62
|
|
|
64
63
|
let container: HTMLDivElement;
|
|
@@ -75,8 +74,6 @@
|
|
|
75
74
|
let readinessRunId = 0;
|
|
76
75
|
|
|
77
76
|
const dispatch = createEventDispatcher<{load: MapLibreMap}>();
|
|
78
|
-
const sessionId = createTileflowSessionId();
|
|
79
|
-
const sessionStarter = createTileflowSessionStarter({sessionId, source: 'svelte'});
|
|
80
77
|
const markerController = createTileflowMarkerController<
|
|
81
78
|
MapLibreMap,
|
|
82
79
|
TileflowMapMarker,
|
|
@@ -112,7 +109,6 @@
|
|
|
112
109
|
styleBaseUrl,
|
|
113
110
|
styleUrl,
|
|
114
111
|
themes,
|
|
115
|
-
tileBaseUrl,
|
|
116
112
|
});
|
|
117
113
|
$: resolvedAnalytics = mergeTileflowAnalytics(analytics, runtimeStyle?.analytics);
|
|
118
114
|
$: runtimeImageUrl =
|
|
@@ -140,7 +136,6 @@
|
|
|
140
136
|
styleBaseUrl;
|
|
141
137
|
styleUrl;
|
|
142
138
|
themes;
|
|
143
|
-
tileBaseUrl;
|
|
144
139
|
void refresh();
|
|
145
140
|
}
|
|
146
141
|
|
|
@@ -270,6 +265,12 @@
|
|
|
270
265
|
}
|
|
271
266
|
|
|
272
267
|
const runtime = runtimeStyle;
|
|
268
|
+
const session = createTileflowSessionController({source: 'svelte'});
|
|
269
|
+
const sessionStarter = createTileflowSessionStarter({
|
|
270
|
+
getSessionId: () => session.sessionId,
|
|
271
|
+
sessionId: session.sessionId,
|
|
272
|
+
source: 'svelte',
|
|
273
|
+
});
|
|
273
274
|
const maplibreMap = new maplibregl.Map({
|
|
274
275
|
...mapOptions,
|
|
275
276
|
attributionControl: mapOptions?.attributionControl ?? {compact: true},
|
|
@@ -281,7 +282,8 @@
|
|
|
281
282
|
always: true,
|
|
282
283
|
asyncAnalyticsTiming: 'request',
|
|
283
284
|
getAnalytics: () => resolvedAnalytics,
|
|
284
|
-
|
|
285
|
+
sessionController: session,
|
|
286
|
+
sessionId: session.sessionId,
|
|
285
287
|
transformRequest: mapOptions?.transformRequest ?? undefined,
|
|
286
288
|
}),
|
|
287
289
|
zoom: resolvedZoom,
|