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

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.
Files changed (3) hide show
  1. package/README.md +15 -6
  2. package/dist/index.js +24 -12
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -100,16 +100,25 @@ map's themes instead of `theme`: position 0 is the first theme and 1.5 is halfwa
100
100
  the third. Moving the position updates the map at once. See
101
101
  [theme transitions and blends](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/docs/theme-transitions-and-blends.md).
102
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).
103
+ Interactive maps show the 3D scene their style declares by default: buildings with Tileflow
104
+ landmarks and the map's Team building models, 3D trees, and street lights where the map enables
105
+ them. The 3D renderers load only when the style declares a scene, so 2D maps do not download them.
106
+ `viewMode` is `3d` by default; `view-mode="2d"` opts out, mounting no 3D buildings or street lights, and
107
+ draws vegetation as the map's policy sets for the 2D view (Streets keeps its model trees in either
108
+ view). `vegetation` overrides vegetation visibility (omitting it uses the map default); `:vegetation="false"`
109
+ hides models and flat artwork alike. Changing either prop updates the existing map immediately.
110
+ They do not change camera pitch and do not apply in image mode. See
111
+ [the map's 3D scene](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/docs/buildings-3d.md#the-maps-3d-scene)
112
+ and [vegetation controls](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/docs/trees-3d.md#visibility-and-representation).
109
113
 
110
114
  `mapOptions` accepts native MapLibre options except `container` and `style`. Direct props take
111
115
  priority over those options, then the published view, then shared defaults. `TileflowMap` always
112
116
  selects a Tileflow map through its manifest; it has no renderer discriminator or direct-style mode.
117
+ Tileflow's styles are validated when they are compiled, so `validateStyle` defaults to `false`; pass
118
+ `true` to validate them again in the browser.
119
+ The map canvas is multisampled by default (`canvasContextAttributes.antialias` is `true`) so the
120
+ thin edges of 3D models stay continuous; other context attributes you pass are kept, and
121
+ `canvasContextAttributes: {antialias: false}` trades that smoothing for lower GPU cost.
113
122
  The obsolete source fields `kind` and `style` are rejected. For a completely unmanaged map, use
114
123
  `maplibre-gl` directly rather than a Tileflow component.
115
124
 
package/dist/index.js CHANGED
@@ -16,18 +16,21 @@ import {
16
16
  import {
17
17
  attachTileflowAtmosphere,
18
18
  attachTileflowFairUseNotice,
19
+ attachTileflowMap3D,
19
20
  attachTileflowMapLifecycle,
21
+ attachTileflowNauticalLights,
20
22
  attachTileflowNotices,
21
23
  createTileflowSessionStarter,
22
24
  createTileflowThemeController,
23
- createTileflowVegetation,
24
25
  createTileflowTransformRequest,
25
26
  getTileflowSystemColorScheme,
26
27
  loadTileflowStyleFonts,
27
28
  registerTileflowContourProtocol,
28
29
  registerTileflowPmtilesProtocol,
29
30
  registerTileflowWorldRequestBridge,
30
- subscribeTileflowSystemColorScheme
31
+ subscribeTileflowSystemColorScheme,
32
+ tileflowMaxPitch,
33
+ tileflowCanvasContextAttributes
31
34
  } from "@tileflow/core/browser";
32
35
  import { normalizeTileflowCaptureId } from "@tileflow/core/capture";
33
36
  import {
@@ -245,7 +248,7 @@ var TileflowMap = defineComponent({
245
248
  type: Object
246
249
  },
247
250
  vegetation: { type: Boolean, default: void 0 },
248
- viewMode: { type: String, default: "2d" },
251
+ viewMode: { type: String, default: "3d" },
249
252
  theme: String,
250
253
  timeOfDay: String,
251
254
  themeBlend: Object,
@@ -297,7 +300,7 @@ var TileflowMap = defineComponent({
297
300
  let mapLifecycle = null;
298
301
  let mapResizeObserver = null;
299
302
  let mapWorldRequestBridge = null;
300
- let vegetationController = null;
303
+ let sceneAttachment = null;
301
304
  let themeController = null;
302
305
  let unsubscribeSystemColorScheme = null;
303
306
  let mapLoadId = 0;
@@ -631,8 +634,8 @@ var TileflowMap = defineComponent({
631
634
  watch(
632
635
  () => [props.vegetation, props.viewMode],
633
636
  ([visible, viewMode]) => {
634
- vegetationController?.setVisible(visible);
635
- vegetationController?.setViewMode(viewMode ?? "2d");
637
+ sceneAttachment?.setVegetation(visible);
638
+ sceneAttachment?.setViewMode(viewMode ?? "3d");
636
639
  }
637
640
  );
638
641
  const destroyMap = () => {
@@ -644,8 +647,8 @@ var TileflowMap = defineComponent({
644
647
  const resizeObserver = mapResizeObserver;
645
648
  const map = mapRef.value;
646
649
  const controller = themeController;
647
- const vegetation = vegetationController;
648
- vegetationController = null;
650
+ const scene = sceneAttachment;
651
+ sceneAttachment = null;
649
652
  const annotationInteractionsForMap = annotationRuntime;
650
653
  const semanticInteractionsForMap = semanticRuntime;
651
654
  const worldRequestBridge = mapWorldRequestBridge;
@@ -663,7 +666,7 @@ var TileflowMap = defineComponent({
663
666
  () => worldRequestBridge?.dispose(),
664
667
  () => fairUseNotice?.dispose(),
665
668
  () => lifecycle?.dispose(),
666
- () => vegetation?.dispose(),
669
+ () => scene?.dispose(),
667
670
  () => controller?.dispose(),
668
671
  () => resizeObserver?.disconnect(),
669
672
  () => map?.remove()
@@ -794,9 +797,15 @@ var TileflowMap = defineComponent({
794
797
  });
795
798
  const map = new maplibregl.Map({
796
799
  ...props.mapOptions,
800
+ canvasContextAttributes: tileflowCanvasContextAttributes(
801
+ props.mapOptions?.canvasContextAttributes
802
+ ),
797
803
  attributionControl: props.mapOptions?.attributionControl ?? {
798
804
  compact: true
799
805
  },
806
+ // Tileflow's compiled styles are validated when they are built.
807
+ validateStyle: props.mapOptions?.validateStyle ?? false,
808
+ maxPitch: props.mapOptions?.maxPitch ?? tileflowMaxPitch,
800
809
  bearing: resolvedBearing.value,
801
810
  center: resolvedCenter.value,
802
811
  container,
@@ -815,6 +824,7 @@ var TileflowMap = defineComponent({
815
824
  mapRef.value = map;
816
825
  attachTileflowAtmosphere(map);
817
826
  attachTileflowNotices(map);
827
+ attachTileflowNauticalLights(map);
818
828
  themeController = runtime.theme === void 0 ? null : createTileflowThemeController({
819
829
  initial: runtime,
820
830
  map,
@@ -829,11 +839,13 @@ var TileflowMap = defineComponent({
829
839
  }
830
840
  }
831
841
  });
832
- vegetationController = createTileflowVegetation({
842
+ sceneAttachment = attachTileflowMap3D({
833
843
  map,
834
844
  ...themeController ? { controller: themeController } : {},
835
- visible: props.vegetation,
836
- viewMode: props.viewMode ?? "2d",
845
+ vegetation: props.vegetation,
846
+ viewMode: props.viewMode ?? "3d",
847
+ load: () => import("@tileflow/core/3d"),
848
+ onError: (error) => console.error("Failed to load the Tileflow 3D scene", error),
837
849
  transformRequest: createTileflowTransformRequest({
838
850
  getAnalytics: () => resolvedAnalytics.value,
839
851
  sessionController: session,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tileflow/vue",
3
- "version": "0.1.0-alpha.30",
3
+ "version": "0.1.0-alpha.32",
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.37 <0.1.0-beta.0",
42
- "@tileflow/interactions": ">=0.1.0-alpha.5 <0.1.0-beta.0"
41
+ "@tileflow/core": ">=0.1.0-alpha.39 <0.1.0-beta.0",
42
+ "@tileflow/interactions": ">=0.1.0-alpha.6 <0.1.0-beta.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "maplibre-gl": ">=6.4.1 <7",