@tileflow/vue 0.1.0-alpha.28 → 0.1.0-alpha.30

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 CHANGED
@@ -88,12 +88,25 @@ Omitting `theme` uses `defaultTheme`. `system` needs the map's explicit light/da
88
88
  Streets supplies. Switching themes preserves the map, camera, and interactions, with rollback on
89
89
  failure. Listen to `themeChange` for transitions.
90
90
 
91
+ Add `time-of-day="dusk"` beside `theme` to select a map's optional `day`, `dawn`, `dusk`, or
92
+ `night` preset. For Streets, `theme="light"` with this preset selects the existing `dusk` palette.
93
+ Maps without this capability ignore the option; omitting it keeps the selected theme unchanged.
94
+ Changing it uses the existing theme transition. `themeBlend` takes precedence. See the
95
+ [authoring contract](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/README.md#style-with-themes-and-semantic-modules).
96
+
91
97
  `:theme-transition="{duration: 450}"` cross-fades theme changes over that many milliseconds.
92
98
  `:theme-blend="{themes: ['night', 'dusk', 'day'], position}"` shows a continuous blend of the
93
99
  map's themes instead of `theme`: position 0 is the first theme and 1.5 is halfway from the second to
94
100
  the third. Moving the position updates the map at once. See
95
101
  [theme transitions and blends](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/docs/theme-transitions-and-blends.md).
96
102
 
103
+ Interactive maps automatically render the map's vegetation. `vegetation` overrides visibility
104
+ (omitting it uses the map default); false hides models and flat artwork alike. `viewMode` is `2d`
105
+ by default and may be `3d`: only maps with `vegetation.mode: 'auto'` switch representation.
106
+ Streets uses model trees in either view. Changing either prop updates the existing map immediately.
107
+ These props do not change camera pitch, buildings or lighting and do not apply in image mode. See
108
+ [vegetation controls](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/docs/trees-3d.md#visibility-and-representation).
109
+
97
110
  `mapOptions` accepts native MapLibre options except `container` and `style`. Direct props take
98
111
  priority over those options, then the published view, then shared defaults. `TileflowMap` always
99
112
  selects a Tileflow map through its manifest; it has no renderer discriminator or direct-style mode.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  import { MapOptions, Map } from 'maplibre-gl';
2
2
  import { DefineComponent, VNodeChild } from 'vue';
3
- import { TileflowBrowserThemeBlendSelection, TileflowThemeTransitionOptions, TileflowThemeTransition } from '@tileflow/core/browser';
4
- import { TileflowRuntimeSource, TileflowThemeSelection, TileflowAnalytics } from '@tileflow/core/runtime';
3
+ import { TileflowBrowserThemeBlendSelection, TileflowThemeTransitionOptions, TileflowViewMode, TileflowThemeTransition } from '@tileflow/core/browser';
4
+ import { TileflowRuntimeSource, TileflowThemeSelection, TileflowTimeOfDay, TileflowAnalytics } from '@tileflow/core/runtime';
5
5
  import { TileflowAnnotation, TileflowInteractionJsonValue, TileflowInteractionState, TileflowInteractionBinding, TileflowInteractionDiagnostic, TileflowInteractionEvent, TileflowAnnotationViewContext, TileflowInteractionViewContext } from '@tileflow/interactions';
6
6
 
7
7
  type TileflowMapStyleSourceProps = {
8
8
  source: TileflowRuntimeSource;
9
9
  theme?: TileflowThemeSelection;
10
+ /** Optional artistic preset; ignored by maps without this capability. */
11
+ timeOfDay?: TileflowTimeOfDay;
10
12
  /**
11
13
  * Shows a continuous blend of the map's themes instead of `theme`. Moving `position` changes the
12
14
  * map at once; changing `themes` prepares a new blend. `hold` keeps labels, icons, and mixed
@@ -34,6 +36,8 @@ type TileflowMapSlots<TAnnotation extends TileflowAnnotation = TileflowAnnotatio
34
36
  tooltip?: (context: TileflowMapInteractionSlotContext<TAnnotation>) => VNodeChild;
35
37
  };
36
38
  type TileflowMapSharedProps = {
39
+ vegetation?: boolean;
40
+ viewMode?: TileflowViewMode;
37
41
  alt?: string;
38
42
  analytics?: TileflowAnalytics;
39
43
  center?: [number, number];
package/dist/index.js CHANGED
@@ -17,8 +17,10 @@ import {
17
17
  attachTileflowAtmosphere,
18
18
  attachTileflowFairUseNotice,
19
19
  attachTileflowMapLifecycle,
20
+ attachTileflowNotices,
20
21
  createTileflowSessionStarter,
21
22
  createTileflowThemeController,
23
+ createTileflowVegetation,
22
24
  createTileflowTransformRequest,
23
25
  getTileflowSystemColorScheme,
24
26
  loadTileflowStyleFonts,
@@ -163,6 +165,7 @@ import {
163
165
  validateTileflowBrowserThemeBlendSelection
164
166
  } from "@tileflow/core/browser";
165
167
  import {
168
+ isTileflowTimeOfDay,
166
169
  validateTileflowRuntimeSource,
167
170
  validateTileflowThemeSelection
168
171
  } from "@tileflow/core/runtime";
@@ -172,6 +175,9 @@ function validateTileflowMapStyleInputs(input) {
172
175
  if (input.theme !== void 0 && !validateTileflowThemeSelection(input.theme)) {
173
176
  return { error: 'theme must be a concrete portable theme name or "system"', ok: false };
174
177
  }
178
+ if (input.timeOfDay !== void 0 && !isTileflowTimeOfDay(input.timeOfDay)) {
179
+ return { error: "timeOfDay must be day, dawn, dusk, or night", ok: false };
180
+ }
175
181
  if (input.themeBlend !== void 0 && !validateTileflowBrowserThemeBlendSelection(input.themeBlend)) {
176
182
  return {
177
183
  error: "themeBlend must name two to eight concrete themes, a position from 0 to themes.length - 1, and an optional boolean hold",
@@ -238,7 +244,10 @@ var TileflowMap = defineComponent({
238
244
  required: true,
239
245
  type: Object
240
246
  },
247
+ vegetation: { type: Boolean, default: void 0 },
248
+ viewMode: { type: String, default: "2d" },
241
249
  theme: String,
250
+ timeOfDay: String,
242
251
  themeBlend: Object,
243
252
  themeTransition: Object,
244
253
  zoom: Number
@@ -288,6 +297,7 @@ var TileflowMap = defineComponent({
288
297
  let mapLifecycle = null;
289
298
  let mapResizeObserver = null;
290
299
  let mapWorldRequestBridge = null;
300
+ let vegetationController = null;
291
301
  let themeController = null;
292
302
  let unsubscribeSystemColorScheme = null;
293
303
  let mapLoadId = 0;
@@ -377,7 +387,12 @@ var TileflowMap = defineComponent({
377
387
  }
378
388
  return {
379
389
  error: false,
380
- name: resolveTileflowRuntimeTheme(manifestMap.value, selection, systemColorScheme.value).name
390
+ name: resolveTileflowRuntimeTheme(
391
+ manifestMap.value,
392
+ selection,
393
+ systemColorScheme.value,
394
+ props.themeBlend ? void 0 : props.timeOfDay
395
+ ).name
381
396
  };
382
397
  } catch {
383
398
  return { error: true, name: void 0 };
@@ -559,6 +574,7 @@ var TileflowMap = defineComponent({
559
574
  assertTileflowMapStyleInputs({
560
575
  source: props.source,
561
576
  theme: props.theme,
577
+ timeOfDay: props.timeOfDay,
562
578
  themeBlend: props.themeBlend,
563
579
  themeTransition: props.themeTransition
564
580
  });
@@ -612,6 +628,13 @@ var TileflowMap = defineComponent({
612
628
  imageResizeObserver.observe(element);
613
629
  updateImageSize();
614
630
  };
631
+ watch(
632
+ () => [props.vegetation, props.viewMode],
633
+ ([visible, viewMode]) => {
634
+ vegetationController?.setVisible(visible);
635
+ vegetationController?.setViewMode(viewMode ?? "2d");
636
+ }
637
+ );
615
638
  const destroyMap = () => {
616
639
  mapLoadId += 1;
617
640
  readinessRunId += 1;
@@ -621,6 +644,8 @@ var TileflowMap = defineComponent({
621
644
  const resizeObserver = mapResizeObserver;
622
645
  const map = mapRef.value;
623
646
  const controller = themeController;
647
+ const vegetation = vegetationController;
648
+ vegetationController = null;
624
649
  const annotationInteractionsForMap = annotationRuntime;
625
650
  const semanticInteractionsForMap = semanticRuntime;
626
651
  const worldRequestBridge = mapWorldRequestBridge;
@@ -638,6 +663,7 @@ var TileflowMap = defineComponent({
638
663
  () => worldRequestBridge?.dispose(),
639
664
  () => fairUseNotice?.dispose(),
640
665
  () => lifecycle?.dispose(),
666
+ () => vegetation?.dispose(),
641
667
  () => controller?.dispose(),
642
668
  () => resizeObserver?.disconnect(),
643
669
  () => map?.remove()
@@ -788,6 +814,7 @@ var TileflowMap = defineComponent({
788
814
  });
789
815
  mapRef.value = map;
790
816
  attachTileflowAtmosphere(map);
817
+ attachTileflowNotices(map);
791
818
  themeController = runtime.theme === void 0 ? null : createTileflowThemeController({
792
819
  initial: runtime,
793
820
  map,
@@ -802,6 +829,21 @@ var TileflowMap = defineComponent({
802
829
  }
803
830
  }
804
831
  });
832
+ vegetationController = createTileflowVegetation({
833
+ map,
834
+ ...themeController ? { controller: themeController } : {},
835
+ visible: props.vegetation,
836
+ viewMode: props.viewMode ?? "2d",
837
+ transformRequest: createTileflowTransformRequest({
838
+ getAnalytics: () => resolvedAnalytics.value,
839
+ sessionController: session,
840
+ sessionId: session.sessionId,
841
+ transformRequest: (url) => props.mapOptions?.transformRequest?.(
842
+ url,
843
+ "Tile"
844
+ )
845
+ })
846
+ });
805
847
  try {
806
848
  const mapInteractions = createTileflowMapLibreDomRuntime({
807
849
  createMarker({ annotation, element }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tileflow/vue",
3
- "version": "0.1.0-alpha.28",
3
+ "version": "0.1.0-alpha.30",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Vue component for rendering Tileflow maps with MapLibre.",
6
6
  "type": "module",
@@ -38,8 +38,8 @@
38
38
  "access": "public"
39
39
  },
40
40
  "dependencies": {
41
- "@tileflow/core": ">=0.1.0-alpha.32 <0.1.0-beta.0",
42
- "@tileflow/interactions": ">=0.1.0-alpha.4 <0.1.0-beta.0"
41
+ "@tileflow/core": ">=0.1.0-alpha.37 <0.1.0-beta.0",
42
+ "@tileflow/interactions": ">=0.1.0-alpha.5 <0.1.0-beta.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "maplibre-gl": ">=6.4.1 <7",
@@ -48,7 +48,7 @@
48
48
  "devDependencies": {
49
49
  "@vue/server-renderer": "3.5.43",
50
50
  "maplibre-gl": "6.13.0",
51
- "tsx": "^4.23.12",
51
+ "tsx": "^4.23.15",
52
52
  "vue": "^3.5.43"
53
53
  },
54
54
  "scripts": {