@geolibre/core 3.6.1 → 3.8.0
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/dist/ellipsoids-BdHOMRmm.d.mts +448 -0
- package/dist/ellipsoids-BdHOMRmm.d.mts.map +1 -0
- package/dist/ellipsoids-DlTLddDu.mjs +496 -0
- package/dist/ellipsoids-DlTLddDu.mjs.map +1 -0
- package/dist/geodesic.d.mts +70 -0
- package/dist/geodesic.d.mts.map +1 -0
- package/dist/geodesic.mjs +155 -0
- package/dist/geodesic.mjs.map +1 -0
- package/dist/index.d.mts +822 -18
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4976 -3886
- package/dist/index.mjs.map +1 -1
- package/dist/{project-diff-BJDslj2U.d.mts → project-diff-BksHN-qY.d.mts} +194 -451
- package/dist/project-diff-BksHN-qY.d.mts.map +1 -0
- package/dist/{project-diff-RBRpSza4.mjs → project-diff-DJkOd8ff.mjs} +1964 -687
- package/dist/project-diff-DJkOd8ff.mjs.map +1 -0
- package/dist/worker-safe.d.mts +2 -1
- package/dist/worker-safe.mjs +3 -1
- package/package.json +10 -5
- package/dist/project-diff-BJDslj2U.d.mts.map +0 -1
- package/dist/project-diff-RBRpSza4.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as cascadeLayerJoinRefresh, $n as ModelGraphEdge, $r as StyleLibraryEntryKind, $t as DashboardWidgetType, A as normalizeMapViewState, Ai as normalizeCesiumBasemap, An as LayerQuickFilter, Ar as ProjectPluginState, At as CollabInvite, B as normalizeWidgets, Bn as LevelFilterMode, Br as SecondaryMapView, Bt as DEFAULT_BASEMAP, C as isSessionOnlyLayer, Ci as geoArrowToFeatureCollection, Cn as LayerJoinStats, Cr as ProcessingRunStatus, Ct as AttributeFormSection, D as normalizeDashboardColumns, Di as CesiumBasemapImagery, Dn as LayerMetadataLink, Dr as ProjectControlSetting, Dt as BLANK_BASEMAP, E as normalizeBookmarks, Ei as CesiumBasemapId, En as LayerMetadataContact, Er as ProjectComment, Et as AttributeFormWidget, F as normalizeProcessingHistory, Fn as LegendCustomEntry, Fr as QuickFilterTextOperator, Ft as CollaborationRole, G as serializeProject, Gn as MIN_DASHBOARD_COLUMNS, Gr as StoryChapterLocation, Gt as DEFAULT_MAP_GRID_LAYOUT, H as portableWmsTileUrl, Hn as MAX_DASHBOARD_COLUMNS, Hr as StoryChapter, Ht as DEFAULT_DASHBOARD_COLUMNS, I as normalizeProjectComments, In as LegendCustomItem, Ir as RecentProjectEntry, It as CollaborationState, J as storyMapHasContent, Jn as MapProjection, Jr as StoryMap, Jt as DEFAULT_STORY_MAP, K as serializeProjectWithLayerCache, Kn as MapGridLayout, Kr as StoryInsetPosition, Kt as DEFAULT_PRIMARY_RENDERER, L as normalizeProjectInteraction, Ln as LegendCustomShape, Lr as RuntimeEnvironmentVariable, Lt as CommentAnchor, M as normalizeModels, Mn as LayerType, Mr as ProjectTemplateEntry, Mt as CollaborationMode, N as normalizeObiaWorkbench, Nn as LayerVirtualField, Nr as QuickFilterDateKind, Nt as CollaborationParticipant, O as normalizeLegendConfig, Oi as availableCesiumBasemap, On as LayerMetadataTemporalExtent, Or as ProjectInteraction, Ot as BLEND_MODES, P as normalizePrimaryRenderer, Pn as LegendConfig, Pr as QuickFilterKind, Pt as CollaborationPresence, Q as applyLayerJoins, Qn as MarkerShape, Qr as StyleLibraryEntry, Qt as DashboardWidgetAggregation, R as normalizeSecondaryMapViews, Rn as LegendItemOverride, Rr as SQL_QUERY_SOURCE_KIND, Rt as CommentAuthor, S as isAllowedPluginManifestUrl, Si as featureCollectionToGeoArrow, Sn as LayerJoin, Sr as ProcessingRunKind, St as AttributeFormFieldConfig, T as normalizeBookmarkGroups, Ti as CESIUM_BASEMAPS, Tn as LayerLibraryEntry, Tr as ProjectBookmarkGroup, Tt as AttributeFormValueRelation, U as projectFromStore, Un as MAX_MAP_GRID_DIM, Ur as StoryChapterAlignment, Ut as DEFAULT_LAYER_STYLE, V as parseProject, Vn as LineDecoration, Vr as StoryActiveSlideMode, Vt as DEFAULT_BLEND_MODE, W as resolveMapGrid, Wn as MAX_PROCESSING_HISTORY, Wr as StoryChapterAnimation, Wt as DEFAULT_LEGEND_CONFIG, X as ApplyLayerJoinsResult, Xn as MapScaleUnit, Xr as StrokeDashPreset, Xt as DUCKDB_VECTOR_ROUTE_BYTES, Y as withI3sSceneLayerKind, Yn as MapRendererKind, Yr as StorySlideMode, Yt as DUCKDB_VECTOR_FEATURE_WARN_COUNT, Z as applyJoinsToLayer, Zn as MapViewState, Zr as StrokeWidthUnit, Zt as DashboardWidget, _ as createEmptyProject, _i as scrubPrintLayoutForLayers, _n as LabelTransform, _r as ProcessingModel, _t as AddTileLayerOptions, a as ProjectDiffOptions, ai as isPlanetaryComputerLayer, an as FillPattern, ar as NETCDF_IMAGE_SOURCE_KIND, at as PolylineDecodeResult, b as detachProjectCopy, bi as GeoArrowGeometryType, bn as LayerDescriptiveMetadata, br as ProcessingRerunRequest, bt as AppRole, c as diffProjects, ci as DEFAULT_PRINT_LAYOUT, cn as GeocodingLocator, cr as PLANETARY_COMPUTER_SOURCE_KIND, ct as decodePolylineDetailed, d as CreateProjectOptions, di as PrintLayoutLegendEntry, dn as IndicatorAggregation, dr as ParticipantIdentity, dt as polylineStrToGeoJSON, ei as VectorRule, en as DiagramField, er as ModelGraphNode, et as collectTransitiveJoinSourceIds, f as DEFAULT_PROJECT_NAME, fi as PrintLayoutPageFilter, fn as LARGE_VECTOR_FEATURE_THRESHOLD, fr as PointRenderer, ft as unescapePolyline, g as createDefaultMapView, gi as printLayoutConfigsEqual, gn as LabelStyle, gr as PopupFieldKind, gt as ARCGIS_IMAGE_SERVICE_SOURCE_KIND, h as applyProjectToStore, hi as normalizePrintLayoutConfig, hn as LabelDedupe, hr as PopupFieldFormat, ht as transformGeojsonElevation, i as ProjectDiff, ii as isDuckDBQueryLayer, in as FieldVisibility, ir as ModelToolProvider, it as PolylineBatchOptions, j as normalizeModelGraph, ji as sameCesiumImagery, jn as LayerStyle, jr as ProjectPreferences, jt as CollaborationChatMessage, k as normalizeMapLayout, ki as basemapToCesiumImagery, kn as LayerPopupConfig, kr as ProjectPluginControlPosition, kt as BlendMode, l as jsonValuesEqual, li as PrintLayoutConfig, ln as GeocodingPreferences, lr as PROJECT_VERSION, lt as encodePolyline, m as ProjectLayerSerializationCache, mi as isDefaultPrintLayout, mn as LabelAnchor, mr as PopupFieldConfig, mt as horizontalBbox, n as LayerDiff, ni as VectorStyleStop, nn as DiagramType, nr as ModelGraphPort, nt as reapplyLayerJoins, o as ProjectValueChange, oi as shouldUseTiledRendering, on as GeoLibreLayer, or as NonGeographicCoordinates, ot as batchDecodePolylines, p as MAX_PROJECT_BOOKMARKS, pi as createDefaultPrintLayout, pn as LAYER_TYPES, pr as PopupDateFormat, pt as geojsonHasZCoordinates, q as serializeProjectWithLayerCacheAsync, qn as MapPreferences, qr as StoryLayerOpacityChange, qt as DEFAULT_PROJECT_PREFERENCES, r as PluginDiff, ri as detectNonGeographicCoordinates, rn as EditorTrackingConfig, rr as ModelPortKind, rt as stripJoinFields, s as diffFeatureCollections, si as styleValue, sn as GeoLibreProject, sr as OPENFREEMAP_BASEMAPS, st as decodePolyline, t as FeatureChangeSummary, ti as VectorStyleMode, tn as DiagramSizeMode, tr as ModelGraphNodeKind, tt as layerJoinKey, u as previewValue, ui as PrintLayoutCorner, un as GeometryGeneratorType, ur as PROTOMAPS_BASEMAPS, ut as geoJSONToPolylineStr, v as createProjectLayerSerializationCache, vi as scrubPrintLayoutForRemovedLayers, vn as LayerCapabilities, vr as ProcessingModelGraph, vt as AppCapabilities, w as normalizeBlankBackgroundColor, wi as isGeoArrowBatch, wn as LayerLevelFilter, wr as ProjectBookmark, wt as AttributeFormValueMapEntry, x as hydrateProjectLayer, xi as computeGeoArrowBBox, xn as LayerGroup, xr as ProcessingRun, xt as AttributeFormConfig, y as createProjectTemplate, yi as GeoArrowBatch, yn as LayerConnection, yr as ProcessingModelStep, yt as AppPrivilege, z as normalizeStoryMap, zn as LegendPanelPosition, zr as STROKE_DASH_PRESETS, zt as CommentReply } from "./project-diff-BksHN-qY.mjs";
|
|
2
|
+
import { A as LineString, C as meanRadiusMeters, E as FeatureCollection, M as MultiPolygon, N as Point, P as Polygon, S as getPlanetaryBasemapByStyleUrl, T as Feature, _ as getActiveEllipsoid, a as EllipsoidId, b as getEllipsoid, c as PLANETARY_BASEMAP_SENTINEL_PREFIX, d as PlanetaryBasemapGroup, f as PlanetaryBasemapSectionId, g as getActiveBodyRadiusRatio, h as earthLengthToBody, i as Ellipsoid, k as Geometry, l as PLANET_SWITCHER_OPTIONS, m as earthAreaToBody, n as EARTH_MEAN_RADIUS_METERS, o as PLANETARY_BASEMAPS, p as bodyLengthToEarth, r as ELLIPSOIDS, s as PLANETARY_BASEMAP_GROUPS, t as DEFAULT_ELLIPSOID_ID, u as PlanetaryBasemap, v as getActiveMeanRadiusMeters, w as setActiveEllipsoidId, x as getPlanetaryBasemapById, y as getActiveSemiMajorAxisMeters } from "./ellipsoids-BdHOMRmm.mjs";
|
|
3
|
+
import { centralAngle, geodesicDistance, geodesicLength, geodesicRadiusBounds, geodesicRingArea, isLonLat, latLonBoxArea, withinGeodesicDistance } from "./geodesic.mjs";
|
|
2
4
|
import "zustand";
|
|
3
5
|
import "zundo";
|
|
4
6
|
export type TileScheme = "xyz" | "tms";
|
|
@@ -256,6 +258,12 @@ export interface RegionalBasemap {
|
|
|
256
258
|
* are not translated the way UI strings are.
|
|
257
259
|
*/
|
|
258
260
|
name: string;
|
|
261
|
+
/**
|
|
262
|
+
* The tile provider's brand name in Latin script ("Amap", "Tencent Maps"),
|
|
263
|
+
* for messages read outside the region, such as the confirmation shown when
|
|
264
|
+
* an opened project names this basemap. A proper noun, so not translated.
|
|
265
|
+
*/
|
|
266
|
+
provider: string;
|
|
259
267
|
/** Sentinel stored as the basemap style URL. */
|
|
260
268
|
styleUrl: string;
|
|
261
269
|
/** XYZ (or TMS, see {@link scheme}) tile template. */
|
|
@@ -313,6 +321,50 @@ export declare function getRegionalBasemapByStyleUrl(styleUrl: string | undefine
|
|
|
313
321
|
export declare function getRegionalBasemapById(id: string | undefined): RegionalBasemap | undefined;
|
|
314
322
|
/** Whether a style URL is a regional-basemap sentinel, resolvable or not. */
|
|
315
323
|
export declare function isRegionalBasemapSentinel(styleUrl: string | undefined): boolean;
|
|
324
|
+
/**
|
|
325
|
+
* How the store treats a regional basemap that arrives without the user picking
|
|
326
|
+
* it (a project file, share link, or startup restore naming one by its
|
|
327
|
+
* `styleUrl`). The tiles come from servers in mainland China, so loading them
|
|
328
|
+
* unasked sends the user's map requests there.
|
|
329
|
+
*
|
|
330
|
+
* - `"allow"`: apply it as is. This is the store default, so library consumers
|
|
331
|
+
* keep their behaviour; the desktop and web app switch to `"prompt"`.
|
|
332
|
+
* - `"prompt"`: apply the default basemap and hold the regional one for the
|
|
333
|
+
* user to confirm (see {@link RegionalBasemapHold}).
|
|
334
|
+
* - `"block"`: the deployment disabled regional basemaps. Always fall back to
|
|
335
|
+
* the default basemap, including when code sets one directly.
|
|
336
|
+
*/
|
|
337
|
+
export type RegionalBasemapPolicy = "allow" | "prompt" | "block";
|
|
338
|
+
/**
|
|
339
|
+
* A regional basemap the store set aside when a project was loaded. The default
|
|
340
|
+
* basemap renders in its place until the user answers (`"prompt"`), or for good
|
|
341
|
+
* (`"blocked"`, which the app shows as a notice only).
|
|
342
|
+
*/
|
|
343
|
+
export interface RegionalBasemapHold {
|
|
344
|
+
/** The regional sentinel the project asked for. */
|
|
345
|
+
styleUrl: string;
|
|
346
|
+
/** Why the default basemap is showing instead. */
|
|
347
|
+
reason: "prompt" | "blocked";
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Decides which basemap a project load actually applies.
|
|
351
|
+
*
|
|
352
|
+
* Only a resolvable regional sentinel is gated. Every other style URL (and an
|
|
353
|
+
* unknown regional id, which the map controller already replaces with the
|
|
354
|
+
* default basemap) passes through untouched.
|
|
355
|
+
*
|
|
356
|
+
* @param styleUrl - The basemap style URL the project requests.
|
|
357
|
+
* @param policy - The store's current {@link RegionalBasemapPolicy}.
|
|
358
|
+
* @param fallbackStyleUrl - The basemap to apply instead (the default basemap).
|
|
359
|
+
* @param trusted - True when the user already chose this basemap in this
|
|
360
|
+
* session (a template, an undo step, a duplicate), so `"prompt"` does not
|
|
361
|
+
* apply. `"block"` still does.
|
|
362
|
+
* @returns The style URL to apply and, when it was replaced, why.
|
|
363
|
+
*/
|
|
364
|
+
export declare function gateRegionalBasemap(styleUrl: string, policy: RegionalBasemapPolicy, fallbackStyleUrl: string, trusted?: boolean): {
|
|
365
|
+
styleUrl: string;
|
|
366
|
+
held?: RegionalBasemapHold["reason"];
|
|
367
|
+
};
|
|
316
368
|
/**
|
|
317
369
|
* Projections the ArcGIS renderer can draw its flat map in (issue #2708).
|
|
318
370
|
*
|
|
@@ -967,6 +1019,28 @@ export declare function mapZoomStepOutputs(value: unknown, transform: (output: u
|
|
|
967
1019
|
* @returns A `to-number` expression, or `base` when disabled.
|
|
968
1020
|
*/
|
|
969
1021
|
export declare function simpleStyleNumberValue(style: LayerStyle, property: (typeof SIMPLE_STYLE_NUMBER_KEYS)[number], base: number): number | unknown[];
|
|
1022
|
+
/**
|
|
1023
|
+
* Read back the per-feature number lookup {@link simpleStyleNumberValue}
|
|
1024
|
+
* writes, `["to-number", ["coalesce", ["get", key], base], base]` with a
|
|
1025
|
+
* simplestyle number key and a numeric base.
|
|
1026
|
+
*
|
|
1027
|
+
* @param node - A paint value or a node inside one.
|
|
1028
|
+
* @returns The simplestyle key and the layer-level base, or `null` when the
|
|
1029
|
+
* node is not that lookup.
|
|
1030
|
+
*/
|
|
1031
|
+
export declare function readSimpleStyleNumberLookup(node: unknown): {
|
|
1032
|
+
property: (typeof SIMPLE_STYLE_NUMBER_KEYS)[number];
|
|
1033
|
+
base: number;
|
|
1034
|
+
} | null;
|
|
1035
|
+
/**
|
|
1036
|
+
* Whether a paint value reads per-feature simplestyle properties the way the
|
|
1037
|
+
* GeoLibre exporter writes them, anywhere inside it (a lookup can sit inside a
|
|
1038
|
+
* zoom step, a per-rule `case` or an opacity multiplication).
|
|
1039
|
+
*
|
|
1040
|
+
* @param value - A paint value.
|
|
1041
|
+
* @returns `true` when a color or number lookup is found.
|
|
1042
|
+
*/
|
|
1043
|
+
export declare function readsSimpleStyleProperties(value: unknown): boolean;
|
|
970
1044
|
/**
|
|
971
1045
|
* Ground resolution (meters per pixel) at MapLibre zoom 0 on the equator, for
|
|
972
1046
|
* the Web Mercator projection: earth circumference (2*pi*6378137) over the
|
|
@@ -1022,6 +1096,57 @@ export declare function metersWidthExpression(meters: number): unknown[];
|
|
|
1022
1096
|
* @returns A number (constant pixels) or a MapLibre expression array.
|
|
1023
1097
|
*/
|
|
1024
1098
|
export declare function lineWidthValue(style: LayerStyle): number | unknown[];
|
|
1099
|
+
/**
|
|
1100
|
+
* The layer's stroke opacity, clamped to [0, 1]. A missing or non-finite value
|
|
1101
|
+
* (an older project, a hand-edited file) reads as fully opaque.
|
|
1102
|
+
*
|
|
1103
|
+
* @param style - The layer style.
|
|
1104
|
+
* @returns The stroke opacity.
|
|
1105
|
+
*/
|
|
1106
|
+
export declare function strokeOpacityValue(style: LayerStyle): number;
|
|
1107
|
+
/**
|
|
1108
|
+
* A stroke opacity paint value: the layer's {@link LayerStyle.strokeOpacity},
|
|
1109
|
+
* which a per-feature simplestyle `stroke-opacity` replaces when
|
|
1110
|
+
* {@link LayerStyle.simpleStyleEnabled} is set.
|
|
1111
|
+
*
|
|
1112
|
+
* @param style - The layer style.
|
|
1113
|
+
* @returns A number, or the simplestyle lookup expression.
|
|
1114
|
+
*/
|
|
1115
|
+
export declare function strokeOpacityPaintValue(style: LayerStyle): number | unknown[];
|
|
1116
|
+
/**
|
|
1117
|
+
* Whether a value is a usable dash pattern: finite, non-negative lengths with
|
|
1118
|
+
* at least one dash longer than zero. Exported so the style sanitizer and the
|
|
1119
|
+
* importers apply the same rule the renderer does.
|
|
1120
|
+
*
|
|
1121
|
+
* @param value - The candidate pattern.
|
|
1122
|
+
* @returns True when the value can be drawn as a dash pattern.
|
|
1123
|
+
*/
|
|
1124
|
+
export declare function isStrokeDashPattern(value: unknown): value is number[];
|
|
1125
|
+
/**
|
|
1126
|
+
* The `line-dasharray` for the layer, or `null` for a solid line. `null` is
|
|
1127
|
+
* what MapLibre's `setPaintProperty` takes to reset a property, so returning it
|
|
1128
|
+
* (rather than leaving the key out) clears a dash when the user goes back to
|
|
1129
|
+
* solid.
|
|
1130
|
+
*
|
|
1131
|
+
* @param style - The layer style.
|
|
1132
|
+
* @returns The dash pattern, or `null` when the line is solid.
|
|
1133
|
+
*/
|
|
1134
|
+
export declare function strokeDashValue(style: LayerStyle): number[] | null;
|
|
1135
|
+
/**
|
|
1136
|
+
* The {@link STROKE_DASH_PRESETS} name matching a pattern, or `"custom"` when
|
|
1137
|
+
* none does. An empty or unusable pattern is `"solid"`.
|
|
1138
|
+
*
|
|
1139
|
+
* @param dash - A dash pattern.
|
|
1140
|
+
* @returns The preset name, or `"custom"`.
|
|
1141
|
+
*/
|
|
1142
|
+
export declare function strokeDashPresetName(dash: readonly number[] | undefined): StrokeDashPreset | "custom";
|
|
1143
|
+
/**
|
|
1144
|
+
* The layer's line blur in pixels; a missing, negative or non-finite value is 0.
|
|
1145
|
+
*
|
|
1146
|
+
* @param style - The layer style.
|
|
1147
|
+
* @returns The blur in pixels.
|
|
1148
|
+
*/
|
|
1149
|
+
export declare function strokeBlurValue(style: LayerStyle): number;
|
|
1025
1150
|
/**
|
|
1026
1151
|
* Whether a FeatureCollection carries per-feature simplestyle-spec properties
|
|
1027
1152
|
* worth honoring: at least one feature with a valid hex color in a color key
|
|
@@ -1257,18 +1382,44 @@ export declare function vectorCircleColorValue(style: LayerStyle): VectorColorVa
|
|
|
1257
1382
|
*/
|
|
1258
1383
|
export declare function vectorLineColorValue(style: LayerStyle): VectorColorValue;
|
|
1259
1384
|
/**
|
|
1260
|
-
* Resolves the 3D-extrusion height for a layer style
|
|
1261
|
-
* plain meters number, or a data-driven expression.
|
|
1262
|
-
* `
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1266
|
-
*
|
|
1385
|
+
* Resolves the 3D-extrusion height (the roof's altitude) for a layer style
|
|
1386
|
+
* into a MapLibre value: a plain meters number, or a data-driven expression.
|
|
1387
|
+
* With a positive `extrusionFloorHeight` the roof sits that far above the
|
|
1388
|
+
* base (`extrusionBaseValue`, clamped to the ground as MapLibre clamps
|
|
1389
|
+
* `fill-extrusion-base`), whatever the height settings say. Otherwise, in
|
|
1390
|
+
* advanced mode a valid `extrusionHeightExpression` wins; else the height is
|
|
1391
|
+
* the chosen property scaled by `extrusionHeightScale` (`["*", ["to-number",
|
|
1392
|
+
* ["get", prop], 0], scale]`), or a flat `0` when no property is set (so the
|
|
1393
|
+
* layer renders flat rather than erroring). Shared by the map's
|
|
1394
|
+
* fill-extrusion paint and the Add Vector Layer control's extrusion mapping
|
|
1395
|
+
* so both extrude identically.
|
|
1267
1396
|
*
|
|
1268
1397
|
* @param style - The layer style.
|
|
1269
1398
|
* @returns The extrusion height as a number or a MapLibre expression array.
|
|
1270
1399
|
*/
|
|
1271
1400
|
export declare function extrusionHeightValue(style: LayerStyle): number | unknown[];
|
|
1401
|
+
/**
|
|
1402
|
+
* The layer's floor height in metres: a finite `extrusionFloorHeight` above
|
|
1403
|
+
* 0, else 0 (the height is then the roof's altitude). Also 0 for a project
|
|
1404
|
+
* saved before the field existed.
|
|
1405
|
+
*
|
|
1406
|
+
* @param style - The layer style.
|
|
1407
|
+
* @returns The floor height, or 0 when it is off.
|
|
1408
|
+
*/
|
|
1409
|
+
export declare function extrusionFloorHeightValue(style: LayerStyle): number;
|
|
1410
|
+
/**
|
|
1411
|
+
* Resolves the 3D-extrusion base for a layer style into a MapLibre value: a
|
|
1412
|
+
* plain meters number, or a data-driven expression. In advanced mode a valid
|
|
1413
|
+
* `extrusionBaseExpression` wins; otherwise, with `extrusionBaseProperty` set,
|
|
1414
|
+
* the base is `extrusionBase` plus the property scaled by `extrusionBaseScale`
|
|
1415
|
+
* (so floors stack from a `level` field), else the flat `extrusionBase`. Like
|
|
1416
|
+
* {@link extrusionHeightValue} it is an altitude: MapLibre draws a feature
|
|
1417
|
+
* only where its height is above its base.
|
|
1418
|
+
*
|
|
1419
|
+
* @param style - The layer style.
|
|
1420
|
+
* @returns The extrusion base as a number or a MapLibre expression array.
|
|
1421
|
+
*/
|
|
1422
|
+
export declare function extrusionBaseValue(style: LayerStyle): number | unknown[];
|
|
1272
1423
|
/**
|
|
1273
1424
|
* Resolves the 3D-extrusion color for a layer style: a data-driven expression
|
|
1274
1425
|
* when the layer's symbology mode produces one (categorized/graduated/rule/
|
|
@@ -1725,6 +1876,146 @@ export declare function isAdoptedVectorAwaitingFeatures(layer: {
|
|
|
1725
1876
|
metadata: Record<string, unknown>;
|
|
1726
1877
|
geojson?: unknown;
|
|
1727
1878
|
}): boolean;
|
|
1879
|
+
/** Parsed QGIS expression. */
|
|
1880
|
+
export type QgisExpressionNode = {
|
|
1881
|
+
type: "literal";
|
|
1882
|
+
value: string | number | boolean | null;
|
|
1883
|
+
} | {
|
|
1884
|
+
type: "field";
|
|
1885
|
+
name: string;
|
|
1886
|
+
} | {
|
|
1887
|
+
type: "variable";
|
|
1888
|
+
name: string;
|
|
1889
|
+
} | {
|
|
1890
|
+
type: "special";
|
|
1891
|
+
name: string;
|
|
1892
|
+
} | {
|
|
1893
|
+
type: "call";
|
|
1894
|
+
name: string;
|
|
1895
|
+
args: QgisExpressionNode[];
|
|
1896
|
+
} | {
|
|
1897
|
+
type: "unary";
|
|
1898
|
+
op: "-" | "not";
|
|
1899
|
+
arg: QgisExpressionNode;
|
|
1900
|
+
} | {
|
|
1901
|
+
type: "binary";
|
|
1902
|
+
op: QgisBinaryOperator;
|
|
1903
|
+
left: QgisExpressionNode;
|
|
1904
|
+
right: QgisExpressionNode;
|
|
1905
|
+
} | {
|
|
1906
|
+
type: "isNull";
|
|
1907
|
+
arg: QgisExpressionNode;
|
|
1908
|
+
negated: boolean;
|
|
1909
|
+
} | {
|
|
1910
|
+
type: "in";
|
|
1911
|
+
arg: QgisExpressionNode;
|
|
1912
|
+
list: QgisExpressionNode[];
|
|
1913
|
+
negated: boolean;
|
|
1914
|
+
} | {
|
|
1915
|
+
type: "case";
|
|
1916
|
+
branches: {
|
|
1917
|
+
when: QgisExpressionNode;
|
|
1918
|
+
then: QgisExpressionNode;
|
|
1919
|
+
}[];
|
|
1920
|
+
otherwise: QgisExpressionNode | null;
|
|
1921
|
+
};
|
|
1922
|
+
export type QgisBinaryOperator = "or" | "and" | "=" | "<>" | "<" | "<=" | ">" | ">=" | "like" | "ilike" | "+" | "-" | "*" | "/" | "%" | "^" | "||";
|
|
1923
|
+
/** What an expression is evaluated against. */
|
|
1924
|
+
export interface QgisExpressionContext {
|
|
1925
|
+
/** Attribute values of the feature being edited (`"field"` references). */
|
|
1926
|
+
properties?: Record<string, unknown>;
|
|
1927
|
+
/**
|
|
1928
|
+
* `@variable` values. Names are given without the `@`. A variable that is
|
|
1929
|
+
* absent (or `undefined`) evaluates to NULL, as in QGIS.
|
|
1930
|
+
*/
|
|
1931
|
+
variables?: Record<string, unknown>;
|
|
1932
|
+
/** The feature's geometry in WGS84, for `$x`, `$y` and `$geometry`. */
|
|
1933
|
+
geometry?: Geometry | null;
|
|
1934
|
+
/** Clock for `now()`; injectable so tests are deterministic. */
|
|
1935
|
+
now?: () => Date;
|
|
1936
|
+
/** Generator for `uuid()` (bare, without braces); injectable for tests. */
|
|
1937
|
+
uuid?: () => string;
|
|
1938
|
+
/**
|
|
1939
|
+
* Reprojects a `[x, y]` pair for `transform(point, from, to)`. Returning
|
|
1940
|
+
* `null` (or leaving this unset) makes `transform` fail, so a default that
|
|
1941
|
+
* needs a CRS the host cannot resolve is skipped instead of storing
|
|
1942
|
+
* unprojected coordinates under a projected field.
|
|
1943
|
+
*/
|
|
1944
|
+
transform?: (point: [number, number], from: string, to: string) => [number, number] | null;
|
|
1945
|
+
}
|
|
1946
|
+
export type QgisExpressionResult = {
|
|
1947
|
+
ok: true;
|
|
1948
|
+
value: unknown;
|
|
1949
|
+
} | {
|
|
1950
|
+
ok: false;
|
|
1951
|
+
error: string;
|
|
1952
|
+
};
|
|
1953
|
+
export type QgisExpressionParseResult = {
|
|
1954
|
+
ok: true;
|
|
1955
|
+
node: QgisExpressionNode;
|
|
1956
|
+
} | {
|
|
1957
|
+
ok: false;
|
|
1958
|
+
error: string;
|
|
1959
|
+
};
|
|
1960
|
+
/**
|
|
1961
|
+
* Parse a QGIS expression into an AST.
|
|
1962
|
+
*
|
|
1963
|
+
* @param source - The expression text.
|
|
1964
|
+
* @returns The AST, or the first syntax error.
|
|
1965
|
+
*/
|
|
1966
|
+
export declare function parseQgisExpression(source: string): QgisExpressionParseResult;
|
|
1967
|
+
/** The local-time ISO form QGIS writes for a datetime (`2026-11-11T16:05:09`). */
|
|
1968
|
+
export declare function formatQgisDateTime(date: Date): string;
|
|
1969
|
+
/** The local-time ISO date (`2026-11-11`). */
|
|
1970
|
+
export declare function formatQgisDate(date: Date): string;
|
|
1971
|
+
/**
|
|
1972
|
+
* Evaluate a QGIS expression.
|
|
1973
|
+
*
|
|
1974
|
+
* @param source - Expression text, or an AST from {@link parseQgisExpression}.
|
|
1975
|
+
* @param context - Field values, variables, geometry and injectable clock.
|
|
1976
|
+
* @returns The value (possibly `null`), or why it could not be computed.
|
|
1977
|
+
*/
|
|
1978
|
+
export declare function evaluateQgisExpression(source: string | QgisExpressionNode, context?: QgisExpressionContext): QgisExpressionResult;
|
|
1979
|
+
/**
|
|
1980
|
+
* Convert a boolean QGIS expression (a form constraint) into the MapLibre
|
|
1981
|
+
* expression source an {@link AttributeFormFieldConfig.constraintExpression}
|
|
1982
|
+
* stores. Only field references, literals, comparison, boolean logic,
|
|
1983
|
+
* arithmetic and a few string/number functions convert; anything else
|
|
1984
|
+
* (variables, dates, geometry) returns `null` so the importer can report the
|
|
1985
|
+
* constraint as not carried over instead of installing a wrong rule.
|
|
1986
|
+
*
|
|
1987
|
+
* @param source - QGIS constraint expression.
|
|
1988
|
+
* @returns JSON source of an equivalent MapLibre expression, or `null`.
|
|
1989
|
+
*/
|
|
1990
|
+
export declare function qgisExpressionToMapLibre(source: string): string | null;
|
|
1991
|
+
/**
|
|
1992
|
+
* Check, without evaluating, whether an expression stays inside the supported
|
|
1993
|
+
* subset. An importer uses this to decide up front whether a default value
|
|
1994
|
+
* can be carried over, rather than installing one that can never produce a
|
|
1995
|
+
* value.
|
|
1996
|
+
*
|
|
1997
|
+
* @param source - QGIS expression text.
|
|
1998
|
+
* @returns `null` when the expression is usable; otherwise the syntax error,
|
|
1999
|
+
* or the functions and `$` variables it uses that are not supported.
|
|
2000
|
+
*/
|
|
2001
|
+
export declare function qgisExpressionProblem(source: string): string | null;
|
|
2002
|
+
/** What an expression reads, for deciding when its value needs recomputing. */
|
|
2003
|
+
export interface QgisExpressionReferences {
|
|
2004
|
+
/** Field names it reads; `"*"` when a name is only known at run time. */
|
|
2005
|
+
fields: string[];
|
|
2006
|
+
/** Whether it reads the clock (`now()`), which a caller can hold still. */
|
|
2007
|
+
usesNow: boolean;
|
|
2008
|
+
/** Whether it calls `uuid()`, whose value differs on every run. */
|
|
2009
|
+
usesUuid: boolean;
|
|
2010
|
+
}
|
|
2011
|
+
/**
|
|
2012
|
+
* List the fields an expression reads and whether its result changes between
|
|
2013
|
+
* runs with the same inputs.
|
|
2014
|
+
*
|
|
2015
|
+
* @param source - QGIS expression text.
|
|
2016
|
+
* @returns The references, or `null` when the expression does not parse.
|
|
2017
|
+
*/
|
|
2018
|
+
export declare function qgisExpressionReferences(source: string): QgisExpressionReferences | null;
|
|
1728
2019
|
/** Options threaded to expression evaluation (constraints, visibility). */
|
|
1729
2020
|
export interface AttributeFormEvalOptions {
|
|
1730
2021
|
/** Map zoom for `["zoom"]` in expressions; defaults to 0. */
|
|
@@ -1788,6 +2079,22 @@ export declare function coerceAttributeFormValue(config: AttributeFormFieldConfi
|
|
|
1788
2079
|
* (visible) so a typo cannot hide data entry.
|
|
1789
2080
|
*/
|
|
1790
2081
|
export declare function isAttributeFormFieldVisible(config: AttributeFormFieldConfig, properties: Record<string, unknown>, options?: AttributeFormEvalOptions): boolean;
|
|
2082
|
+
/**
|
|
2083
|
+
* Compute the default values a form pre-fills for a new feature. Fields are
|
|
2084
|
+
* evaluated in form order and each result is visible to later expressions, so
|
|
2085
|
+
* a default can build on an earlier one (a photo name built from an ID that
|
|
2086
|
+
* is itself defaulted).
|
|
2087
|
+
*
|
|
2088
|
+
* @param form - The layer's form config.
|
|
2089
|
+
* @param context - Variables, geometry and clock for the expressions; its
|
|
2090
|
+
* `properties` seed the record (values the user already entered).
|
|
2091
|
+
* @param options.skip - Fields to leave alone, e.g. ones the user has edited.
|
|
2092
|
+
* @returns Field name to raw form string, only for fields whose default
|
|
2093
|
+
* evaluated to a non-null value.
|
|
2094
|
+
*/
|
|
2095
|
+
export declare function computeAttributeFormDefaults(form: AttributeFormConfig | undefined, context?: QgisExpressionContext, options?: {
|
|
2096
|
+
skip?: ReadonlySet<string>;
|
|
2097
|
+
}): Record<string, string>;
|
|
1791
2098
|
/**
|
|
1792
2099
|
* Validate one configured field against the candidate properties record (the
|
|
1793
2100
|
* field's own candidate value lives at `properties[config.field]`). Returns
|
|
@@ -1818,6 +2125,54 @@ export declare function validateAttributeFormValues(form: AttributeFormConfig |
|
|
|
1818
2125
|
* @returns The effective config, or `form` itself when there is no service form.
|
|
1819
2126
|
*/
|
|
1820
2127
|
export declare function mergeAttributeFormConfigs(form: AttributeFormConfig | undefined, service: AttributeFormConfig | undefined): AttributeFormConfig | undefined;
|
|
2128
|
+
/** Entries read from a referenced layer, and how their stored values are typed. */
|
|
2129
|
+
export interface RelationValueMap {
|
|
2130
|
+
entries: AttributeFormValueMapEntry[];
|
|
2131
|
+
/**
|
|
2132
|
+
* `"string"` when the key column holds text, so a code such as `"01"` is
|
|
2133
|
+
* stored as text like the rows already in the layer; `"number"` when every
|
|
2134
|
+
* key is numeric.
|
|
2135
|
+
*/
|
|
2136
|
+
valueType: "string" | "number";
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Turn a referenced layer's rows into dropdown entries.
|
|
2140
|
+
*
|
|
2141
|
+
* @param rows - The referenced rows, as plain property records.
|
|
2142
|
+
* @param relation - Which properties hold the stored value and the label.
|
|
2143
|
+
* @param options.maxEntries - Stop once more than this many distinct entries
|
|
2144
|
+
* are found; the result is then longer than the limit and unsorted.
|
|
2145
|
+
* @returns Every distinct entry, sorted by label. The caller decides what to
|
|
2146
|
+
* do with a very long list.
|
|
2147
|
+
*/
|
|
2148
|
+
export declare function buildRelationValueMap(rows: Iterable<Record<string, unknown> | null | undefined>, relation: Omit<AttributeFormValueRelation, "layerId">, options?: {
|
|
2149
|
+
maxEntries?: number;
|
|
2150
|
+
}): RelationValueMap;
|
|
2151
|
+
/** Most entries a live relation dropdown shows; a longer list stays as it was. */
|
|
2152
|
+
export declare const MAX_RELATION_ENTRIES = 1000;
|
|
2153
|
+
/**
|
|
2154
|
+
* Fill relation dropdowns from the layers they reference.
|
|
2155
|
+
*
|
|
2156
|
+
* @param form - The layer's form config.
|
|
2157
|
+
* @param rowsOf - The current feature properties of a layer by id, or
|
|
2158
|
+
* `undefined` when the layer is absent or its features have not loaded.
|
|
2159
|
+
* @returns A form whose relation fields carry entries read from the
|
|
2160
|
+
* referenced layer. A field whose layer is unavailable, or too long for a
|
|
2161
|
+
* list, keeps the entries it already had; one whose layer is loaded but
|
|
2162
|
+
* empty has none. Returns `form` itself when
|
|
2163
|
+
* nothing was resolved.
|
|
2164
|
+
*/
|
|
2165
|
+
export declare function resolveAttributeFormRelations(form: AttributeFormConfig | undefined, rowsOf: (layerId: string) => Iterable<Record<string, unknown> | null> | undefined): AttributeFormConfig | undefined;
|
|
2166
|
+
/**
|
|
2167
|
+
* `metadata` flag on a layer that is a table: its features have attributes
|
|
2168
|
+
* but no geometry (a lookup list, or child records linked to another layer's
|
|
2169
|
+
* features). It draws nothing; its rows show in the attribute table.
|
|
2170
|
+
*/
|
|
2171
|
+
export declare const ATTRIBUTE_TABLE_FLAG = "attributeTable";
|
|
2172
|
+
/** Whether a layer is a geometry-less table (see {@link ATTRIBUTE_TABLE_FLAG}). */
|
|
2173
|
+
export declare function isAttributeTableLayer(layer: {
|
|
2174
|
+
metadata?: Record<string, unknown> | null;
|
|
2175
|
+
}): boolean;
|
|
1821
2176
|
/** STAC specification version the Item export targets. */
|
|
1822
2177
|
export declare const STAC_VERSION = "1.0.0";
|
|
1823
2178
|
/** Schema URL of the STAC processing extension, declared for `processing:lineage`. */
|
|
@@ -2255,7 +2610,7 @@ export declare function hasActiveQuickFilter(layer: GeoLibreLayer): boolean;
|
|
|
2255
2610
|
*/
|
|
2256
2611
|
export declare function clearQuickFilterValues(filters: readonly LayerQuickFilter[] | undefined): LayerQuickFilter[];
|
|
2257
2612
|
/** The layer fields needed to inspect project-authored feature filters. */
|
|
2258
|
-
type LayerFilterSource = Pick<GeoLibreLayer, "filterExpression" | "quickFilters"
|
|
2613
|
+
type LayerFilterSource = Pick<GeoLibreLayer, "filterExpression" | "quickFilters"> & Partial<Pick<GeoLibreLayer, "levelFilter">>;
|
|
2259
2614
|
/**
|
|
2260
2615
|
* Return a layer's persisted expression filter when it has a usable array
|
|
2261
2616
|
* shape, otherwise return null.
|
|
@@ -2266,8 +2621,8 @@ type LayerFilterSource = Pick<GeoLibreLayer, "filterExpression" | "quickFilters"
|
|
|
2266
2621
|
export declare function activeLayerFilterExpression(layer: LayerFilterSource): unknown[] | null;
|
|
2267
2622
|
/**
|
|
2268
2623
|
* Compile all project-authored filters for a layer into one MapLibre boolean
|
|
2269
|
-
* expression. An explicit expression
|
|
2270
|
-
* layer together.
|
|
2624
|
+
* expression. An explicit expression, Quick Filter controls and the floor
|
|
2625
|
+
* picker's choice narrow the layer together.
|
|
2271
2626
|
*
|
|
2272
2627
|
* @param layer - The layer whose authored filters should be composed.
|
|
2273
2628
|
* @returns A MapLibre filter expression, or null when no authored filter is active.
|
|
@@ -2277,10 +2632,292 @@ export declare function compileLayerFilters(layer: LayerFilterSource): unknown[]
|
|
|
2277
2632
|
* Whether a project-authored expression or Quick Filter currently narrows a
|
|
2278
2633
|
* layer. This drives the filtered indicator and clear action in the layer UI.
|
|
2279
2634
|
*
|
|
2635
|
+
* The floor picker's choice is left out on purpose: the picker is its own
|
|
2636
|
+
* on-map control that shows and resets the choice for every linked layer at
|
|
2637
|
+
* once, so a per-layer "clear filters" action must not desynchronize it.
|
|
2638
|
+
* Renderers still apply it through {@link compileLayerFilters}.
|
|
2639
|
+
*
|
|
2280
2640
|
* @param layer - The layer to inspect.
|
|
2281
|
-
* @returns True when at least one persisted
|
|
2641
|
+
* @returns True when at least one persisted expression or Quick Filter is active.
|
|
2282
2642
|
*/
|
|
2283
2643
|
export declare function hasActiveLayerFilter(layer: LayerFilterSource): boolean;
|
|
2644
|
+
/**
|
|
2645
|
+
* A layer's features narrowed by its authored filters (an expression, Quick
|
|
2646
|
+
* Filters, the floor picker), for a renderer that draws GeoJSON itself rather
|
|
2647
|
+
* than through a MapLibre layer filter, such as the deck.gl 3D Z-value path.
|
|
2648
|
+
*
|
|
2649
|
+
* The same collection comes back while no filter is active, and the same
|
|
2650
|
+
* filtered collection while the filter is unchanged, so caches keyed on the
|
|
2651
|
+
* collection keep hitting. A filter that does not compile leaves every
|
|
2652
|
+
* feature in, as MapLibre would refuse it rather than hide the layer.
|
|
2653
|
+
*
|
|
2654
|
+
* @param layer - The layer whose filters apply.
|
|
2655
|
+
* @param geojson - The features to filter.
|
|
2656
|
+
* @param zoom - The zoom a `["zoom"]` expression sees.
|
|
2657
|
+
* @returns The matching features.
|
|
2658
|
+
*/
|
|
2659
|
+
export declare function applyLayerFilters(layer: LayerFilterSource, geojson: FeatureCollection, zoom?: number): FeatureCollection;
|
|
2660
|
+
/**
|
|
2661
|
+
* Floor picker (issue #3341): the levels a multi-floor layer holds, and the
|
|
2662
|
+
* filter that draws one floor (or one floor and those below it).
|
|
2663
|
+
*
|
|
2664
|
+
* Indoor data stores the floor in many shapes. OpenStreetMap's `level` tag is
|
|
2665
|
+
* text and may name several floors (`"0;1"`) or a span (`"-1-2"`); IMDF stores
|
|
2666
|
+
* a numeric `ordinal`; other exports use a plain number. Rather than compile a
|
|
2667
|
+
* MapLibre expression that tries to parse all of these (string splitting has
|
|
2668
|
+
* no expression operator, and `to-number` throws on `"0;1"`), the picker
|
|
2669
|
+
* resolves the choice against the layer's features once and stores the raw
|
|
2670
|
+
* values that match. The compiled filter is then a plain `in` test, which
|
|
2671
|
+
* MapLibre, Mapbox, Cesium and ArcGIS all evaluate with the same style-spec
|
|
2672
|
+
* code.
|
|
2673
|
+
*/
|
|
2674
|
+
/** One floor as the picker lists it. */
|
|
2675
|
+
export interface LevelEntry {
|
|
2676
|
+
/** Canonical label: a number's shortest form (`"1"` for `"01"`), or the trimmed text. */
|
|
2677
|
+
label: string;
|
|
2678
|
+
/** The floor's number, or `null` for a named floor such as `"G"`. */
|
|
2679
|
+
ordinal: number | null;
|
|
2680
|
+
/** How many features sit on this floor (a multi-level feature counts once per floor). */
|
|
2681
|
+
count: number;
|
|
2682
|
+
}
|
|
2683
|
+
/** A feature as far as level parsing needs it. */
|
|
2684
|
+
interface LevelFeature {
|
|
2685
|
+
properties?: Record<string, unknown> | null;
|
|
2686
|
+
}
|
|
2687
|
+
/** A parsed floor token: its canonical label and number. */
|
|
2688
|
+
interface LevelToken {
|
|
2689
|
+
label: string;
|
|
2690
|
+
ordinal: number | null;
|
|
2691
|
+
}
|
|
2692
|
+
/**
|
|
2693
|
+
* Parse one attribute value into the floors it names.
|
|
2694
|
+
*
|
|
2695
|
+
* Numbers are taken as they are. Text is split on `;` (OSM's list separator),
|
|
2696
|
+
* each part read as a number, an integer span such as `0-2` or `-2--1`
|
|
2697
|
+
* (expanded to every floor it covers), or kept as a named floor.
|
|
2698
|
+
*
|
|
2699
|
+
* @param raw - The attribute value.
|
|
2700
|
+
* @returns The floors it names, possibly empty (for `null`, booleans, blanks).
|
|
2701
|
+
*/
|
|
2702
|
+
export declare function parseLevelValue(raw: unknown): LevelToken[];
|
|
2703
|
+
/**
|
|
2704
|
+
* Whether a feature's level value falls on the chosen floor.
|
|
2705
|
+
*
|
|
2706
|
+
* @param raw - The feature's level attribute.
|
|
2707
|
+
* @param level - The chosen floor's label.
|
|
2708
|
+
* @param mode - `only` matches that floor; `below` also matches every
|
|
2709
|
+
* numbered floor under it (a named floor matches only itself). `all`
|
|
2710
|
+
* matches everything.
|
|
2711
|
+
* @returns True when the feature should be drawn.
|
|
2712
|
+
*/
|
|
2713
|
+
export declare function levelValueMatches(raw: unknown, level: string, mode: LevelFilterMode): boolean;
|
|
2714
|
+
/**
|
|
2715
|
+
* The distinct floors a set of features holds in one field, top floor first.
|
|
2716
|
+
*
|
|
2717
|
+
* @param features - The layer's features.
|
|
2718
|
+
* @param field - The property holding the floor.
|
|
2719
|
+
* @returns One entry per floor with its feature count.
|
|
2720
|
+
*/
|
|
2721
|
+
export declare function collectLevels(features: readonly LevelFeature[] | null | undefined, field: string): LevelEntry[];
|
|
2722
|
+
/**
|
|
2723
|
+
* Merge the floor lists of several layers into one, top floor first, summing
|
|
2724
|
+
* the counts of a floor that appears in more than one layer.
|
|
2725
|
+
*
|
|
2726
|
+
* @param lists - One {@link collectLevels} result per linked layer.
|
|
2727
|
+
* @returns The combined floor list.
|
|
2728
|
+
*/
|
|
2729
|
+
export declare function mergeLevels(lists: readonly (readonly LevelEntry[])[]): LevelEntry[];
|
|
2730
|
+
/**
|
|
2731
|
+
* The distinct raw values of `field` that match a floor choice, in first-seen
|
|
2732
|
+
* order. These are what {@link compileLevelFilter} tests with `in`.
|
|
2733
|
+
*
|
|
2734
|
+
* @param features - The layer's features.
|
|
2735
|
+
* @param field - The property holding the floor.
|
|
2736
|
+
* @param level - The chosen floor's label.
|
|
2737
|
+
* @param mode - The floor picker mode.
|
|
2738
|
+
* @returns The matching values (strings and numbers kept as stored).
|
|
2739
|
+
*/
|
|
2740
|
+
export declare function matchingLevelValues(features: readonly LevelFeature[] | null | undefined, field: string, level: string, mode: LevelFilterMode): (string | number)[];
|
|
2741
|
+
/**
|
|
2742
|
+
* Apply a floor choice to a layer's link, resolving the matching values from
|
|
2743
|
+
* the layer's features.
|
|
2744
|
+
*
|
|
2745
|
+
* Without features (a tile-backed layer, or data not loaded yet) the values
|
|
2746
|
+
* stay unresolved, which draws every floor, rather than resolving to an empty
|
|
2747
|
+
* list that would hide the layer once its data arrives.
|
|
2748
|
+
*
|
|
2749
|
+
* @param filter - The layer's current link.
|
|
2750
|
+
* @param features - The layer's features, or `null`/`undefined` when none are loaded.
|
|
2751
|
+
* @param level - The chosen floor's label, or `null` for every floor.
|
|
2752
|
+
* @param mode - The floor picker mode.
|
|
2753
|
+
* @returns The updated link.
|
|
2754
|
+
*/
|
|
2755
|
+
export declare function selectLevel(filter: LayerLevelFilter, features: readonly LevelFeature[] | null | undefined, level: string | null, mode: LevelFilterMode): LayerLevelFilter;
|
|
2756
|
+
/** The floor shown by the picker: a level (`null` for every floor) and a mode. */
|
|
2757
|
+
export interface LevelChoice {
|
|
2758
|
+
level: string | null;
|
|
2759
|
+
mode: LevelFilterMode;
|
|
2760
|
+
}
|
|
2761
|
+
/** A layer as far as the floor picker reads it. */
|
|
2762
|
+
interface LevelLinkedLayer {
|
|
2763
|
+
id: string;
|
|
2764
|
+
levelFilter?: LayerLevelFilter;
|
|
2765
|
+
geojson?: {
|
|
2766
|
+
features: readonly LevelFeature[];
|
|
2767
|
+
} | null;
|
|
2768
|
+
}
|
|
2769
|
+
/**
|
|
2770
|
+
* The floor choice the picker shows: the first linked layer that has a floor
|
|
2771
|
+
* chosen, so a layer linked later (still on `all`) does not reset the display.
|
|
2772
|
+
*
|
|
2773
|
+
* @param linked - The linked layers.
|
|
2774
|
+
* @returns The chosen level and mode, or every floor.
|
|
2775
|
+
*/
|
|
2776
|
+
export declare function currentLevelChoice(linked: readonly LevelLinkedLayer[]): LevelChoice;
|
|
2777
|
+
/**
|
|
2778
|
+
* Whether two links store the same choice, independent of key order (a
|
|
2779
|
+
* project written by the Python API may order the keys differently).
|
|
2780
|
+
*
|
|
2781
|
+
* @param a - One link.
|
|
2782
|
+
* @param b - The other.
|
|
2783
|
+
* @returns True when they draw the same features.
|
|
2784
|
+
*/
|
|
2785
|
+
export declare function sameLevelLink(a: LayerLevelFilter, b: LayerLevelFilter): boolean;
|
|
2786
|
+
/**
|
|
2787
|
+
* The link updates that put every linked layer on one floor choice, with the
|
|
2788
|
+
* matching values resolved from each layer's own features: a layer linked
|
|
2789
|
+
* after a floor was chosen, a project written without the values (the Python
|
|
2790
|
+
* API without inline data), or data that changed since the choice was made.
|
|
2791
|
+
*
|
|
2792
|
+
* @param linked - The linked layers.
|
|
2793
|
+
* @param choice - The floor to apply; defaults to {@link currentLevelChoice}.
|
|
2794
|
+
* @returns One update per layer whose stored link differs.
|
|
2795
|
+
*/
|
|
2796
|
+
export declare function resolveLevelLinks(linked: readonly LevelLinkedLayer[], choice?: LevelChoice): {
|
|
2797
|
+
id: string;
|
|
2798
|
+
levelFilter: LayerLevelFilter;
|
|
2799
|
+
}[];
|
|
2800
|
+
/**
|
|
2801
|
+
* Whether a link narrows the layer: a floor is chosen and its values resolved.
|
|
2802
|
+
*
|
|
2803
|
+
* @param filter - The layer's link, if any.
|
|
2804
|
+
* @returns True when {@link compileLevelFilter} would return a filter.
|
|
2805
|
+
*/
|
|
2806
|
+
export declare function isLevelFilterActive(filter: LayerLevelFilter | null | undefined): boolean;
|
|
2807
|
+
/**
|
|
2808
|
+
* Compile a floor picker link into a MapLibre filter expression.
|
|
2809
|
+
*
|
|
2810
|
+
* @param filter - The layer's link, if any.
|
|
2811
|
+
* @returns An `in` test over the resolved values, or `null` when every floor
|
|
2812
|
+
* is drawn (no link, `all` mode, no floor chosen, or values unresolved).
|
|
2813
|
+
*/
|
|
2814
|
+
export declare function compileLevelFilter(filter: LayerLevelFilter | null | undefined): unknown[] | null;
|
|
2815
|
+
/**
|
|
2816
|
+
* The floor a feature is on, as the floor picker labels it: the first floor its
|
|
2817
|
+
* level value names that the picker lists (a room spanning floors `0;1` goes
|
|
2818
|
+
* to floor 0), or `null` when it names none of them.
|
|
2819
|
+
*
|
|
2820
|
+
* @param raw - The feature's level attribute.
|
|
2821
|
+
* @param levels - The floors the picker lists.
|
|
2822
|
+
* @returns The floor's label, or `null`.
|
|
2823
|
+
*/
|
|
2824
|
+
export declare function featureLevel(raw: unknown, levels: readonly LevelEntry[]): string | null;
|
|
2825
|
+
/**
|
|
2826
|
+
* Guess which field holds the floor.
|
|
2827
|
+
*
|
|
2828
|
+
* @param fields - The layer's field names.
|
|
2829
|
+
* @returns The best candidate, or `null` when none looks like a floor field.
|
|
2830
|
+
*/
|
|
2831
|
+
export declare function guessLevelField(fields: readonly string[]): string | null;
|
|
2832
|
+
/**
|
|
2833
|
+
* List a zip archive's entry paths from its central directory, reading only
|
|
2834
|
+
* the end of the archive (a byte-range reader), never the whole file. Shared by
|
|
2835
|
+
* the plugin file-drop hints and the IMDF detection (issue #3341), so a large
|
|
2836
|
+
* shapefile zip is ruled out without being read.
|
|
2837
|
+
*/
|
|
2838
|
+
export type ReadRange = (offset: number, length: number) => Promise<Uint8Array>;
|
|
2839
|
+
/**
|
|
2840
|
+
* List the paths inside a zip from its central directory, reading only the tail
|
|
2841
|
+
* of the archive rather than the whole file.
|
|
2842
|
+
*
|
|
2843
|
+
* Deliberately not listed (the result is undefined, so a handler can still claim
|
|
2844
|
+
* by file name): archives with bytes in front of them (self-extracting zips),
|
|
2845
|
+
* and spanned or multi-disk archives. The entries are a hint for `claim`, not a full zip
|
|
2846
|
+
* parser; a handler that needs these cases unpacks the file itself in `open`.
|
|
2847
|
+
*
|
|
2848
|
+
* @param size - The archive's size in bytes.
|
|
2849
|
+
* @param readRange - Reads a byte range of the archive.
|
|
2850
|
+
* @returns The entry paths in archive order, or undefined when the file has no
|
|
2851
|
+
* readable central directory (not a zip, or truncated).
|
|
2852
|
+
*/
|
|
2853
|
+
export declare function listZipEntryPaths(size: number, readRange: ReadRange): Promise<string[] | undefined>;
|
|
2854
|
+
/** Whether an archive entry is macOS resource-fork noise (`__MACOSX/`, `._name`). */
|
|
2855
|
+
export declare function isMacOsZipMetadata(path: string): boolean;
|
|
2856
|
+
/**
|
|
2857
|
+
* Whether a list of zip entry paths is an IMDF archive: a `manifest.json` beside
|
|
2858
|
+
* a `venue`, `level` or `unit` GeoJSON file, in any folder, ignoring case and
|
|
2859
|
+
* macOS metadata entries.
|
|
2860
|
+
*
|
|
2861
|
+
* @param paths - The archive's entry paths.
|
|
2862
|
+
* @returns True for an IMDF archive.
|
|
2863
|
+
*/
|
|
2864
|
+
export declare function isImdfArchiveEntries(paths: readonly string[]): boolean;
|
|
2865
|
+
/** A byte-range reader over a `Blob` (or `File`), reading only the slices asked for. */
|
|
2866
|
+
export declare function blobRangeReader(blob: Blob): ReadRange;
|
|
2867
|
+
/** A byte-range reader over bytes already in memory. */
|
|
2868
|
+
export declare function bytesRangeReader(bytes: Uint8Array): ReadRange;
|
|
2869
|
+
/**
|
|
2870
|
+
* Whether an archive of `size` bytes is IMDF, reading only its central
|
|
2871
|
+
* directory through `readRange`.
|
|
2872
|
+
*
|
|
2873
|
+
* @param size - The archive's size in bytes.
|
|
2874
|
+
* @param readRange - Reads a byte range of the archive.
|
|
2875
|
+
* @returns True for an IMDF archive; false for any other zip or a non-zip.
|
|
2876
|
+
*/
|
|
2877
|
+
export declare function isImdfZipRange(size: number, readRange: ReadRange): Promise<boolean>;
|
|
2878
|
+
/**
|
|
2879
|
+
* Whether a `Blob` (a picked or dropped file) is an IMDF zip, reading only its
|
|
2880
|
+
* central directory.
|
|
2881
|
+
*
|
|
2882
|
+
* @param blob - The file.
|
|
2883
|
+
* @returns True for an IMDF archive.
|
|
2884
|
+
*/
|
|
2885
|
+
export declare function isImdfZipBlob(blob: Blob): Promise<boolean>;
|
|
2886
|
+
/** What probing a zip URL found. */
|
|
2887
|
+
export interface ImdfUrlProbe {
|
|
2888
|
+
/** Whether the archive is IMDF. */
|
|
2889
|
+
imdf: boolean;
|
|
2890
|
+
/**
|
|
2891
|
+
* The whole archive when the probe had to download it (a server that ignores
|
|
2892
|
+
* `Range` requests). An IMDF archive is then not downloaded again; a zip that
|
|
2893
|
+
* is not IMDF is downloaded again by the caller's control.
|
|
2894
|
+
*/
|
|
2895
|
+
bytes?: Uint8Array;
|
|
2896
|
+
}
|
|
2897
|
+
/**
|
|
2898
|
+
* Probe a zip URL for IMDF with HTTP range requests: the tail first (which
|
|
2899
|
+
* also gives the archive's size), then the central directory if it starts
|
|
2900
|
+
* before the tail.
|
|
2901
|
+
*
|
|
2902
|
+
* Two hosts need more. One that ignores `Range` answers with the whole file
|
|
2903
|
+
* (status 200); one that serves ranges cross-origin without exposing
|
|
2904
|
+
* `Content-Range` leaves the archive's size unknown. Either way the archive is
|
|
2905
|
+
* read whole instead, up to {@link MAX_PROBE_DOWNLOAD_BYTES}: a larger one is
|
|
2906
|
+
* reported as not IMDF without reading its body, so the control downloads it
|
|
2907
|
+
* once rather than twice. Below the cap, a non-IMDF archive read this way is
|
|
2908
|
+
* downloaded again by the control.
|
|
2909
|
+
*
|
|
2910
|
+
* Detection also needs the page to send `Range` cross-origin: a host whose
|
|
2911
|
+
* preflight refuses it makes the first request reject, which throws here. The
|
|
2912
|
+
* caller then passes the URL to the control, which loads an IMDF zip as a
|
|
2913
|
+
* zipped shapefile.
|
|
2914
|
+
*
|
|
2915
|
+
* @param url - The archive's URL.
|
|
2916
|
+
* @param fetchImpl - `fetch`, injectable for tests.
|
|
2917
|
+
* @returns Whether the archive is IMDF, and its bytes if they were downloaded.
|
|
2918
|
+
* @throws Error when the URL cannot be fetched at all.
|
|
2919
|
+
*/
|
|
2920
|
+
export declare function probeImdfZipUrl(url: string, fetchImpl?: typeof fetch): Promise<ImdfUrlProbe>;
|
|
2284
2921
|
/**
|
|
2285
2922
|
* Default inferred capabilities for a layer based on its type and metadata.
|
|
2286
2923
|
*
|
|
@@ -2631,6 +3268,69 @@ export declare function scaleAltitudeToActiveBody(earthAltitudeMeters: number |
|
|
|
2631
3268
|
* always agree about which unit this view is being described in.
|
|
2632
3269
|
*/
|
|
2633
3270
|
export declare function formatCameraAltitude(meters: number, unit: MapScaleUnit): string;
|
|
3271
|
+
/**
|
|
3272
|
+
* The saved state of an ArcGIS I3S Building Scene Layer (issue #3341), shared
|
|
3273
|
+
* by the deck.gl overlay (`@geolibre/plugins`) and the globe
|
|
3274
|
+
* (`@geolibre/map`'s Cesium sync), so both draw the same sublayers.
|
|
3275
|
+
*
|
|
3276
|
+
* The plugins' `i3s-building.ts` parses the service's sublayer tree into this
|
|
3277
|
+
* shape and stores it as `metadata.i3sBuilding`.
|
|
3278
|
+
*/
|
|
3279
|
+
/** One node of a Building Scene Layer's sublayer tree. */
|
|
3280
|
+
export interface I3sBuildingNode {
|
|
3281
|
+
id: number;
|
|
3282
|
+
name: string;
|
|
3283
|
+
/** The I3S model name: `FullModel`, `Overview`, a discipline or category name. */
|
|
3284
|
+
modelName?: string;
|
|
3285
|
+
/** `group` for a discipline or folder; `3DObject` (or another type) for a drawable leaf. */
|
|
3286
|
+
layerType: string;
|
|
3287
|
+
visible: boolean;
|
|
3288
|
+
children?: I3sBuildingNode[];
|
|
3289
|
+
}
|
|
3290
|
+
/** What `metadata.i3sBuilding` holds for a Building Scene Layer. */
|
|
3291
|
+
export interface I3sBuildingState {
|
|
3292
|
+
/** `overview` draws the Overview sublayer; `full` draws the visible Full Model leaves. */
|
|
3293
|
+
mode: "overview" | "full";
|
|
3294
|
+
/** The Overview sublayer's id, or `null` when the service has none. */
|
|
3295
|
+
overviewId: number | null;
|
|
3296
|
+
/** The Full Model's children (disciplines), or every top-level sublayer when there is no Full Model group. */
|
|
3297
|
+
disciplines: I3sBuildingNode[];
|
|
3298
|
+
}
|
|
3299
|
+
/**
|
|
3300
|
+
* The sublayer ids to draw for a Building Scene Layer.
|
|
3301
|
+
*
|
|
3302
|
+
* @param state - The layer's `metadata.i3sBuilding`.
|
|
3303
|
+
* @returns The Overview id in Overview mode; otherwise every visible 3DObject leaf.
|
|
3304
|
+
*/
|
|
3305
|
+
export declare function visibleI3sBuildingSublayers(state: I3sBuildingState): number[];
|
|
3306
|
+
/**
|
|
3307
|
+
* How far to lower an I3S scene layer onto a map or globe without terrain,
|
|
3308
|
+
* in metres (issue #3374). Shared by the 2D overlay and the globe so the rule
|
|
3309
|
+
* cannot drift between them.
|
|
3310
|
+
*
|
|
3311
|
+
* Scene layers store absolute elevations. Without terrain the ground is at
|
|
3312
|
+
* 0 m, so a layer whose reported lowest elevation (`fullExtent.zmin`) is above
|
|
3313
|
+
* 0 m is lowered by it; one that already reaches 0 m or below (a coastal city)
|
|
3314
|
+
* is left alone. With terrain the absolute heights are kept.
|
|
3315
|
+
*
|
|
3316
|
+
* @param baseElevation - The layer's `fullExtent.zmin`, if known.
|
|
3317
|
+
* @param terrain - Whether the map or globe draws 3D terrain.
|
|
3318
|
+
* @returns The offset (0 or negative).
|
|
3319
|
+
*/
|
|
3320
|
+
export declare function i3sGroundOffset(baseElevation: unknown, terrain: boolean): number;
|
|
3321
|
+
/**
|
|
3322
|
+
* Carry a saved Building selection onto a freshly parsed sublayer tree.
|
|
3323
|
+
*
|
|
3324
|
+
* Re-probing a layer refreshes its tree from the service. The saved mode and
|
|
3325
|
+
* each node's visibility are kept where the node still exists (matched by id);
|
|
3326
|
+
* a node the service added takes its parsed default, and one it removed is
|
|
3327
|
+
* dropped, so the renderer never asks for a sublayer that is gone.
|
|
3328
|
+
*
|
|
3329
|
+
* @param fresh - The tree parsed from the service now.
|
|
3330
|
+
* @param saved - The selection saved on the layer.
|
|
3331
|
+
* @returns The fresh tree with the saved choices applied.
|
|
3332
|
+
*/
|
|
3333
|
+
export declare function mergeI3sBuildingSelection(fresh: I3sBuildingState, saved: I3sBuildingState): I3sBuildingState;
|
|
2634
3334
|
/**
|
|
2635
3335
|
* Layer types whose symbology is driven by the vector {@link LayerStyle}
|
|
2636
3336
|
* fields and can therefore receive a Style Manager entry (or a style-file
|
|
@@ -2651,7 +3351,7 @@ export declare const STYLE_LIBRARY_BUNDLE_VERSION = 1;
|
|
|
2651
3351
|
* adjustments so a symbol preset restyles a layer without dismantling its
|
|
2652
3352
|
* classification or labeling.
|
|
2653
3353
|
*/
|
|
2654
|
-
export declare const SYMBOL_STYLE_KEYS: readonly ["fillColor", "strokeColor", "strokeWidth", "strokeWidthUnit", "fillOpacity", "circleRadius", "fillPattern", "fillPatternColor", "fillPatternSvg", "markerEnabled", "markerShape", "markerColor", "markerSize", "markerSvg"];
|
|
3354
|
+
export declare const SYMBOL_STYLE_KEYS: readonly ["fillColor", "strokeColor", "strokeWidth", "strokeWidthUnit", "strokeOpacity", "strokeDash", "strokeBlur", "fillOpacity", "circleRadius", "fillPattern", "fillPatternColor", "fillPatternSvg", "markerEnabled", "markerShape", "markerColor", "markerSize", "markerSvg"];
|
|
2655
3355
|
/**
|
|
2656
3356
|
* The {@link LayerStyle} keys a `"ramp"` entry captures. The classified
|
|
2657
3357
|
* attribute (`vectorStyleProperty`) and the concrete stops are deliberately
|
|
@@ -3050,6 +3750,11 @@ export interface InitialLayerStyleOptions {
|
|
|
3050
3750
|
geojson?: FeatureCollection;
|
|
3051
3751
|
/** Current project layers, so the new layer gets an unused palette color. */
|
|
3052
3752
|
layers?: readonly GeoLibreLayer[];
|
|
3753
|
+
/**
|
|
3754
|
+
* The layer's geometry family when it is known without `geojson`, as for a
|
|
3755
|
+
* layer whose features live in an external renderer. Wins over `geojson`.
|
|
3756
|
+
*/
|
|
3757
|
+
geometry?: DominantGeometry;
|
|
3053
3758
|
/** Style values that win over the computed defaults (e.g. a restored style). */
|
|
3054
3759
|
overrides?: Partial<LayerStyle>;
|
|
3055
3760
|
}
|
|
@@ -3893,10 +4598,11 @@ export declare function storyLayerOpacityFactor(opacities: Record<string, number
|
|
|
3893
4598
|
* A layer whose opacity reflects the story presentation's fade.
|
|
3894
4599
|
*
|
|
3895
4600
|
* A chapter's opacity *replaces* the layer's own opacity rather than scaling
|
|
3896
|
-
* it, matching `MapController.setStoryLayerOpacity`, which
|
|
3897
|
-
*
|
|
3898
|
-
*
|
|
3899
|
-
*
|
|
4601
|
+
* it, matching `MapController.setStoryLayerOpacity`, which redraws the paint
|
|
4602
|
+
* with the chapter value in place of the layer opacity (the style's own fill
|
|
4603
|
+
* opacity still applies); otherwise a layer set to 0.7 in the Layers panel and
|
|
4604
|
+
* faded to 0.4 by a chapter would draw its diagrams at 0.28 while its MapLibre
|
|
4605
|
+
* layers draw at 0.4.
|
|
3900
4606
|
*
|
|
3901
4607
|
* Returns the same object when the presentation has not touched the layer (or
|
|
3902
4608
|
* recorded the opacity it already has), so identity-keyed caches downstream
|
|
@@ -4174,6 +4880,26 @@ interface LayersSlice {
|
|
|
4174
4880
|
setLayerQuickFilters: (id: string, filters: LayerQuickFilter[]) => void;
|
|
4175
4881
|
/** Set or clear the project-persisted expression filter for a layer. */
|
|
4176
4882
|
setLayerFilterExpression: (id: string, expression: unknown[] | null) => void;
|
|
4883
|
+
/**
|
|
4884
|
+
* Link a layer to the floor picker (issue #3341), or unlink it with `null`.
|
|
4885
|
+
* Linking a layer draws every floor until a floor is chosen.
|
|
4886
|
+
*/
|
|
4887
|
+
setLayerLevelFilter: (id: string, filter: LayerLevelFilter | null) => void;
|
|
4888
|
+
/**
|
|
4889
|
+
* Choose a floor in the floor picker: every linked layer is narrowed to
|
|
4890
|
+
* `level` (`null` for every floor) under `mode`, in one update, with the
|
|
4891
|
+
* matching values resolved from each layer's own features.
|
|
4892
|
+
*/
|
|
4893
|
+
setLevelSelection: (level: string | null, mode: LevelFilterMode) => void;
|
|
4894
|
+
/**
|
|
4895
|
+
* Write floor picker links the picker re-resolved on its own (values missing
|
|
4896
|
+
* from a saved project, or data that changed). Not a user edit: the project
|
|
4897
|
+
* stays clean and, called through `withoutHistory`, no undo step is added.
|
|
4898
|
+
*/
|
|
4899
|
+
reconcileLevelLinks: (updates: {
|
|
4900
|
+
id: string;
|
|
4901
|
+
levelFilter: LayerLevelFilter;
|
|
4902
|
+
}[]) => void;
|
|
4177
4903
|
reorderLayer: (id: string, direction: "up" | "down") => void;
|
|
4178
4904
|
moveLayer: (id: string, targetIndex: number) => void;
|
|
4179
4905
|
moveLayersRelative: (layerIds: string[], targetLayerId: string, position: "above" | "below") => void;
|
|
@@ -4366,6 +5092,47 @@ interface MapViewSlice {
|
|
|
4366
5092
|
setBasemapOpacity: (opacity: number) => void;
|
|
4367
5093
|
setBlankBackgroundColor: (color: string | null) => void;
|
|
4368
5094
|
setPreferences: (preferences: ProjectPreferences) => void;
|
|
5095
|
+
/**
|
|
5096
|
+
* How a regional basemap (served from mainland China) that a loaded project
|
|
5097
|
+
* names is treated; see {@link RegionalBasemapPolicy}. Not project data: the
|
|
5098
|
+
* app sets it once at startup from the deployment policy.
|
|
5099
|
+
*/
|
|
5100
|
+
regionalBasemapPolicy: RegionalBasemapPolicy;
|
|
5101
|
+
/**
|
|
5102
|
+
* The regional basemap the last project load set aside in favour of the
|
|
5103
|
+
* default basemap, or null. The app shell renders a confirmation (or, when
|
|
5104
|
+
* blocked, a notice) from it. Not project data and not in undo history.
|
|
5105
|
+
*/
|
|
5106
|
+
regionalBasemapHold: RegionalBasemapHold | null;
|
|
5107
|
+
/**
|
|
5108
|
+
* Bumped whenever the basemap changes because the user (or code acting for
|
|
5109
|
+
* them) chose it: a basemap setter, or Load on the regional prompt. Not
|
|
5110
|
+
* bumped by project loads, collaboration snapshots or undo. Lets observers
|
|
5111
|
+
* tell a chosen basemap from one that arrived with data, e.g. so a regional
|
|
5112
|
+
* basemap is only remembered for the next launch when it was chosen.
|
|
5113
|
+
*/
|
|
5114
|
+
basemapChoiceGeneration: number;
|
|
5115
|
+
/**
|
|
5116
|
+
* The user's answer to the regional-basemap prompt this session, per
|
|
5117
|
+
* regional style URL (true for Load). A later load naming the same basemap
|
|
5118
|
+
* reuses it instead of asking again, so a host that re-sends its project
|
|
5119
|
+
* (the Jupyter widget on every Python-side change) does not re-prompt.
|
|
5120
|
+
* Session-only: never persisted or saved into a project.
|
|
5121
|
+
*/
|
|
5122
|
+
regionalBasemapAnswers: Record<string, boolean>;
|
|
5123
|
+
/** Set the {@link regionalBasemapPolicy}. Switching to `"block"` drops a pending prompt. */
|
|
5124
|
+
setRegionalBasemapPolicy: (policy: RegionalBasemapPolicy) => void;
|
|
5125
|
+
/**
|
|
5126
|
+
* Answer the held regional basemap. With `load` true and the hold still
|
|
5127
|
+
* belonging to the open project, the regional basemap is applied without
|
|
5128
|
+
* marking the project dirty or recording an undo step (it is what the file
|
|
5129
|
+
* already says). Otherwise the default basemap stays. Either way the hold is
|
|
5130
|
+
* cleared. The answer is remembered for the session unless `remember` is
|
|
5131
|
+
* false (the dialog was dismissed rather than answered).
|
|
5132
|
+
*/
|
|
5133
|
+
resolveRegionalBasemapHold: (load: boolean, options?: {
|
|
5134
|
+
remember?: boolean;
|
|
5135
|
+
}) => void;
|
|
4369
5136
|
}
|
|
4370
5137
|
interface ProcessingSlice {
|
|
4371
5138
|
/** Saved processing pipelines (batch/model chaining; issue #344). */
|
|
@@ -4450,6 +5217,7 @@ interface ProjectSlice {
|
|
|
4450
5217
|
projectName: string;
|
|
4451
5218
|
projectPath: string | null;
|
|
4452
5219
|
projectGeneration: number;
|
|
5220
|
+
projectLoaded: boolean;
|
|
4453
5221
|
isDirty: boolean;
|
|
4454
5222
|
projectPlugins: ProjectPluginState | null;
|
|
4455
5223
|
legend: LegendConfig;
|
|
@@ -4474,9 +5242,20 @@ interface ProjectSlice {
|
|
|
4474
5242
|
layers?: GeoLibreLayer[];
|
|
4475
5243
|
layerGroups?: LayerGroup[];
|
|
4476
5244
|
}) => void;
|
|
5245
|
+
/**
|
|
5246
|
+
* Replace the open project with `project`.
|
|
5247
|
+
*
|
|
5248
|
+
* A regional basemap the project names is gated by `regionalBasemapPolicy`:
|
|
5249
|
+
* under `"prompt"` the default basemap is applied and the regional one is
|
|
5250
|
+
* held in `regionalBasemapHold` for the user to confirm, under `"block"` it is
|
|
5251
|
+
* always replaced. Pass `trustBasemap: true` for a load whose basemap the user
|
|
5252
|
+
* already chose in this session (an undo step, a duplicate, a template, a
|
|
5253
|
+
* host-driven embed load), which skips the prompt but not the block.
|
|
5254
|
+
*/
|
|
4477
5255
|
loadProject: (project: GeoLibreProject, path?: string | null, options?: {
|
|
4478
5256
|
rememberRecent?: boolean;
|
|
4479
5257
|
presenting?: boolean;
|
|
5258
|
+
trustBasemap?: boolean;
|
|
4480
5259
|
}) => void;
|
|
4481
5260
|
setProjectPath: (path: string | null) => void;
|
|
4482
5261
|
setProjectName: (name: string) => void;
|
|
@@ -5056,7 +5835,30 @@ interface GeocodeMatch {
|
|
|
5056
5835
|
* Empty values are left out.
|
|
5057
5836
|
*/
|
|
5058
5837
|
attributes?: Record<string, string | number | boolean>;
|
|
5838
|
+
/**
|
|
5839
|
+
* The extent of the matched place as `[west, south, east, north]` in degrees,
|
|
5840
|
+
* when the service reports one (Nominatim `boundingbox`, a GeoJSON feature's
|
|
5841
|
+
* `bbox`, an ArcGIS candidate's `extent`, Google's `viewport`). A country or
|
|
5842
|
+
* state carries a large box and a street address a tiny one, so a caller can
|
|
5843
|
+
* frame the place instead of guessing a zoom. `west` greater than `east`
|
|
5844
|
+
* means the box crosses the antimeridian.
|
|
5845
|
+
*/
|
|
5846
|
+
bbox?: GeocodeBbox;
|
|
5059
5847
|
}
|
|
5848
|
+
/** A `[west, south, east, north]` extent in degrees. */
|
|
5849
|
+
type GeocodeBbox = [number, number, number, number];
|
|
5850
|
+
/**
|
|
5851
|
+
* Validate a west/south/east/north extent: every edge finite and on Earth,
|
|
5852
|
+
* south not above north. Returns null otherwise, so a malformed box falls back
|
|
5853
|
+
* to the match's point instead of sending the camera somewhere odd.
|
|
5854
|
+
*
|
|
5855
|
+
* @param west - Western longitude.
|
|
5856
|
+
* @param south - Southern latitude.
|
|
5857
|
+
* @param east - Eastern longitude.
|
|
5858
|
+
* @param north - Northern latitude.
|
|
5859
|
+
* @returns The extent, or null when it is not a usable one.
|
|
5860
|
+
*/
|
|
5861
|
+
export declare function normalizeGeocodeBbox(west: unknown, south: unknown, east: unknown, north: unknown): GeocodeBbox | null;
|
|
5060
5862
|
/** A partial-text suggestion from a locator's `suggest` operation. */
|
|
5061
5863
|
interface GeocodeSuggestion {
|
|
5062
5864
|
/** The suggested place, as the locator words it. */
|
|
@@ -5110,6 +5912,8 @@ interface NominatimForwardResult {
|
|
|
5110
5912
|
lon: string;
|
|
5111
5913
|
display_name?: string;
|
|
5112
5914
|
importance?: number | string;
|
|
5915
|
+
/** `[south, north, west, east]` as strings. */
|
|
5916
|
+
boundingbox?: unknown;
|
|
5113
5917
|
[key: string]: unknown;
|
|
5114
5918
|
}
|
|
5115
5919
|
/** A Nominatim reverse-geocoding result (jsonv2). */
|
|
@@ -6197,5 +7001,5 @@ export declare function patchJpegCogSource(source: unknown): unknown;
|
|
|
6197
7001
|
export declare function withJpegTablesPatch<M extends {
|
|
6198
7002
|
openCog: (input: never) => Promise<unknown>;
|
|
6199
7003
|
}>(module: M): M;
|
|
6200
|
-
export { AddTileLayerOptions, AppCapabilities, AppPrivilege, AppRole, type AppState, ApplyLayerJoinsResult, type ArcGISLocatorCapabilities, AttributeFormConfig, AttributeFormFieldConfig, AttributeFormValueMapEntry, AttributeFormWidget, BLANK_BASEMAP, BLEND_MODES, BlendMode, CESIUM_BASEMAPS, CesiumBasemapId, CesiumBasemapImagery, type CesiumIonAssetKind, type CesiumIonLayerOptions, type CesiumIonQuickPick, type CesiumIonQuickPickGroup, type CesiumKmlLayerOptions, CollabInvite, CollaborationChatMessage, CollaborationMode, CollaborationParticipant, CollaborationPresence, CollaborationRole, CollaborationState, CommentAnchor, CommentAuthor, CommentReply, type ConversionToolKind, CreateProjectOptions, type CredentialRedactionResult, type CzmlDocument, type CzmlLayerOptions, type CzmlPacket, type CzmlSource, DEFAULT_BASEMAP, DEFAULT_BLEND_MODE, DEFAULT_DASHBOARD_COLUMNS, DEFAULT_ELLIPSOID_ID, DEFAULT_LAYER_STYLE, DEFAULT_LEGEND_CONFIG, DEFAULT_MAP_GRID_LAYOUT, DEFAULT_PRIMARY_RENDERER, DEFAULT_PRINT_LAYOUT, DEFAULT_PROJECT_NAME, DEFAULT_PROJECT_PREFERENCES, DEFAULT_STORY_MAP, DUCKDB_VECTOR_FEATURE_WARN_COUNT, DUCKDB_VECTOR_ROUTE_BYTES, DashboardWidget, DashboardWidgetAggregation, DashboardWidgetType, DiagramField, DiagramSizeMode, DiagramType, EARTH_MEAN_RADIUS_METERS, ELLIPSOIDS, EditorTrackingConfig, Ellipsoid, EllipsoidId, FeatureChangeSummary, FieldVisibility, FillPattern, GeoArrowBatch, GeoArrowGeometryType, GeoLibreLayer, GeoLibreProject, type GeocodeMatch, type GeocodeRequest, type GeocodeStatus, type GeocodeSuggestion, type GeocoderConfig, GeocodingLocator, type GeocodingPreferenceInput, GeocodingPreferences, type GeocodingProvider, type GeocodingProviderId, type GeocodingTokenProvider, GeometryGeneratorType, type GpsStatusFix, type IdentifyState, IndicatorAggregation, LARGE_VECTOR_FEATURE_THRESHOLD, LAYER_TYPES, LabelAnchor, LabelDedupe, LabelStyle, LabelTransform, LayerCapabilities, LayerConnection, LayerDescriptiveMetadata, LayerDiff, LayerGroup, LayerJoin, LayerJoinStats, LayerLibraryEntry, LayerMetadataContact, LayerMetadataLink, LayerMetadataTemporalExtent, LayerPopupConfig, LayerQuickFilter, LayerStyle, type LayerSummary, LayerType, LayerVirtualField, LegendConfig, LegendCustomEntry, LegendCustomItem, LegendCustomShape, LegendItemOverride, LegendPanelPosition, LineDecoration, MAX_DASHBOARD_COLUMNS, MAX_MAP_GRID_DIM, MAX_PROCESSING_HISTORY, MAX_PROJECT_BOOKMARKS, MIN_DASHBOARD_COLUMNS, MapGridLayout, MapPreferences, MapProjection, MapRendererKind, MapScaleUnit, MapViewState, MarkerShape, ModelGraphEdge, ModelGraphNode, ModelGraphNodeKind, ModelGraphPort, ModelPortKind, ModelToolProvider, NETCDF_IMAGE_SOURCE_KIND, type NetworkToolKind, type NominatimForwardResult, type NominatimReverseResult, NonGeographicCoordinates, OPENFREEMAP_BASEMAPS, PLANETARY_BASEMAPS, PLANETARY_BASEMAP_GROUPS, PLANETARY_BASEMAP_SENTINEL_PREFIX, PLANET_SWITCHER_OPTIONS, PROJECT_VERSION, PROTOMAPS_BASEMAPS, ParticipantIdentity, PlanetaryBasemap, PlanetaryBasemapGroup, PlanetaryBasemapSectionId, PluginDiff, PointRenderer, PolylineBatchOptions, PolylineDecodeResult, PopupDateFormat, PopupFieldConfig, PopupFieldFormat, PopupFieldKind, PrintLayoutConfig, PrintLayoutCorner, PrintLayoutLegendEntry, PrintLayoutPageFilter, ProcessingModel, ProcessingModelGraph, ProcessingModelStep, ProcessingRerunRequest, ProcessingRun, ProcessingRunKind, ProcessingRunStatus, ProjectBookmark, ProjectBookmarkGroup, ProjectComment, ProjectControlSetting, type ProjectCredentialLookup, ProjectDiff, ProjectDiffOptions, ProjectInteraction, ProjectLayerSerializationCache, ProjectPluginControlPosition, ProjectPluginState, ProjectPreferences, ProjectTemplateEntry, ProjectValueChange, QuickFilterDateKind, QuickFilterKind, QuickFilterTextOperator, type RasterToolKind, RecentProjectEntry, type ReverseGeocodeDisplay, RuntimeEnvironmentVariable, SQL_QUERY_SOURCE_KIND, SecondaryMapView, type StatisticsToolKind, StoryActiveSlideMode, StoryChapter, StoryChapterAlignment, StoryChapterAnimation, StoryChapterLocation, StoryInsetPosition, StoryLayerOpacityChange, StoryMap, StorySlideMode, StrokeWidthUnit, StyleLibraryEntry, StyleLibraryEntryKind, VectorRule, VectorStyleMode, VectorStyleStop, type VectorToolKind, applyJoinsToLayer, applyLayerJoins, applyProjectToStore, availableCesiumBasemap, basemapToCesiumImagery, batchDecodePolylines, bodyLengthToEarth, cascadeLayerJoinRefresh, collectTransitiveJoinSourceIds, computeGeoArrowBBox, createDefaultMapView, createDefaultPrintLayout, createEmptyProject, createProjectLayerSerializationCache, createProjectTemplate, decodePolyline, decodePolylineDetailed, detachProjectCopy, detectNonGeographicCoordinates, diffFeatureCollections, diffProjects, earthAreaToBody, earthLengthToBody, encodePolyline, featureCollectionToGeoArrow, geoArrowToFeatureCollection, geoJSONToPolylineStr, geojsonHasZCoordinates, getActiveBodyRadiusRatio, getActiveEllipsoid, getActiveMeanRadiusMeters, getActiveSemiMajorAxisMeters, getEllipsoid, getPlanetaryBasemapById, getPlanetaryBasemapByStyleUrl, horizontalBbox, hydrateProjectLayer, isAllowedPluginManifestUrl, isDefaultPrintLayout, isDuckDBQueryLayer, isGeoArrowBatch, isSessionOnlyLayer, jsonValuesEqual, layerJoinKey, meanRadiusMeters, normalizeBlankBackgroundColor, normalizeBookmarkGroups, normalizeBookmarks, normalizeCesiumBasemap, normalizeDashboardColumns, normalizeLegendConfig, normalizeMapLayout, normalizeMapViewState, normalizeModelGraph, normalizeModels, normalizeObiaWorkbench, normalizePrimaryRenderer, normalizePrintLayoutConfig, normalizeProcessingHistory, normalizeProjectComments, normalizeProjectInteraction, normalizeSecondaryMapViews, normalizeStoryMap, normalizeWidgets, parseProject, polylineStrToGeoJSON, portableWmsTileUrl, previewValue, printLayoutConfigsEqual, projectFromStore, reapplyLayerJoins, resolveMapGrid, sameCesiumImagery, scrubPrintLayoutForLayers, scrubPrintLayoutForRemovedLayers, serializeProject, serializeProjectWithLayerCache, serializeProjectWithLayerCacheAsync, setActiveEllipsoidId, shouldUseTiledRendering, storyMapHasContent, stripJoinFields, styleValue, transformGeojsonElevation, unescapePolyline };
|
|
7004
|
+
export { ARCGIS_IMAGE_SERVICE_SOURCE_KIND, AddTileLayerOptions, AppCapabilities, AppPrivilege, AppRole, type AppState, ApplyLayerJoinsResult, type ArcGISLocatorCapabilities, AttributeFormConfig, AttributeFormFieldConfig, AttributeFormSection, AttributeFormValueMapEntry, AttributeFormValueRelation, AttributeFormWidget, BLANK_BASEMAP, BLEND_MODES, BlendMode, CESIUM_BASEMAPS, CesiumBasemapId, CesiumBasemapImagery, type CesiumIonAssetKind, type CesiumIonLayerOptions, type CesiumIonQuickPick, type CesiumIonQuickPickGroup, type CesiumKmlLayerOptions, CollabInvite, CollaborationChatMessage, CollaborationMode, CollaborationParticipant, CollaborationPresence, CollaborationRole, CollaborationState, CommentAnchor, CommentAuthor, CommentReply, type ConversionToolKind, CreateProjectOptions, type CredentialRedactionResult, type CzmlDocument, type CzmlLayerOptions, type CzmlPacket, type CzmlSource, DEFAULT_BASEMAP, DEFAULT_BLEND_MODE, DEFAULT_DASHBOARD_COLUMNS, DEFAULT_ELLIPSOID_ID, DEFAULT_LAYER_STYLE, DEFAULT_LEGEND_CONFIG, DEFAULT_MAP_GRID_LAYOUT, DEFAULT_PRIMARY_RENDERER, DEFAULT_PRINT_LAYOUT, DEFAULT_PROJECT_NAME, DEFAULT_PROJECT_PREFERENCES, DEFAULT_STORY_MAP, DUCKDB_VECTOR_FEATURE_WARN_COUNT, DUCKDB_VECTOR_ROUTE_BYTES, DashboardWidget, DashboardWidgetAggregation, DashboardWidgetType, DiagramField, DiagramSizeMode, DiagramType, EARTH_MEAN_RADIUS_METERS, ELLIPSOIDS, EditorTrackingConfig, Ellipsoid, EllipsoidId, FeatureChangeSummary, FieldVisibility, FillPattern, GeoArrowBatch, GeoArrowGeometryType, GeoLibreLayer, GeoLibreProject, type GeocodeBbox, type GeocodeMatch, type GeocodeRequest, type GeocodeStatus, type GeocodeSuggestion, type GeocoderConfig, GeocodingLocator, type GeocodingPreferenceInput, GeocodingPreferences, type GeocodingProvider, type GeocodingProviderId, type GeocodingTokenProvider, GeometryGeneratorType, type GpsStatusFix, type IdentifyState, IndicatorAggregation, LARGE_VECTOR_FEATURE_THRESHOLD, LAYER_TYPES, LabelAnchor, LabelDedupe, LabelStyle, LabelTransform, LayerCapabilities, LayerConnection, LayerDescriptiveMetadata, LayerDiff, LayerGroup, LayerJoin, LayerJoinStats, LayerLevelFilter, LayerLibraryEntry, LayerMetadataContact, LayerMetadataLink, LayerMetadataTemporalExtent, LayerPopupConfig, LayerQuickFilter, LayerStyle, type LayerSummary, LayerType, LayerVirtualField, LegendConfig, LegendCustomEntry, LegendCustomItem, LegendCustomShape, LegendItemOverride, LegendPanelPosition, LevelFilterMode, LineDecoration, MAX_DASHBOARD_COLUMNS, MAX_MAP_GRID_DIM, MAX_PROCESSING_HISTORY, MAX_PROJECT_BOOKMARKS, MIN_DASHBOARD_COLUMNS, MapGridLayout, MapPreferences, MapProjection, MapRendererKind, MapScaleUnit, MapViewState, MarkerShape, ModelGraphEdge, ModelGraphNode, ModelGraphNodeKind, ModelGraphPort, ModelPortKind, ModelToolProvider, NETCDF_IMAGE_SOURCE_KIND, type NetworkToolKind, type NominatimForwardResult, type NominatimReverseResult, NonGeographicCoordinates, OPENFREEMAP_BASEMAPS, PLANETARY_BASEMAPS, PLANETARY_BASEMAP_GROUPS, PLANETARY_BASEMAP_SENTINEL_PREFIX, PLANETARY_COMPUTER_SOURCE_KIND, PLANET_SWITCHER_OPTIONS, PROJECT_VERSION, PROTOMAPS_BASEMAPS, ParticipantIdentity, PlanetaryBasemap, PlanetaryBasemapGroup, PlanetaryBasemapSectionId, PluginDiff, PointRenderer, PolylineBatchOptions, PolylineDecodeResult, PopupDateFormat, PopupFieldConfig, PopupFieldFormat, PopupFieldKind, PrintLayoutConfig, PrintLayoutCorner, PrintLayoutLegendEntry, PrintLayoutPageFilter, ProcessingModel, ProcessingModelGraph, ProcessingModelStep, ProcessingRerunRequest, ProcessingRun, ProcessingRunKind, ProcessingRunStatus, ProjectBookmark, ProjectBookmarkGroup, ProjectComment, ProjectControlSetting, type ProjectCredentialLookup, ProjectDiff, ProjectDiffOptions, ProjectInteraction, ProjectLayerSerializationCache, ProjectPluginControlPosition, ProjectPluginState, ProjectPreferences, ProjectTemplateEntry, ProjectValueChange, QuickFilterDateKind, QuickFilterKind, QuickFilterTextOperator, type RasterToolKind, RecentProjectEntry, type ReverseGeocodeDisplay, RuntimeEnvironmentVariable, SQL_QUERY_SOURCE_KIND, STROKE_DASH_PRESETS, SecondaryMapView, type StatisticsToolKind, StoryActiveSlideMode, StoryChapter, StoryChapterAlignment, StoryChapterAnimation, StoryChapterLocation, StoryInsetPosition, StoryLayerOpacityChange, StoryMap, StorySlideMode, StrokeDashPreset, StrokeWidthUnit, StyleLibraryEntry, StyleLibraryEntryKind, VectorRule, VectorStyleMode, VectorStyleStop, type VectorToolKind, applyJoinsToLayer, applyLayerJoins, applyProjectToStore, availableCesiumBasemap, basemapToCesiumImagery, batchDecodePolylines, bodyLengthToEarth, cascadeLayerJoinRefresh, centralAngle, collectTransitiveJoinSourceIds, computeGeoArrowBBox, createDefaultMapView, createDefaultPrintLayout, createEmptyProject, createProjectLayerSerializationCache, createProjectTemplate, decodePolyline, decodePolylineDetailed, detachProjectCopy, detectNonGeographicCoordinates, diffFeatureCollections, diffProjects, earthAreaToBody, earthLengthToBody, encodePolyline, featureCollectionToGeoArrow, geoArrowToFeatureCollection, geoJSONToPolylineStr, geodesicDistance, geodesicLength, geodesicRadiusBounds, geodesicRingArea, geojsonHasZCoordinates, getActiveBodyRadiusRatio, getActiveEllipsoid, getActiveMeanRadiusMeters, getActiveSemiMajorAxisMeters, getEllipsoid, getPlanetaryBasemapById, getPlanetaryBasemapByStyleUrl, horizontalBbox, hydrateProjectLayer, isAllowedPluginManifestUrl, isDefaultPrintLayout, isDuckDBQueryLayer, isGeoArrowBatch, isLonLat, isPlanetaryComputerLayer, isSessionOnlyLayer, jsonValuesEqual, latLonBoxArea, layerJoinKey, meanRadiusMeters, normalizeBlankBackgroundColor, normalizeBookmarkGroups, normalizeBookmarks, normalizeCesiumBasemap, normalizeDashboardColumns, normalizeLegendConfig, normalizeMapLayout, normalizeMapViewState, normalizeModelGraph, normalizeModels, normalizeObiaWorkbench, normalizePrimaryRenderer, normalizePrintLayoutConfig, normalizeProcessingHistory, normalizeProjectComments, normalizeProjectInteraction, normalizeSecondaryMapViews, normalizeStoryMap, normalizeWidgets, parseProject, polylineStrToGeoJSON, portableWmsTileUrl, previewValue, printLayoutConfigsEqual, projectFromStore, reapplyLayerJoins, resolveMapGrid, sameCesiumImagery, scrubPrintLayoutForLayers, scrubPrintLayoutForRemovedLayers, serializeProject, serializeProjectWithLayerCache, serializeProjectWithLayerCacheAsync, setActiveEllipsoidId, shouldUseTiledRendering, storyMapHasContent, stripJoinFields, styleValue, transformGeojsonElevation, unescapePolyline, withI3sSceneLayerKind, withinGeodesicDistance };
|
|
6201
7005
|
//# sourceMappingURL=index.d.mts.map
|