@tileflow/core 0.1.0-alpha.31 → 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.
- package/README.md +8 -1
- package/dist/browser.d.ts +120 -16
- package/dist/browser.js +457 -38
- package/dist/build.d.ts +62 -55
- package/dist/build.js +82 -53
- package/dist/{capture-scene-D6soWztE.d.ts → capture-scene-BaAJjGq7.d.ts} +11 -1
- package/dist/capture.d.ts +1 -1
- package/dist/capture.js +12 -0
- package/dist/config-reference.json +1411 -1367
- package/dist/{icon-composition-BiOTwrvD.d.ts → icon-composition-Befmn-zZ.d.ts} +40 -32
- package/dist/index.d.ts +11 -11
- package/dist/index.js +84 -53
- package/dist/{manifest-types-CTT2eLbp.d.ts → manifest-types-E7m23eXL.d.ts} +18 -1
- package/dist/manifest.d.ts +2 -2
- package/dist/native-profile.d.ts +25 -11
- package/dist/native-profile.js +21 -1
- package/dist/runtime.d.ts +1 -1
- package/docs/authoring-model.md +5 -4
- package/docs/capture-scenes.md +1 -1
- package/docs/compiled-style-performance.md +4 -1
- package/docs/data-is-separate-from-design.md +103 -9
- package/docs/dynamic-style-images.md +100 -0
- package/docs/native-artifact-profile.md +5 -3
- package/docs/shared-visual-primitives.md +20 -0
- package/docs/style-states.md +73 -0
- package/docs/theme-transitions-and-blends.md +41 -2
- package/package.json +1 -1
package/dist/build.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TileflowCaptureScene } from './capture-scene-
|
|
2
|
-
import { T as TileflowRenderedIconIdentity, a as TileflowIconCompositionV1, R as ResolvedTileflowMap, b as TileflowDataRequirementsV1, c as TileflowSourceRequirementsV1, d as TileflowMap, e as TileflowStyleOptions, f as TileflowInspectedStyle, g as TileflowPreparedMapAssets } from './icon-composition-
|
|
3
|
-
export { h as TileflowDataCompatibilityIssue, i as TileflowDataFieldRequirement, j as TileflowDataFieldType, k as TileflowDataLayerRequirement, l as TileflowObservedDataContractV1, m as TileflowStyleInspection, n as TileflowStyleInspectionContribution, o as TileflowStyleInspectionLayer, p as TileflowStyleInspectionRenderOperation, q as collectMapLineage, r as inferTileflowDataRequirements, s as inferTileflowSourceRequirements, t as tileflowStyleInspectionSchemaVersion, v as validateTileflowDataCompatibility } from './icon-composition-
|
|
4
|
-
import { M as MapLibreStyle, T as TileflowRuntimeManifest } from './manifest-types-
|
|
1
|
+
import { T as TileflowCaptureScene } from './capture-scene-BaAJjGq7.js';
|
|
2
|
+
import { T as TileflowRenderedIconIdentity, a as TileflowIconCompositionV1, R as ResolvedTileflowMap, b as TileflowDataRequirementsV1, c as TileflowSourceRequirementsV1, d as TileflowMap, e as TileflowStyleOptions, f as TileflowInspectedStyle, g as TileflowPreparedMapAssets } from './icon-composition-Befmn-zZ.js';
|
|
3
|
+
export { h as TileflowDataCompatibilityIssue, i as TileflowDataFieldRequirement, j as TileflowDataFieldType, k as TileflowDataLayerRequirement, l as TileflowObservedDataContractV1, m as TileflowStyleInspection, n as TileflowStyleInspectionContribution, o as TileflowStyleInspectionLayer, p as TileflowStyleInspectionRenderOperation, q as collectMapLineage, r as inferTileflowDataRequirements, s as inferTileflowSourceRequirements, t as tileflowStyleInspectionSchemaVersion, v as validateTileflowDataCompatibility } from './icon-composition-Befmn-zZ.js';
|
|
4
|
+
import { M as MapLibreStyle, T as TileflowRuntimeManifest } from './manifest-types-E7m23eXL.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
declare const tileflowMapRevisionSchemaVersion: 1;
|
|
@@ -146,8 +146,8 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
146
146
|
teamSources: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
147
147
|
tileset: z.ZodString;
|
|
148
148
|
type: z.ZodEnum<{
|
|
149
|
-
vector: "vector";
|
|
150
149
|
raster: "raster";
|
|
150
|
+
vector: "vector";
|
|
151
151
|
}>;
|
|
152
152
|
}, z.core.$strict>>;
|
|
153
153
|
view: z.ZodOptional<z.ZodObject<{
|
|
@@ -204,8 +204,8 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
204
204
|
}>;
|
|
205
205
|
id: z.ZodString;
|
|
206
206
|
kind: z.ZodEnum<{
|
|
207
|
-
pattern: "pattern";
|
|
208
207
|
icon: "icon";
|
|
208
|
+
pattern: "pattern";
|
|
209
209
|
}>;
|
|
210
210
|
sha256: z.ZodString;
|
|
211
211
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -259,13 +259,6 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
259
259
|
}, z.core.$strict>], "kind">>;
|
|
260
260
|
winners: z.ZodArray<z.ZodObject<{
|
|
261
261
|
id: z.ZodString;
|
|
262
|
-
width: z.ZodNumber;
|
|
263
|
-
height: z.ZodNumber;
|
|
264
|
-
layout: z.ZodOptional<z.ZodObject<{
|
|
265
|
-
stretchX: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
266
|
-
stretchY: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
267
|
-
content: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
268
|
-
}, z.core.$strict>>;
|
|
269
262
|
appearance: z.ZodOptional<z.ZodObject<{
|
|
270
263
|
representation: z.ZodLiteral<"sdf">;
|
|
271
264
|
defaults: z.ZodObject<{
|
|
@@ -275,6 +268,13 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
275
268
|
haloBlur: z.ZodNumber;
|
|
276
269
|
}, z.core.$strict>;
|
|
277
270
|
}, z.core.$strict>>;
|
|
271
|
+
layout: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
stretchX: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
273
|
+
stretchY: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
274
|
+
content: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
275
|
+
}, z.core.$strict>>;
|
|
276
|
+
width: z.ZodNumber;
|
|
277
|
+
height: z.ZodNumber;
|
|
278
278
|
pixelSha256: z.ZodObject<{
|
|
279
279
|
oneX: z.ZodString;
|
|
280
280
|
twoX: z.ZodString;
|
|
@@ -316,40 +316,6 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
316
316
|
styles: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
317
317
|
}, z.core.$strict>;
|
|
318
318
|
native: z.ZodObject<{
|
|
319
|
-
buildRecord: z.ZodLazy<z.core.$ZodObject<{
|
|
320
|
-
schemaVersion: z.ZodLiteral<2>;
|
|
321
|
-
renderer: z.ZodLiteral<"native">;
|
|
322
|
-
profile: z.ZodLiteral<"native-v1">;
|
|
323
|
-
validation: z.ZodLiteral<"static-artifacts">;
|
|
324
|
-
preparationVersion: z.ZodLiteral<"native-lowering-v1">;
|
|
325
|
-
engines: z.ZodLazy<z.core.$ZodObject<{
|
|
326
|
-
android: z.ZodLiteral<"13.2.0">;
|
|
327
|
-
ios: z.ZodLiteral<"6.26.0">;
|
|
328
|
-
}, z.core.$strict>>;
|
|
329
|
-
buildManifestSha256: z.ZodString;
|
|
330
|
-
transformations: z.ZodArray<z.ZodLazy<z.core.$ZodObject<{
|
|
331
|
-
map: z.ZodString;
|
|
332
|
-
theme: z.ZodString;
|
|
333
|
-
inputStyleSha256: z.ZodString;
|
|
334
|
-
loweredStyleSha256: z.ZodString;
|
|
335
|
-
inputLayers: z.ZodNumber;
|
|
336
|
-
outputLayers: z.ZodNumber;
|
|
337
|
-
projection: z.ZodEnum<{
|
|
338
|
-
none: "none";
|
|
339
|
-
"mercator-to-implicit": "mercator-to-implicit";
|
|
340
|
-
"globe-to-mercator": "globe-to-mercator";
|
|
341
|
-
}>;
|
|
342
|
-
layers: z.ZodArray<z.ZodLazy<z.core.$ZodObject<{
|
|
343
|
-
inputLayer: z.ZodNumber;
|
|
344
|
-
outputStart: z.ZodNumber;
|
|
345
|
-
outputCount: z.ZodNumber;
|
|
346
|
-
properties: z.ZodArray<z.ZodEnum<{
|
|
347
|
-
"line-dasharray": "line-dasharray";
|
|
348
|
-
"line-cap": "line-cap";
|
|
349
|
-
}>>;
|
|
350
|
-
}, z.core.$strict>>>;
|
|
351
|
-
}, z.core.$strict>>>;
|
|
352
|
-
}, z.core.$strict>>;
|
|
353
319
|
buildManifest: z.ZodObject<{
|
|
354
320
|
schemaVersion: z.ZodLiteral<1>;
|
|
355
321
|
maps: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -396,8 +362,8 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
396
362
|
}>;
|
|
397
363
|
id: z.ZodString;
|
|
398
364
|
kind: z.ZodEnum<{
|
|
399
|
-
pattern: "pattern";
|
|
400
365
|
icon: "icon";
|
|
366
|
+
pattern: "pattern";
|
|
401
367
|
}>;
|
|
402
368
|
sha256: z.ZodString;
|
|
403
369
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -451,13 +417,6 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
451
417
|
}, z.core.$strict>], "kind">>;
|
|
452
418
|
winners: z.ZodArray<z.ZodObject<{
|
|
453
419
|
id: z.ZodString;
|
|
454
|
-
width: z.ZodNumber;
|
|
455
|
-
height: z.ZodNumber;
|
|
456
|
-
layout: z.ZodOptional<z.ZodObject<{
|
|
457
|
-
stretchX: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
458
|
-
stretchY: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
459
|
-
content: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
460
|
-
}, z.core.$strict>>;
|
|
461
420
|
appearance: z.ZodOptional<z.ZodObject<{
|
|
462
421
|
representation: z.ZodLiteral<"sdf">;
|
|
463
422
|
defaults: z.ZodObject<{
|
|
@@ -467,6 +426,13 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
467
426
|
haloBlur: z.ZodNumber;
|
|
468
427
|
}, z.core.$strict>;
|
|
469
428
|
}, z.core.$strict>>;
|
|
429
|
+
layout: z.ZodOptional<z.ZodObject<{
|
|
430
|
+
stretchX: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
431
|
+
stretchY: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
432
|
+
content: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
433
|
+
}, z.core.$strict>>;
|
|
434
|
+
width: z.ZodNumber;
|
|
435
|
+
height: z.ZodNumber;
|
|
470
436
|
pixelSha256: z.ZodObject<{
|
|
471
437
|
oneX: z.ZodString;
|
|
472
438
|
twoX: z.ZodString;
|
|
@@ -506,6 +472,47 @@ declare const tileflowRendererDeploymentArtifactSchema: z.ZodObject<{
|
|
|
506
472
|
}, z.core.$strict>>;
|
|
507
473
|
}, z.core.$strict>;
|
|
508
474
|
styles: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
475
|
+
buildRecord: z.ZodLazy<z.core.$ZodObject<{
|
|
476
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
477
|
+
renderer: z.ZodLiteral<"native">;
|
|
478
|
+
profile: z.ZodLiteral<"native-v1">;
|
|
479
|
+
validation: z.ZodLiteral<"static-artifacts">;
|
|
480
|
+
preparationVersion: z.ZodLiteral<"native-lowering-v1">;
|
|
481
|
+
engines: z.ZodLazy<z.core.$ZodObject<{
|
|
482
|
+
android: z.ZodLiteral<"13.2.0">;
|
|
483
|
+
ios: z.ZodLiteral<"6.26.0">;
|
|
484
|
+
}, z.core.$strict>>;
|
|
485
|
+
buildManifestSha256: z.ZodString;
|
|
486
|
+
transformations: z.ZodArray<z.ZodLazy<z.core.$ZodObject<{
|
|
487
|
+
map: z.ZodString;
|
|
488
|
+
theme: z.ZodString;
|
|
489
|
+
inputStyleSha256: z.ZodString;
|
|
490
|
+
loweredStyleSha256: z.ZodString;
|
|
491
|
+
inputLayers: z.ZodNumber;
|
|
492
|
+
outputLayers: z.ZodNumber;
|
|
493
|
+
projection: z.ZodEnum<{
|
|
494
|
+
"globe-to-mercator": "globe-to-mercator";
|
|
495
|
+
"mercator-to-implicit": "mercator-to-implicit";
|
|
496
|
+
none: "none";
|
|
497
|
+
}>;
|
|
498
|
+
layers: z.ZodArray<z.ZodLazy<z.core.$ZodObject<{
|
|
499
|
+
inputLayer: z.ZodNumber;
|
|
500
|
+
outputStart: z.ZodNumber;
|
|
501
|
+
outputCount: z.ZodNumber;
|
|
502
|
+
properties: z.ZodArray<z.ZodEnum<{
|
|
503
|
+
"line-cap": "line-cap";
|
|
504
|
+
"line-dasharray": "line-dasharray";
|
|
505
|
+
}>>;
|
|
506
|
+
}, z.core.$strict>>>;
|
|
507
|
+
symbolOverlap: z.ZodArray<z.ZodLazy<z.core.$ZodObject<{
|
|
508
|
+
inputLayer: z.ZodNumber;
|
|
509
|
+
properties: z.ZodArray<z.ZodEnum<{
|
|
510
|
+
"icon-overlap": "icon-overlap";
|
|
511
|
+
"text-overlap": "text-overlap";
|
|
512
|
+
}>>;
|
|
513
|
+
}, z.core.$strict>>>;
|
|
514
|
+
}, z.core.$strict>>>;
|
|
515
|
+
}, z.core.$strict>>;
|
|
509
516
|
}, z.core.$strict>;
|
|
510
517
|
}, z.core.$strict>;
|
|
511
518
|
}, z.core.$strict>;
|
package/dist/build.js
CHANGED
|
@@ -72,6 +72,7 @@ var canonicalLayers = {
|
|
|
72
72
|
boundary: "boundary",
|
|
73
73
|
building: "building",
|
|
74
74
|
businessCorridor: "business_corridor",
|
|
75
|
+
canopy: "canopy",
|
|
75
76
|
globalLandcover: "globallandcover",
|
|
76
77
|
houseNumber: "housenumber",
|
|
77
78
|
landcover: "landcover",
|
|
@@ -93,8 +94,10 @@ var canonicalFields = {
|
|
|
93
94
|
adminLevel: "admin_level",
|
|
94
95
|
bicycle: "bicycle",
|
|
95
96
|
brunnel: "brunnel",
|
|
96
|
-
buildingKind: "building_kind",
|
|
97
97
|
buildingTone: "building_tone",
|
|
98
|
+
canopyClearanceAtZoom15: "clearance_px_z15",
|
|
99
|
+
canopyCoverPercent: "cover_pct",
|
|
100
|
+
canopyRank: "rank",
|
|
98
101
|
capital: "capital",
|
|
99
102
|
circularClearanceExtraAtZoom15: "clearance_extra_px_z15",
|
|
100
103
|
circularInnerRadiusMeters: "inner_radius_m",
|
|
@@ -105,9 +108,9 @@ var canonicalFields = {
|
|
|
105
108
|
class: "class",
|
|
106
109
|
crossing: "crossing",
|
|
107
110
|
circumference: "circumference",
|
|
108
|
-
classificationConfidence: "classification_confidence",
|
|
109
111
|
confidence: "confidence",
|
|
110
112
|
diameterCrown: "diameter_crown",
|
|
113
|
+
direction: "direction",
|
|
111
114
|
disputed: "disputed",
|
|
112
115
|
elevation: "ele",
|
|
113
116
|
elevationFeet: "ele_ft",
|
|
@@ -115,7 +118,6 @@ var canonicalFields = {
|
|
|
115
118
|
foot: "foot",
|
|
116
119
|
height: "height",
|
|
117
120
|
hide3d: "hide_3d",
|
|
118
|
-
hasBusiness: "has_business",
|
|
119
121
|
hasParts: "has_parts",
|
|
120
122
|
horse: "horse",
|
|
121
123
|
houseNumber: "housenumber",
|
|
@@ -150,7 +152,6 @@ var canonicalFields = {
|
|
|
150
152
|
ref: "ref",
|
|
151
153
|
refLength: "ref_length",
|
|
152
154
|
renderHeight: "render_height",
|
|
153
|
-
renderMinZoom: "render_min_zoom",
|
|
154
155
|
renderMinHeight: "render_min_height",
|
|
155
156
|
service: "service",
|
|
156
157
|
species: "species",
|
|
@@ -173,6 +174,7 @@ function openMapTiles(options = {}) {
|
|
|
173
174
|
delete fields.bathymetryMinDepth;
|
|
174
175
|
delete fields.bathymetrySortKey;
|
|
175
176
|
}
|
|
177
|
+
if (options.capabilities?.canopy === false) delete layers.canopy;
|
|
176
178
|
if (options.capabilities?.globalLandcover === false) delete layers.globalLandcover;
|
|
177
179
|
if (options.capabilities?.tree === false) delete layers.tree;
|
|
178
180
|
return {
|
|
@@ -190,14 +192,6 @@ function tileflowWorldV1Schema(options = {}) {
|
|
|
190
192
|
...options,
|
|
191
193
|
capabilities: { ...options.capabilities, bathymetry: true, globalLandcover: true },
|
|
192
194
|
fields: {
|
|
193
|
-
circularClearanceExtraAtZoom15: "clearance_extra_px_z15",
|
|
194
|
-
circularInnerRadiusMeters: "inner_radius_m",
|
|
195
|
-
circularKind: "circle_kind",
|
|
196
|
-
circularOuterRadiusMeters: "outer_radius_m",
|
|
197
|
-
circularRadiusAtZoom15: "radius_px_z15",
|
|
198
|
-
circularRadiusMeters: "radius_m",
|
|
199
|
-
direction: "direction",
|
|
200
|
-
hasParts: "has_parts",
|
|
201
195
|
shieldKind: "shield_kind",
|
|
202
196
|
shieldLineLengthMeters: "shield_line_length_m",
|
|
203
197
|
shieldNetwork: "shield_network",
|
|
@@ -291,6 +285,7 @@ function dataIdentity(kind, schema, version, url) {
|
|
|
291
285
|
capabilities: {
|
|
292
286
|
businessCorridor: Boolean(schema.layers.businessCorridor),
|
|
293
287
|
bathymetry: Boolean(schema.layers.bathymetry),
|
|
288
|
+
canopy: Boolean(schema.layers.canopy),
|
|
294
289
|
globalLandcover: Boolean(schema.layers.globalLandcover),
|
|
295
290
|
tree: Boolean(schema.layers.tree)
|
|
296
291
|
}
|
|
@@ -447,7 +442,7 @@ function validateOpenMapTilesSchema(schema) {
|
|
|
447
442
|
`Tileflow requires OpenMapTiles contract version ${openMapTilesContractVersion}.`
|
|
448
443
|
);
|
|
449
444
|
}
|
|
450
|
-
const parkLayer = schema.semantics?.parkLayer
|
|
445
|
+
const parkLayer = schema.semantics?.parkLayer;
|
|
451
446
|
if (parkLayer !== "mixed" && parkLayer !== "protected-only") {
|
|
452
447
|
throw new Error("Tileflow OpenMapTiles semantics.parkLayer is invalid.");
|
|
453
448
|
}
|
|
@@ -1340,7 +1335,7 @@ function applyTextStyle(layer, style) {
|
|
|
1340
1335
|
layout["text-variable-anchor"] = [...style.variableAnchors];
|
|
1341
1336
|
}
|
|
1342
1337
|
if (style.justify !== void 0) layout["text-justify"] = style.justify;
|
|
1343
|
-
|
|
1338
|
+
setOverlap(layout, "text", style);
|
|
1344
1339
|
if (style.ignorePlacement !== void 0) layout["text-ignore-placement"] = style.ignorePlacement;
|
|
1345
1340
|
if (style.keepUpright !== void 0) layout["text-keep-upright"] = style.keepUpright;
|
|
1346
1341
|
if (style.optional !== void 0) layout["text-optional"] = style.optional;
|
|
@@ -1410,7 +1405,7 @@ function applyIconStyle(layer, style) {
|
|
|
1410
1405
|
if (style.rotationAlignment !== void 0) {
|
|
1411
1406
|
layout["icon-rotation-alignment"] = style.rotationAlignment;
|
|
1412
1407
|
}
|
|
1413
|
-
|
|
1408
|
+
setOverlap(layout, "icon", style);
|
|
1414
1409
|
if (style.ignorePlacement !== void 0) layout["icon-ignore-placement"] = style.ignorePlacement;
|
|
1415
1410
|
if (style.keepUpright !== void 0) layout["icon-keep-upright"] = style.keepUpright;
|
|
1416
1411
|
if (style.optional !== void 0) layout["icon-optional"] = style.optional;
|
|
@@ -1528,6 +1523,18 @@ function withoutRange(value) {
|
|
|
1528
1523
|
const { maxZoom: _maxZoom, minZoom: _minZoom, visible: _visible, ...rest } = value;
|
|
1529
1524
|
return rest;
|
|
1530
1525
|
}
|
|
1526
|
+
function setOverlap(layout, part, style) {
|
|
1527
|
+
if (style.overlap !== void 0) layout[`${part}-overlap`] = style.overlap;
|
|
1528
|
+
else if (style.allowOverlap !== void 0) layout[`${part}-allow-overlap`] = style.allowOverlap;
|
|
1529
|
+
if (layout[`${part}-overlap`] !== void 0) delete layout[`${part}-allow-overlap`];
|
|
1530
|
+
}
|
|
1531
|
+
function withoutGovernedAllowOverlap(layout) {
|
|
1532
|
+
const result = { ...layout };
|
|
1533
|
+
for (const part of ["icon", "text"]) {
|
|
1534
|
+
if (result[`${part}-overlap`] !== void 0) delete result[`${part}-allow-overlap`];
|
|
1535
|
+
}
|
|
1536
|
+
return result;
|
|
1537
|
+
}
|
|
1531
1538
|
function setPaint(paint, property, value) {
|
|
1532
1539
|
if (value !== void 0) paint[property] = toMapLibreStyleValue(value);
|
|
1533
1540
|
}
|
|
@@ -2061,15 +2068,6 @@ function buildingColorExpression(context) {
|
|
|
2061
2068
|
colors.destination,
|
|
2062
2069
|
["==", ["coalesce", ["get", fields.buildingTone], ""], "commercial"],
|
|
2063
2070
|
colors.commercial,
|
|
2064
|
-
// Defensive compatibility for immutable V8.9 archives. New candidates emit building_tone.
|
|
2065
|
-
[
|
|
2066
|
-
"any",
|
|
2067
|
-
["==", ["get", fields.hasBusiness], true],
|
|
2068
|
-
["==", ["get", fields.hasBusiness], 1],
|
|
2069
|
-
["==", ["get", fields.hasBusiness], "1"],
|
|
2070
|
-
["==", ["coalesce", ["get", fields.buildingKind], "generic"], "commercial"]
|
|
2071
|
-
],
|
|
2072
|
-
colors.commercial,
|
|
2073
2071
|
colors.generic
|
|
2074
2072
|
];
|
|
2075
2073
|
}
|
|
@@ -4144,7 +4142,7 @@ function createPoiLayer(options) {
|
|
|
4144
4142
|
["==", ["get", options.categoryField], options.category],
|
|
4145
4143
|
["has", options.filterRankField],
|
|
4146
4144
|
[">=", filterRank, 0],
|
|
4147
|
-
["<=", filterRank, options.density],
|
|
4145
|
+
["<=", filterRank, poiRankThreshold(options.density)],
|
|
4148
4146
|
["has", options.sizeRankField],
|
|
4149
4147
|
[">=", sizeRank, 0],
|
|
4150
4148
|
["<=", sizeRank, 16]
|
|
@@ -4152,6 +4150,9 @@ function createPoiLayer(options) {
|
|
|
4152
4150
|
layout: { "symbol-sort-key": poiSortKey(options.filterRankField, options.sizeRankField) }
|
|
4153
4151
|
};
|
|
4154
4152
|
}
|
|
4153
|
+
function poiRankThreshold(density) {
|
|
4154
|
+
return ["+", ["step", ["zoom"], 0, 16, 1, 17, 2], density];
|
|
4155
|
+
}
|
|
4155
4156
|
function numericPoiField(field2, fallback) {
|
|
4156
4157
|
return ["to-number", ["get", field2], fallback];
|
|
4157
4158
|
}
|
|
@@ -6344,9 +6345,7 @@ function compileSidewalks(request, context, contributions) {
|
|
|
6344
6345
|
}
|
|
6345
6346
|
function compileRoundabouts(request, context, contributions) {
|
|
6346
6347
|
const { fields, layers } = context.data.schema;
|
|
6347
|
-
if (!layers.circularFeature
|
|
6348
|
-
return;
|
|
6349
|
-
}
|
|
6348
|
+
if (!layers.circularFeature) return;
|
|
6350
6349
|
const circularFields = {
|
|
6351
6350
|
circularInnerRadiusMeters: fields.circularInnerRadiusMeters,
|
|
6352
6351
|
circularOuterRadiusMeters: fields.circularOuterRadiusMeters,
|
|
@@ -6420,7 +6419,7 @@ function compileRoundabouts(request, context, contributions) {
|
|
|
6420
6419
|
}
|
|
6421
6420
|
function compileCrossings(request, context, contributions) {
|
|
6422
6421
|
const { fields, layers } = context.data.schema;
|
|
6423
|
-
if (!request || !layers.streetFurniture
|
|
6422
|
+
if (!request || !layers.streetFurniture) return;
|
|
6424
6423
|
const config = mergeTileflowDesign(
|
|
6425
6424
|
{
|
|
6426
6425
|
allowOverlap: true,
|
|
@@ -6486,7 +6485,7 @@ function circularRoadInnerRadius(fields, casing) {
|
|
|
6486
6485
|
["/", values.innerRadiusMeters, values.radiusMeters]
|
|
6487
6486
|
];
|
|
6488
6487
|
const baseWidth = circularRoadBaseWidth(fields.class);
|
|
6489
|
-
const fallbackWidth = level === 15 ? baseWidth : ["*", baseWidth,
|
|
6488
|
+
const fallbackWidth = level === 15 ? baseWidth : ["*", baseWidth, circularRoadFallbackScale(level)];
|
|
6490
6489
|
const fallbackInnerRadius = ["-", centerlineRadius, ["/", fallbackWidth, 2]];
|
|
6491
6490
|
const innerRadius = ["case", values.hasPhysicalRadii, physicalInnerRadius, fallbackInnerRadius];
|
|
6492
6491
|
stops.push(level, [
|
|
@@ -6508,7 +6507,7 @@ function circularRoadStrokeWidth(fields, casing) {
|
|
|
6508
6507
|
centerlineRadius,
|
|
6509
6508
|
["/", ["-", values.outerRadiusMeters, values.innerRadiusMeters], values.radiusMeters]
|
|
6510
6509
|
];
|
|
6511
|
-
const fallbackWidth = level === 15 ? baseWidth : ["*", baseWidth,
|
|
6510
|
+
const fallbackWidth = level === 15 ? baseWidth : ["*", baseWidth, circularRoadFallbackScale(level)];
|
|
6512
6511
|
stops.push(level, [
|
|
6513
6512
|
"case",
|
|
6514
6513
|
values.hasPhysicalRadii,
|
|
@@ -6557,7 +6556,7 @@ function circularRoadValues(fields) {
|
|
|
6557
6556
|
radiusMeters
|
|
6558
6557
|
};
|
|
6559
6558
|
}
|
|
6560
|
-
function
|
|
6559
|
+
function circularRoadFallbackScale(level) {
|
|
6561
6560
|
const interpolationBase = 1.35;
|
|
6562
6561
|
const progress = (interpolationBase ** (level - 15) - 1) / (interpolationBase ** (22 - 15) - 1);
|
|
6563
6562
|
return 1 + progress * 1.2;
|
|
@@ -7162,7 +7161,7 @@ function cloneJson16(value) {
|
|
|
7162
7161
|
|
|
7163
7162
|
// src/modules/vegetation/compiler.ts
|
|
7164
7163
|
function compileVegetation(request, context) {
|
|
7165
|
-
const minZoom = request?.flat?.minZoom ??
|
|
7164
|
+
const minZoom = request?.flat?.minZoom ?? 16;
|
|
7166
7165
|
const mode = request?.mode ?? "3d";
|
|
7167
7166
|
const config = mergeTileflowDesign(
|
|
7168
7167
|
{
|
|
@@ -7182,7 +7181,6 @@ function compileVegetation(request, context) {
|
|
|
7182
7181
|
strokeOpacity: 0.55,
|
|
7183
7182
|
strokeWidth: 0.8
|
|
7184
7183
|
},
|
|
7185
|
-
minZoom,
|
|
7186
7184
|
mode,
|
|
7187
7185
|
threeDimensional: {
|
|
7188
7186
|
barkColor: context.colors.vegetation.tree.bark,
|
|
@@ -9943,10 +9941,10 @@ function applyRefinement(previous, refinement) {
|
|
|
9943
9941
|
style: {
|
|
9944
9942
|
...previous.style,
|
|
9945
9943
|
...patch.style?.placement === void 0 ? {} : {
|
|
9946
|
-
placement: {
|
|
9944
|
+
placement: withoutGovernedAllowOverlap({
|
|
9947
9945
|
...previous.style.placement ?? {},
|
|
9948
9946
|
...patch.style.placement
|
|
9949
|
-
}
|
|
9947
|
+
})
|
|
9950
9948
|
},
|
|
9951
9949
|
...patch.style?.appearance === void 0 ? {} : {
|
|
9952
9950
|
appearance: {
|
|
@@ -10852,6 +10850,7 @@ var textStyleSchema = z5.object({
|
|
|
10852
10850
|
offset: numberOffsetValueSchema.optional(),
|
|
10853
10851
|
optional: z5.boolean().optional(),
|
|
10854
10852
|
opacity: numberValueSchema.optional(),
|
|
10853
|
+
overlap: z5.enum(["always", "cooperative", "never"]).optional(),
|
|
10855
10854
|
padding: numberValueSchema.optional(),
|
|
10856
10855
|
pitchAlignment: z5.enum(["auto", "map", "viewport"]).optional(),
|
|
10857
10856
|
radialOffset: numberValueSchema.optional(),
|
|
@@ -10897,6 +10896,7 @@ var iconStyleSchema = z5.object({
|
|
|
10897
10896
|
opacity: numberValueSchema.optional(),
|
|
10898
10897
|
keepUpright: z5.boolean().optional(),
|
|
10899
10898
|
optional: z5.boolean().optional(),
|
|
10899
|
+
overlap: z5.enum(["always", "cooperative", "never"]).optional(),
|
|
10900
10900
|
padding: numberValueSchema.optional(),
|
|
10901
10901
|
pitchAlignment: z5.enum(["auto", "map", "viewport"]).optional(),
|
|
10902
10902
|
rotate: numberValueSchema.optional(),
|
|
@@ -11469,7 +11469,6 @@ var modulesSchema = z5.object({
|
|
|
11469
11469
|
type: z5.literal("vegetation"),
|
|
11470
11470
|
enabled: z5.boolean().optional(),
|
|
11471
11471
|
flat: circleStyleSchema.optional(),
|
|
11472
|
-
minZoom: zoomNumberSchema.optional(),
|
|
11473
11472
|
mode: z5.enum(["3d", "flat"]).optional(),
|
|
11474
11473
|
renderStack: renderStackSchema.optional(),
|
|
11475
11474
|
threeDimensional: z5.object({
|
|
@@ -11505,6 +11504,7 @@ var layerBindingsSchema = z5.object({
|
|
|
11505
11504
|
building: z5.string().trim().min(1),
|
|
11506
11505
|
bathymetry: z5.string().trim().min(1).optional(),
|
|
11507
11506
|
businessCorridor: z5.string().trim().min(1).optional(),
|
|
11507
|
+
canopy: z5.string().trim().min(1).optional(),
|
|
11508
11508
|
circularFeature: z5.string().trim().min(1).optional(),
|
|
11509
11509
|
globalLandcover: z5.string().trim().min(1).optional(),
|
|
11510
11510
|
houseNumber: z5.string().trim().min(1),
|
|
@@ -11532,34 +11532,34 @@ var fieldBindingsSchema = z5.object({
|
|
|
11532
11532
|
bathymetryMinDepth: z5.string().trim().min(1).optional(),
|
|
11533
11533
|
bathymetrySortKey: z5.string().trim().min(1).optional(),
|
|
11534
11534
|
brunnel: z5.string().trim().min(1),
|
|
11535
|
-
buildingKind: z5.string().trim().min(1),
|
|
11536
11535
|
buildingTone: z5.string().trim().min(1),
|
|
11536
|
+
canopyClearanceAtZoom15: z5.string().trim().min(1),
|
|
11537
|
+
canopyCoverPercent: z5.string().trim().min(1),
|
|
11538
|
+
canopyRank: z5.string().trim().min(1),
|
|
11537
11539
|
capital: z5.string().trim().min(1),
|
|
11538
|
-
circularClearanceExtraAtZoom15: z5.string().trim().min(1)
|
|
11539
|
-
circularKind: z5.string().trim().min(1)
|
|
11540
|
-
circularRadiusAtZoom15: z5.string().trim().min(1)
|
|
11541
|
-
circularRadiusMeters: z5.string().trim().min(1)
|
|
11542
|
-
circularInnerRadiusMeters: z5.string().trim().min(1)
|
|
11543
|
-
circularOuterRadiusMeters: z5.string().trim().min(1)
|
|
11540
|
+
circularClearanceExtraAtZoom15: z5.string().trim().min(1),
|
|
11541
|
+
circularKind: z5.string().trim().min(1),
|
|
11542
|
+
circularRadiusAtZoom15: z5.string().trim().min(1),
|
|
11543
|
+
circularRadiusMeters: z5.string().trim().min(1),
|
|
11544
|
+
circularInnerRadiusMeters: z5.string().trim().min(1),
|
|
11545
|
+
circularOuterRadiusMeters: z5.string().trim().min(1),
|
|
11544
11546
|
class: z5.string().trim().min(1),
|
|
11545
11547
|
crossing: z5.string().trim().min(1),
|
|
11546
|
-
classificationConfidence: z5.string().trim().min(1),
|
|
11547
11548
|
confidence: z5.string().trim().min(1),
|
|
11548
11549
|
circumference: z5.string().trim().min(1),
|
|
11549
11550
|
diameterCrown: z5.string().trim().min(1),
|
|
11550
11551
|
disputed: z5.string().trim().min(1),
|
|
11551
|
-
direction: z5.string().trim().min(1)
|
|
11552
|
+
direction: z5.string().trim().min(1),
|
|
11552
11553
|
elevation: z5.string().trim().min(1),
|
|
11553
11554
|
elevationFeet: z5.string().trim().min(1),
|
|
11554
11555
|
expressway: z5.string().trim().min(1),
|
|
11555
11556
|
foot: z5.string().trim().min(1),
|
|
11556
11557
|
height: z5.string().trim().min(1),
|
|
11557
|
-
|
|
11558
|
-
hasParts: z5.string().trim().min(1).optional(),
|
|
11558
|
+
hasParts: z5.string().trim().min(1),
|
|
11559
11559
|
hide3d: z5.string().trim().min(1),
|
|
11560
11560
|
horse: z5.string().trim().min(1),
|
|
11561
11561
|
houseNumber: z5.string().trim().min(1),
|
|
11562
|
-
importanceTier: z5.string().trim().min(1)
|
|
11562
|
+
importanceTier: z5.string().trim().min(1),
|
|
11563
11563
|
iata: z5.string().trim().min(1),
|
|
11564
11564
|
icao: z5.string().trim().min(1),
|
|
11565
11565
|
indoor: z5.string().trim().min(1),
|
|
@@ -11590,7 +11590,6 @@ var fieldBindingsSchema = z5.object({
|
|
|
11590
11590
|
ref: z5.string().trim().min(1),
|
|
11591
11591
|
refLength: z5.string().trim().min(1),
|
|
11592
11592
|
renderHeight: z5.string().trim().min(1),
|
|
11593
|
-
renderMinZoom: z5.string().trim().min(1),
|
|
11594
11593
|
renderMinHeight: z5.string().trim().min(1),
|
|
11595
11594
|
shieldKind: z5.string().trim().min(1).optional(),
|
|
11596
11595
|
shieldLineLengthMeters: z5.string().trim().min(1).optional(),
|
|
@@ -11616,6 +11615,7 @@ var openMapTilesSchema = z5.object({
|
|
|
11616
11615
|
capabilities: schema.layers === void 0 ? void 0 : {
|
|
11617
11616
|
businessCorridor: schema.layers.businessCorridor !== void 0,
|
|
11618
11617
|
bathymetry: schema.layers.bathymetry !== void 0,
|
|
11618
|
+
canopy: schema.layers.canopy !== void 0,
|
|
11619
11619
|
globalLandcover: schema.layers.globalLandcover !== void 0,
|
|
11620
11620
|
tree: schema.layers.tree !== void 0
|
|
11621
11621
|
},
|
|
@@ -14697,6 +14697,15 @@ var tileflowCaptureSceneSchema = z8.object({
|
|
|
14697
14697
|
viewport: tileflowCaptureViewportSchema,
|
|
14698
14698
|
target: tileflowCaptureTargetSchema.optional()
|
|
14699
14699
|
}).strict();
|
|
14700
|
+
function tileflowCaptureSceneFitIssue(scene) {
|
|
14701
|
+
if (scene.camera.type !== "bounds" || scene.camera.padding === void 0) return void 0;
|
|
14702
|
+
const room = Math.min(scene.viewport.width, scene.viewport.height);
|
|
14703
|
+
if (scene.camera.padding * 2 < room) return void 0;
|
|
14704
|
+
return {
|
|
14705
|
+
message: `Expected bounds padding less than half the viewport's shorter side (${room / 2} pixels)`,
|
|
14706
|
+
path: ["camera", "padding"]
|
|
14707
|
+
};
|
|
14708
|
+
}
|
|
14700
14709
|
function isPortableApplicationPath(value) {
|
|
14701
14710
|
if (value !== value.trim() || !value.startsWith("/") || value.startsWith("//") || value.includes("#") || value.includes("\\") || hasControlCharacter(value)) {
|
|
14702
14711
|
return false;
|
|
@@ -15182,8 +15191,8 @@ function validateMapScenes(map, mapId) {
|
|
|
15182
15191
|
);
|
|
15183
15192
|
}
|
|
15184
15193
|
const result = tileflowCaptureSceneSchema.safeParse({ ...input, map: mapId });
|
|
15185
|
-
|
|
15186
|
-
|
|
15194
|
+
const issue = result.success ? tileflowCaptureSceneFitIssue(result.data) : result.error.issues[0];
|
|
15195
|
+
if (!result.success || issue) {
|
|
15187
15196
|
throw new Error(
|
|
15188
15197
|
`Invalid Tileflow map "${map.id}". scenes.${sceneName}${issue?.path.length ? `.${issue.path.join(".")}` : ""}: ${issue?.message ?? "Invalid scene"}`
|
|
15189
15198
|
);
|
|
@@ -15899,6 +15908,13 @@ var layerTransformationSchema = strictNativeObject({
|
|
|
15899
15908
|
"Expected unique, ordered properties"
|
|
15900
15909
|
)
|
|
15901
15910
|
});
|
|
15911
|
+
var symbolOverlapTransformationSchema = strictNativeObject({
|
|
15912
|
+
inputLayer: layerCountSchema,
|
|
15913
|
+
properties: z12.array(z12.enum(["icon-overlap", "text-overlap"])).min(1).max(2).refine(
|
|
15914
|
+
(properties2) => properties2.length === 1 || properties2[0] === "icon-overlap" && properties2[1] === "text-overlap",
|
|
15915
|
+
"Expected unique, ordered properties"
|
|
15916
|
+
)
|
|
15917
|
+
});
|
|
15902
15918
|
var tileflowNativeStyleTransformationSchema = strictNativeObject({
|
|
15903
15919
|
map: tileflowPortableIdSchema,
|
|
15904
15920
|
theme: tileflowThemeNameSchema,
|
|
@@ -15907,7 +15923,8 @@ var tileflowNativeStyleTransformationSchema = strictNativeObject({
|
|
|
15907
15923
|
inputLayers: layerCountSchema,
|
|
15908
15924
|
outputLayers: layerCountSchema,
|
|
15909
15925
|
projection: z12.enum(["none", "mercator-to-implicit", "globe-to-mercator"]),
|
|
15910
|
-
layers: z12.array(layerTransformationSchema).max(tileflowNativeProfileLimits.maximumLayers)
|
|
15926
|
+
layers: z12.array(layerTransformationSchema).max(tileflowNativeProfileLimits.maximumLayers),
|
|
15927
|
+
symbolOverlap: z12.array(symbolOverlapTransformationSchema).max(tileflowNativeProfileLimits.maximumLayers)
|
|
15911
15928
|
}).superRefine((style, context) => {
|
|
15912
15929
|
let previous = -1;
|
|
15913
15930
|
let added = 0;
|
|
@@ -15929,6 +15946,18 @@ var tileflowNativeStyleTransformationSchema = strictNativeObject({
|
|
|
15929
15946
|
message: "Layer counts do not match transformation spans"
|
|
15930
15947
|
});
|
|
15931
15948
|
}
|
|
15949
|
+
const partitioned = new Set(style.layers.map(({ inputLayer }) => inputLayer));
|
|
15950
|
+
previous = -1;
|
|
15951
|
+
for (const [index, layer] of style.symbolOverlap.entries()) {
|
|
15952
|
+
if (layer.inputLayer <= previous || layer.inputLayer >= style.inputLayers || partitioned.has(layer.inputLayer)) {
|
|
15953
|
+
context.addIssue({
|
|
15954
|
+
code: "custom",
|
|
15955
|
+
path: ["symbolOverlap", index],
|
|
15956
|
+
message: "Invalid symbol overlap layer"
|
|
15957
|
+
});
|
|
15958
|
+
}
|
|
15959
|
+
previous = layer.inputLayer;
|
|
15960
|
+
}
|
|
15932
15961
|
});
|
|
15933
15962
|
var tileflowNativeBuildRecordSchema = strictNativeObject({
|
|
15934
15963
|
schemaVersion: z12.literal(2),
|
|
@@ -116,6 +116,16 @@ declare const tileflowCaptureSceneSchema: z.ZodObject<{
|
|
|
116
116
|
}>>;
|
|
117
117
|
}, z.core.$strict>], "kind">>;
|
|
118
118
|
}, z.core.$strict>;
|
|
119
|
+
/**
|
|
120
|
+
* Why a scene's bounds padding leaves no room for its bounds, or undefined when it fits: padding on
|
|
121
|
+
* both sides must be less than the viewport's shorter side. MapLibre GL JS 6.11.2+ leaves a globe
|
|
122
|
+
* camera where it was when it cannot fit, so the capture would show the wrong view. Checked where
|
|
123
|
+
* scenes are validated rather than in the schema, so the published reference keeps its shape.
|
|
124
|
+
*/
|
|
125
|
+
declare function tileflowCaptureSceneFitIssue(scene: Pick<TileflowCaptureScene, 'camera' | 'viewport'>): {
|
|
126
|
+
message: string;
|
|
127
|
+
path: ['camera', 'padding'];
|
|
128
|
+
} | undefined;
|
|
119
129
|
type TileflowCaptureCenterCamera = z.infer<typeof tileflowCaptureCenterCameraSchema>;
|
|
120
130
|
type TileflowCaptureBoundsCamera = z.infer<typeof tileflowCaptureBoundsCameraSchema>;
|
|
121
131
|
type TileflowCaptureCamera = z.infer<typeof tileflowCaptureCameraSchema>;
|
|
@@ -158,4 +168,4 @@ type NormalizedTileflowCaptureScene = {
|
|
|
158
168
|
declare function normalizeTileflowCaptureScene(input: TileflowCaptureScene): NormalizedTileflowCaptureScene;
|
|
159
169
|
declare function normalizeTileflowCaptureId(value: string | undefined): string | undefined;
|
|
160
170
|
|
|
161
|
-
export { type NormalizedTileflowCaptureScene as N, type TileflowCaptureScene as T, type TileflowCaptureApplicationTarget as a, type TileflowCaptureBoundsCamera as b, type TileflowCaptureCamera as c, type TileflowCaptureCenterCamera as d, type TileflowCaptureMapTarget as e, type TileflowCaptureTarget as f, type TileflowCaptureViewport as g, normalizeTileflowCaptureScene as h, tileflowCaptureBoundsCameraSchema as i, tileflowCaptureCameraSchema as j, tileflowCaptureCenterCameraSchema as k, tileflowCaptureIdSchema as l, tileflowCaptureMapTargetSchema as m, normalizeTileflowCaptureId as n, tileflowCaptureSceneLimits as o, tileflowCaptureSceneNameSchema as p, tileflowCaptureSceneSchema as q, tileflowCaptureSceneSchemaVersion as r, tileflowCaptureTargetSchema as s, tileflowCaptureApplicationTargetSchema as t, tileflowCaptureViewportSchema as u };
|
|
171
|
+
export { type NormalizedTileflowCaptureScene as N, type TileflowCaptureScene as T, type TileflowCaptureApplicationTarget as a, type TileflowCaptureBoundsCamera as b, type TileflowCaptureCamera as c, type TileflowCaptureCenterCamera as d, type TileflowCaptureMapTarget as e, type TileflowCaptureTarget as f, type TileflowCaptureViewport as g, normalizeTileflowCaptureScene as h, tileflowCaptureBoundsCameraSchema as i, tileflowCaptureCameraSchema as j, tileflowCaptureCenterCameraSchema as k, tileflowCaptureIdSchema as l, tileflowCaptureMapTargetSchema as m, normalizeTileflowCaptureId as n, tileflowCaptureSceneLimits as o, tileflowCaptureSceneNameSchema as p, tileflowCaptureSceneSchema as q, tileflowCaptureSceneSchemaVersion as r, tileflowCaptureTargetSchema as s, tileflowCaptureApplicationTargetSchema as t, tileflowCaptureViewportSchema as u, tileflowCaptureSceneFitIssue as v };
|
package/dist/capture.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { N as NormalizedTileflowCaptureScene, a as TileflowCaptureApplicationTarget, b as TileflowCaptureBoundsCamera, c as TileflowCaptureCamera, d as TileflowCaptureCenterCamera, e as TileflowCaptureMapTarget, T as TileflowCaptureScene, f as TileflowCaptureTarget, g as TileflowCaptureViewport, n as normalizeTileflowCaptureId, h as normalizeTileflowCaptureScene, t as tileflowCaptureApplicationTargetSchema, i as tileflowCaptureBoundsCameraSchema, j as tileflowCaptureCameraSchema, k as tileflowCaptureCenterCameraSchema, l as tileflowCaptureIdSchema, m as tileflowCaptureMapTargetSchema, o as tileflowCaptureSceneLimits, p as tileflowCaptureSceneNameSchema, q as tileflowCaptureSceneSchema, r as tileflowCaptureSceneSchemaVersion, s as tileflowCaptureTargetSchema, u as tileflowCaptureViewportSchema } from './capture-scene-
|
|
1
|
+
export { N as NormalizedTileflowCaptureScene, a as TileflowCaptureApplicationTarget, b as TileflowCaptureBoundsCamera, c as TileflowCaptureCamera, d as TileflowCaptureCenterCamera, e as TileflowCaptureMapTarget, T as TileflowCaptureScene, f as TileflowCaptureTarget, g as TileflowCaptureViewport, n as normalizeTileflowCaptureId, h as normalizeTileflowCaptureScene, t as tileflowCaptureApplicationTargetSchema, i as tileflowCaptureBoundsCameraSchema, j as tileflowCaptureCameraSchema, k as tileflowCaptureCenterCameraSchema, l as tileflowCaptureIdSchema, m as tileflowCaptureMapTargetSchema, v as tileflowCaptureSceneFitIssue, o as tileflowCaptureSceneLimits, p as tileflowCaptureSceneNameSchema, q as tileflowCaptureSceneSchema, r as tileflowCaptureSceneSchemaVersion, s as tileflowCaptureTargetSchema, u as tileflowCaptureViewportSchema } from './capture-scene-BaAJjGq7.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/** Canonical, filesystem-safe identity shared by authored and emitted Tileflow resources. */
|
package/dist/capture.js
CHANGED
|
@@ -204,8 +204,19 @@ var tileflowCaptureSceneSchema = z3.object({
|
|
|
204
204
|
viewport: tileflowCaptureViewportSchema,
|
|
205
205
|
target: tileflowCaptureTargetSchema.optional()
|
|
206
206
|
}).strict();
|
|
207
|
+
function tileflowCaptureSceneFitIssue(scene) {
|
|
208
|
+
if (scene.camera.type !== "bounds" || scene.camera.padding === void 0) return void 0;
|
|
209
|
+
const room = Math.min(scene.viewport.width, scene.viewport.height);
|
|
210
|
+
if (scene.camera.padding * 2 < room) return void 0;
|
|
211
|
+
return {
|
|
212
|
+
message: `Expected bounds padding less than half the viewport's shorter side (${room / 2} pixels)`,
|
|
213
|
+
path: ["camera", "padding"]
|
|
214
|
+
};
|
|
215
|
+
}
|
|
207
216
|
function normalizeTileflowCaptureScene(input) {
|
|
208
217
|
const scene = tileflowCaptureSceneSchema.parse(input);
|
|
218
|
+
const fit = tileflowCaptureSceneFitIssue(scene);
|
|
219
|
+
if (fit) throw new RangeError(`${fit.path.join(".")}: ${fit.message}`);
|
|
209
220
|
const camera = scene.camera.type === "center" ? {
|
|
210
221
|
type: scene.camera.type,
|
|
211
222
|
center: scene.camera.center,
|
|
@@ -265,6 +276,7 @@ export {
|
|
|
265
276
|
tileflowCaptureCenterCameraSchema,
|
|
266
277
|
tileflowCaptureIdSchema,
|
|
267
278
|
tileflowCaptureMapTargetSchema,
|
|
279
|
+
tileflowCaptureSceneFitIssue,
|
|
268
280
|
tileflowCaptureSceneLimits,
|
|
269
281
|
tileflowCaptureSceneNameSchema,
|
|
270
282
|
tileflowCaptureSceneSchema,
|