@chrtco/sdk 0.10.45 → 0.10.46
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/CHANGELOG.md +13 -0
- package/dist/atlas/browser.cjs +139 -10
- package/dist/atlas/browser.cjs.map +1 -1
- package/dist/atlas/browser.d.cts +7 -2
- package/dist/atlas/browser.d.ts +7 -2
- package/dist/atlas/browser.js +139 -10
- package/dist/atlas/browser.js.map +1 -1
- package/dist/index.cjs +96 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +155 -1
- package/dist/index.d.ts +155 -1
- package/dist/index.js +89 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2867,6 +2867,46 @@ declare function capLuminance(hex: string, ceiling: number): string;
|
|
|
2867
2867
|
declare const NIGHT_INK: string;
|
|
2868
2868
|
declare const NIGHT_MUTED_INK: string;
|
|
2869
2869
|
|
|
2870
|
+
/**
|
|
2871
|
+
* Is this MapLibre map still there to be written to?
|
|
2872
|
+
*
|
|
2873
|
+
* ===========================================================================
|
|
2874
|
+
* ⚠ ASK AFTER EVERY AWAIT. A MAP CAN BE REMOVED WHILE YOU WERE WAITING.
|
|
2875
|
+
* ===========================================================================
|
|
2876
|
+
*
|
|
2877
|
+
* `map.remove()` deletes `map.style`, and after that nearly every method that
|
|
2878
|
+
* touches the style throws rather than returning: `hasImage`, `addImage`,
|
|
2879
|
+
* `updateImage`, `getSource`, `addLayer` all fail with "Cannot read properties
|
|
2880
|
+
* of undefined (reading 'getImage')" and its siblings. Code that was handed a
|
|
2881
|
+
* map, awaited a decode, an IndexedDB read or a fetch, and then wrote to the
|
|
2882
|
+
* map, throws from wherever it resumed — usually a promise nobody is awaiting,
|
|
2883
|
+
* so the throw is an uncaught error with no caller to explain it.
|
|
2884
|
+
*
|
|
2885
|
+
* Measured in CHRTdesktop (chip 63, 2026-10-04): with the page's main thread
|
|
2886
|
+
* held at 6× CPU, the chart removed its map in the middle of a pan, and the
|
|
2887
|
+
* S-52 image loader resumed onto it:
|
|
2888
|
+
*
|
|
2889
|
+
* TypeError: Cannot read properties of undefined (reading 'getImage')
|
|
2890
|
+
* at Map.hasImage
|
|
2891
|
+
* at addImageToMap (s52-image-cache.ts)
|
|
2892
|
+
*
|
|
2893
|
+
* The rule, for anything in this package or the app that takes a map: after
|
|
2894
|
+
* an `await` (or in a `.then`, a frame callback, an `onload`), check this
|
|
2895
|
+
* before the first call on the map, and stop quietly if it says no. A removed
|
|
2896
|
+
* map is not an error to report — whoever removed it is building the next one.
|
|
2897
|
+
*
|
|
2898
|
+
* ⚠ `_removed`, NOT `style`. maplibre sets `_removed = true` as the last step
|
|
2899
|
+
* of `remove()` (typed on `Map` in maplibre-gl 4 and 5), so it is the fact,
|
|
2900
|
+
* where `style === undefined` is a consequence. Test doubles that never had a
|
|
2901
|
+
* `style` read as live, which is what they are. The app pins the maplibre side
|
|
2902
|
+
* of this (`map-live.test.ts`), so an upgrade that renames the field fails a
|
|
2903
|
+
* test rather than silently making every check say yes.
|
|
2904
|
+
*
|
|
2905
|
+
* Typed `object` so the structural map shapes the app passes around (a tile
|
|
2906
|
+
* census, an errored-tile tracker) can be asked too, not only `maplibregl.Map`.
|
|
2907
|
+
*/
|
|
2908
|
+
declare function isMapLive(map: object): boolean;
|
|
2909
|
+
|
|
2870
2910
|
/** S-52 display categories – controls default visibility */
|
|
2871
2911
|
type DisplayCategory = "BASE" | "STANDARD" | "OTHER" | "MARINERS" | "META";
|
|
2872
2912
|
/** Mapbox GL layer type we'll use for this entry */
|
|
@@ -3753,6 +3793,112 @@ interface BuildSourcesOptions {
|
|
|
3753
3793
|
*/
|
|
3754
3794
|
declare function buildSources(opts?: BuildSourcesOptions): Record<string, AnySourceSpec>;
|
|
3755
3795
|
|
|
3796
|
+
/**
|
|
3797
|
+
* DEPTH NUMBERS — how big the chart draws its depth figures.
|
|
3798
|
+
*
|
|
3799
|
+
* Asked for from the helm (chip 68, 2026-10-05), by a captain running CHRTsail
|
|
3800
|
+
* desktop on a Raspberry Pi: *"I still need the depth numbers to be bolder
|
|
3801
|
+
* which may be a setting. I just can't sail the boat and adjust all that stuff
|
|
3802
|
+
* at the same time."* A set-and-forget choice, then, not a slider.
|
|
3803
|
+
*
|
|
3804
|
+
* ===========================================================================
|
|
3805
|
+
* WHAT "LARGE" CHANGES, AND WHAT IT IS NOT ALLOWED TO TOUCH
|
|
3806
|
+
* ===========================================================================
|
|
3807
|
+
*
|
|
3808
|
+
* It changes the SIZE of the glyphs (and, where a class was Regular, the
|
|
3809
|
+
* WEIGHT, to the Semibold soundings already use), the halo a little — see
|
|
3810
|
+
* `LARGE` for why less than the glyph — and the sounding collision padding —
|
|
3811
|
+
* see `LARGE_SOUNDING_PADDING_PX` for why that one moves.
|
|
3812
|
+
*
|
|
3813
|
+
* It does not touch, and `depth-label-size.test.ts` holds every one of these
|
|
3814
|
+
* equal to the Standard style in every palette and every symbol family:
|
|
3815
|
+
*
|
|
3816
|
+
* - `text-field` — the number itself, its unit conversion, its rounding.
|
|
3817
|
+
* ENC content is never altered; a bigger "4" is still the cell's "4".
|
|
3818
|
+
* - `text-color` / `text-halo-color` — §SOUNDG02's two shades against the
|
|
3819
|
+
* safety contour, and the palette that draws them (red night included:
|
|
3820
|
+
* it IS the NIGHT chart). A depth number shoaler than the contour stays
|
|
3821
|
+
* the loud one.
|
|
3822
|
+
* - `symbol-sort-key` — shallowest wins a collision, at any size.
|
|
3823
|
+
* - `filter`, `minzoom`, `maxzoom`, layer ids and layer order — so the
|
|
3824
|
+
* resident layer set the desktop builds at boot is the same set, and a
|
|
3825
|
+
* switch is `setLayoutProperty` / `setPaintProperty` on layers already
|
|
3826
|
+
* there. No layer and no draw call is added; what costs more is GPU fill,
|
|
3827
|
+
* because a bigger glyph covers more pixels (about 6–7 % more blended
|
|
3828
|
+
* fragments per pixel on the chart bench — the PR has the numbers).
|
|
3829
|
+
*
|
|
3830
|
+
* ===========================================================================
|
|
3831
|
+
* WHICH LABELS ARE "DEPTH NUMBERS"
|
|
3832
|
+
* ===========================================================================
|
|
3833
|
+
*
|
|
3834
|
+
* Exactly the ones the depth-unit switch converts (`buildLabelLayer` in
|
|
3835
|
+
* `layer-builder.ts`): soundings, contour values, and the depth printed beside
|
|
3836
|
+
* a rock, wreck or obstruction. The unit switch already treats those three as
|
|
3837
|
+
* one claim — its own note says a rock's figure "is the SAME depth claim as a
|
|
3838
|
+
* sounding" — and a size switch that enlarged the soundings around a rock but
|
|
3839
|
+
* left the rock's own depth small would make the hazard the quietest number
|
|
3840
|
+
* on that part of the chart.
|
|
3841
|
+
*
|
|
3842
|
+
* Not the dredged-channel note (`DRGNOTE`): it is a sentence fitted inside
|
|
3843
|
+
* its own channel polygon at a computed size, and scaling it would stop it
|
|
3844
|
+
* fitting. Not the bridge note: a clearance is a height, not a depth.
|
|
3845
|
+
*
|
|
3846
|
+
* ===========================================================================
|
|
3847
|
+
* WHY NOT A BOLD FACE
|
|
3848
|
+
* ===========================================================================
|
|
3849
|
+
*
|
|
3850
|
+
* The chart's glyph sets are Open Sans Regular, Semibold and Italic — the tile
|
|
3851
|
+
* worker's `/v1/glyphs` (`cloudflare/tile-worker/glyphs/GLYPHS.json`) and the
|
|
3852
|
+
* offline chart-assets pack serve those three and nothing else, and a
|
|
3853
|
+
* fontstack no glyph host serves is the failure `labels.ts`'s SOUNDG note
|
|
3854
|
+
* describes (Native lost every sounding). Soundings are already Semibold. So "bolder" here is
|
|
3855
|
+
* size: stroke width scales with the glyph, and at 1x device pixels (a Pi's
|
|
3856
|
+
* panel) a 14 px Semibold numeral is both heavier and crisper than a 10 px one.
|
|
3857
|
+
*/
|
|
3858
|
+
|
|
3859
|
+
/** The two choices, in presentation order. */
|
|
3860
|
+
declare const DEPTH_LABEL_SIZES: readonly ["standard", "large"];
|
|
3861
|
+
type DepthLabelSize = (typeof DEPTH_LABEL_SIZES)[number];
|
|
3862
|
+
/**
|
|
3863
|
+
* Standard is the chart as it has always been drawn, and it is what a style
|
|
3864
|
+
* generated without the option gets: byte-identical, so the served style, the
|
|
3865
|
+
* native-render goldens and every client that never asks are unchanged.
|
|
3866
|
+
*/
|
|
3867
|
+
declare const DEFAULT_DEPTH_LABEL_SIZE: DepthLabelSize;
|
|
3868
|
+
/** Case-insensitive; anything unrecognised is `null`, never a throw. */
|
|
3869
|
+
declare function parseDepthLabelSize(raw: string | null | undefined): DepthLabelSize | null;
|
|
3870
|
+
/** The S-57 classes whose label is a depth figure. See the header. */
|
|
3871
|
+
declare const DEPTH_LABEL_CLASSES: ReadonlySet<string>;
|
|
3872
|
+
/**
|
|
3873
|
+
* Sounding collision padding at Large, px. Standard is 6.
|
|
3874
|
+
*
|
|
3875
|
+
* ⚠ THIS IS THE ONE THAT DECIDES HOW MANY SOUNDINGS SURVIVE. MapLibre drops a
|
|
3876
|
+
* sounding whose box (glyphs + padding) overlaps one already placed — the
|
|
3877
|
+
* shallowest places first, so what drops is the deeper figure. A 1.4x numeral
|
|
3878
|
+
* inside Standard's 6 px padding lost a quarter of the soundings: bigger
|
|
3879
|
+
* numbers, fewer of them, which is not what was asked for. Trimming the
|
|
3880
|
+
* padding gives the box back.
|
|
3881
|
+
*
|
|
3882
|
+
* Measured 2026-10-05 on the chart bench (`scripts/chart-bench`, Boston, DAY,
|
|
3883
|
+
* 1280x800 at 1x), soundings placed, Standard → Large at this padding:
|
|
3884
|
+
*
|
|
3885
|
+
* z11.5 515 → 539 (+5%) z12.3 434 → 415 (−4%)
|
|
3886
|
+
* z13 374 → 366 (−2%) z14 326 → 311 (−5%)
|
|
3887
|
+
*
|
|
3888
|
+
* and at Standard's 6 px: 391 / 246 at z11.5 / z14 (−24% / −25%). 3 px kept
|
|
3889
|
+
* z14 level but put 17% MORE figures on the coastal view, which reads as
|
|
3890
|
+
* clutter rather than as the same chart drawn bigger.
|
|
3891
|
+
*/
|
|
3892
|
+
declare const LARGE_SOUNDING_PADDING_PX = 3.5;
|
|
3893
|
+
/**
|
|
3894
|
+
* Apply a depth-label size to one generated label layer.
|
|
3895
|
+
*
|
|
3896
|
+
* Standard — and any class that is not a depth figure — returns the SAME
|
|
3897
|
+
* object, untouched. Large returns a copy with only the properties listed in
|
|
3898
|
+
* the header changed.
|
|
3899
|
+
*/
|
|
3900
|
+
declare function applyDepthLabelSize(objectClass: string, layer: StyleLayer, size: DepthLabelSize | undefined): StyleLayer;
|
|
3901
|
+
|
|
3756
3902
|
/**
|
|
3757
3903
|
* Builds Mapbox GL Style layer specs from S-52 lookup entries.
|
|
3758
3904
|
* Wraps the existing atlas resolveStyle() and adds source/source-layer/filter.
|
|
@@ -3968,6 +4114,14 @@ interface StyleGeneratorOptions extends BuildSourcesOptions {
|
|
|
3968
4114
|
* at small sizes on screen.
|
|
3969
4115
|
*/
|
|
3970
4116
|
soundingFontWeight?: "regular" | "semibold";
|
|
4117
|
+
/**
|
|
4118
|
+
* How big the depth figures are drawn — soundings, contour values and the
|
|
4119
|
+
* depth beside a rock, wreck or obstruction. "standard" (default) is
|
|
4120
|
+
* byte-identical to omitting it; "large" enlarges those labels only, and
|
|
4121
|
+
* never their text, colours, sort keys, filters or layer set. See
|
|
4122
|
+
* depth-label-size.ts.
|
|
4123
|
+
*/
|
|
4124
|
+
depthLabelSize?: DepthLabelSize;
|
|
3971
4125
|
}
|
|
3972
4126
|
declare function generateStyle(palette?: ColorTableName, opts?: StyleGeneratorOptions & {
|
|
3973
4127
|
bandFan?: BandFanMode;
|
|
@@ -5350,4 +5504,4 @@ declare class Chrt {
|
|
|
5350
5504
|
warmTiles(region?: string): Promise<TileTokenResponse>;
|
|
5351
5505
|
}
|
|
5352
5506
|
|
|
5353
|
-
export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_CODE_ALIASES, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, BASE_ATTRIBUTION, BASE_BUNDLE_ATTRIBUTION, BASE_BUNDLE_ID, BASE_BUNDLE_MAXZOOM, BASE_BUNDLE_SCHEMA, BASE_BUNDLE_SOURCE_LAYERS, BASE_CLIENT_RASTER_BEFORE_ID, BASE_MAXZOOM, BASE_MINZOOM, BASE_REGION, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, BUILD_PARAM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, DEPARE_FILL_BRANCH_TOKENS, DEPARE_FILL_FALLBACK_TOKEN, DRAPEABLE_LAYER_TYPES, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, LAMP_CORE_LAYER_ID, LAMP_GLOW_LAYER_ID, LAMP_LAYER_IDS, LAMP_TICK_MS, LAND_ATTRIBUTION, LAND_BUILD_MAXZOOM, LAND_REGION, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LampLayer, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsObservation, type MarineConditionsOptions, type MarineConditionsResponse, type MarineConditionsSeries, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NIGHT_INK, NIGHT_MUTED_INK, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, OPAQUE_SPLIT_OF, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, PLACENAME_LAND_CLASSES, PLACENAME_SOURCE_LAYER, PLACENAME_WATER_CLASSES, type ParsedSigseqTerms, type PmtilesVectorSource, type Poi, type PoiCoverage, type PoiDataset, type PoiOptions, type PoiResponse, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, RELIEF_ATTRIBUTION, RELIEF_ENCODING, RELIEF_REGION, RELIEF_TILE_SIZE, type ResolvedStyle, type ResolvedTheme, type S101ArtworkProvenance, type S101Feature, S101_AREA_FILL_NAMES, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_LINE_STYLE_NAMES, S101_NEW_SYMBOLS, S101_NO_OFFICIAL_COUNTERPART, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SIGPER_TOLERANCE_SECONDS, SIGSEQ_MAX_TERMS, SOUNDING_LAYERS, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SigseqRefusal, type SigseqTerm, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyBaseBundle, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildAirportTierExpression, buildBuiltUpAreaTierExpression, buildFlashPattern, buildLabelLayer, buildLakeTierExpression, buildLampLayers, buildLandAreaTierExpression, buildLandRegionTierExpression, buildLayersForClass, buildOfflineStyle, buildPlaceNameLayers, buildRiverTierExpression, buildSeaAreaTierExpression, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, capLuminance, cellBandCharacters, cellBandMatch, chrtAtonTintExpression, chrtHouseColor, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, contrastRatio, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, depthAreaClassLayerId, depthAreaSplitIds, deriveMarinerName, drapeHalves, drapedFirst, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, isDepthAreaClassLayerId, isDrapeable, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lampRhythmColour, lampRhythmOpacity, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, opaqueSplitBaseOf, paginate, parseListCodes, parseSigseqTerms, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, relativeLuminance, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, rhythmProperties, s101ArtworkProvenance, sanitizeCustomStyleConfig, scaleLinearLight, scaleSizeValue, scaminToMinZoom, sectorLimitToArcBearing, splitOpaqueDepthAreas, styleModeBand, terrainStackCount, themeChrtGlyph, tileTemplate, uncoveredSectorArcs, withinBboxFilter, worldMinusBboxPolygon };
|
|
5507
|
+
export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_CODE_ALIASES, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, BASE_ATTRIBUTION, BASE_BUNDLE_ATTRIBUTION, BASE_BUNDLE_ID, BASE_BUNDLE_MAXZOOM, BASE_BUNDLE_SCHEMA, BASE_BUNDLE_SOURCE_LAYERS, BASE_CLIENT_RASTER_BEFORE_ID, BASE_MAXZOOM, BASE_MINZOOM, BASE_REGION, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, BUILD_PARAM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_DEPTH_LABEL_SIZE, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, DEPARE_FILL_BRANCH_TOKENS, DEPARE_FILL_FALLBACK_TOKEN, DEPTH_LABEL_CLASSES, DEPTH_LABEL_SIZES, DRAPEABLE_LAYER_TYPES, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DepthLabelSize, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, LAMP_CORE_LAYER_ID, LAMP_GLOW_LAYER_ID, LAMP_LAYER_IDS, LAMP_TICK_MS, LAND_ATTRIBUTION, LAND_BUILD_MAXZOOM, LAND_REGION, LARGE_SOUNDING_PADDING_PX, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LampLayer, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsObservation, type MarineConditionsOptions, type MarineConditionsResponse, type MarineConditionsSeries, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NIGHT_INK, NIGHT_MUTED_INK, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, OPAQUE_SPLIT_OF, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, PLACENAME_LAND_CLASSES, PLACENAME_SOURCE_LAYER, PLACENAME_WATER_CLASSES, type ParsedSigseqTerms, type PmtilesVectorSource, type Poi, type PoiCoverage, type PoiDataset, type PoiOptions, type PoiResponse, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, RELIEF_ATTRIBUTION, RELIEF_ENCODING, RELIEF_REGION, RELIEF_TILE_SIZE, type ResolvedStyle, type ResolvedTheme, type S101ArtworkProvenance, type S101Feature, S101_AREA_FILL_NAMES, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_LINE_STYLE_NAMES, S101_NEW_SYMBOLS, S101_NO_OFFICIAL_COUNTERPART, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SIGPER_TOLERANCE_SECONDS, SIGSEQ_MAX_TERMS, SOUNDING_LAYERS, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SigseqRefusal, type SigseqTerm, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyBaseBundle, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyDepthLabelSize, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildAirportTierExpression, buildBuiltUpAreaTierExpression, buildFlashPattern, buildLabelLayer, buildLakeTierExpression, buildLampLayers, buildLandAreaTierExpression, buildLandRegionTierExpression, buildLayersForClass, buildOfflineStyle, buildPlaceNameLayers, buildRiverTierExpression, buildSeaAreaTierExpression, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, capLuminance, cellBandCharacters, cellBandMatch, chrtAtonTintExpression, chrtHouseColor, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, contrastRatio, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, depthAreaClassLayerId, depthAreaSplitIds, deriveMarinerName, drapeHalves, drapedFirst, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, isDepthAreaClassLayerId, isDrapeable, isLabelLayerVisible, isMapLive, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lampRhythmColour, lampRhythmOpacity, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, opaqueSplitBaseOf, paginate, parseDepthLabelSize, parseListCodes, parseSigseqTerms, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, relativeLuminance, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, rhythmProperties, s101ArtworkProvenance, sanitizeCustomStyleConfig, scaleLinearLight, scaleSizeValue, scaminToMinZoom, sectorLimitToArcBearing, splitOpaqueDepthAreas, styleModeBand, terrainStackCount, themeChrtGlyph, tileTemplate, uncoveredSectorArcs, withinBboxFilter, worldMinusBboxPolygon };
|
package/dist/index.d.ts
CHANGED
|
@@ -2867,6 +2867,46 @@ declare function capLuminance(hex: string, ceiling: number): string;
|
|
|
2867
2867
|
declare const NIGHT_INK: string;
|
|
2868
2868
|
declare const NIGHT_MUTED_INK: string;
|
|
2869
2869
|
|
|
2870
|
+
/**
|
|
2871
|
+
* Is this MapLibre map still there to be written to?
|
|
2872
|
+
*
|
|
2873
|
+
* ===========================================================================
|
|
2874
|
+
* ⚠ ASK AFTER EVERY AWAIT. A MAP CAN BE REMOVED WHILE YOU WERE WAITING.
|
|
2875
|
+
* ===========================================================================
|
|
2876
|
+
*
|
|
2877
|
+
* `map.remove()` deletes `map.style`, and after that nearly every method that
|
|
2878
|
+
* touches the style throws rather than returning: `hasImage`, `addImage`,
|
|
2879
|
+
* `updateImage`, `getSource`, `addLayer` all fail with "Cannot read properties
|
|
2880
|
+
* of undefined (reading 'getImage')" and its siblings. Code that was handed a
|
|
2881
|
+
* map, awaited a decode, an IndexedDB read or a fetch, and then wrote to the
|
|
2882
|
+
* map, throws from wherever it resumed — usually a promise nobody is awaiting,
|
|
2883
|
+
* so the throw is an uncaught error with no caller to explain it.
|
|
2884
|
+
*
|
|
2885
|
+
* Measured in CHRTdesktop (chip 63, 2026-10-04): with the page's main thread
|
|
2886
|
+
* held at 6× CPU, the chart removed its map in the middle of a pan, and the
|
|
2887
|
+
* S-52 image loader resumed onto it:
|
|
2888
|
+
*
|
|
2889
|
+
* TypeError: Cannot read properties of undefined (reading 'getImage')
|
|
2890
|
+
* at Map.hasImage
|
|
2891
|
+
* at addImageToMap (s52-image-cache.ts)
|
|
2892
|
+
*
|
|
2893
|
+
* The rule, for anything in this package or the app that takes a map: after
|
|
2894
|
+
* an `await` (or in a `.then`, a frame callback, an `onload`), check this
|
|
2895
|
+
* before the first call on the map, and stop quietly if it says no. A removed
|
|
2896
|
+
* map is not an error to report — whoever removed it is building the next one.
|
|
2897
|
+
*
|
|
2898
|
+
* ⚠ `_removed`, NOT `style`. maplibre sets `_removed = true` as the last step
|
|
2899
|
+
* of `remove()` (typed on `Map` in maplibre-gl 4 and 5), so it is the fact,
|
|
2900
|
+
* where `style === undefined` is a consequence. Test doubles that never had a
|
|
2901
|
+
* `style` read as live, which is what they are. The app pins the maplibre side
|
|
2902
|
+
* of this (`map-live.test.ts`), so an upgrade that renames the field fails a
|
|
2903
|
+
* test rather than silently making every check say yes.
|
|
2904
|
+
*
|
|
2905
|
+
* Typed `object` so the structural map shapes the app passes around (a tile
|
|
2906
|
+
* census, an errored-tile tracker) can be asked too, not only `maplibregl.Map`.
|
|
2907
|
+
*/
|
|
2908
|
+
declare function isMapLive(map: object): boolean;
|
|
2909
|
+
|
|
2870
2910
|
/** S-52 display categories – controls default visibility */
|
|
2871
2911
|
type DisplayCategory = "BASE" | "STANDARD" | "OTHER" | "MARINERS" | "META";
|
|
2872
2912
|
/** Mapbox GL layer type we'll use for this entry */
|
|
@@ -3753,6 +3793,112 @@ interface BuildSourcesOptions {
|
|
|
3753
3793
|
*/
|
|
3754
3794
|
declare function buildSources(opts?: BuildSourcesOptions): Record<string, AnySourceSpec>;
|
|
3755
3795
|
|
|
3796
|
+
/**
|
|
3797
|
+
* DEPTH NUMBERS — how big the chart draws its depth figures.
|
|
3798
|
+
*
|
|
3799
|
+
* Asked for from the helm (chip 68, 2026-10-05), by a captain running CHRTsail
|
|
3800
|
+
* desktop on a Raspberry Pi: *"I still need the depth numbers to be bolder
|
|
3801
|
+
* which may be a setting. I just can't sail the boat and adjust all that stuff
|
|
3802
|
+
* at the same time."* A set-and-forget choice, then, not a slider.
|
|
3803
|
+
*
|
|
3804
|
+
* ===========================================================================
|
|
3805
|
+
* WHAT "LARGE" CHANGES, AND WHAT IT IS NOT ALLOWED TO TOUCH
|
|
3806
|
+
* ===========================================================================
|
|
3807
|
+
*
|
|
3808
|
+
* It changes the SIZE of the glyphs (and, where a class was Regular, the
|
|
3809
|
+
* WEIGHT, to the Semibold soundings already use), the halo a little — see
|
|
3810
|
+
* `LARGE` for why less than the glyph — and the sounding collision padding —
|
|
3811
|
+
* see `LARGE_SOUNDING_PADDING_PX` for why that one moves.
|
|
3812
|
+
*
|
|
3813
|
+
* It does not touch, and `depth-label-size.test.ts` holds every one of these
|
|
3814
|
+
* equal to the Standard style in every palette and every symbol family:
|
|
3815
|
+
*
|
|
3816
|
+
* - `text-field` — the number itself, its unit conversion, its rounding.
|
|
3817
|
+
* ENC content is never altered; a bigger "4" is still the cell's "4".
|
|
3818
|
+
* - `text-color` / `text-halo-color` — §SOUNDG02's two shades against the
|
|
3819
|
+
* safety contour, and the palette that draws them (red night included:
|
|
3820
|
+
* it IS the NIGHT chart). A depth number shoaler than the contour stays
|
|
3821
|
+
* the loud one.
|
|
3822
|
+
* - `symbol-sort-key` — shallowest wins a collision, at any size.
|
|
3823
|
+
* - `filter`, `minzoom`, `maxzoom`, layer ids and layer order — so the
|
|
3824
|
+
* resident layer set the desktop builds at boot is the same set, and a
|
|
3825
|
+
* switch is `setLayoutProperty` / `setPaintProperty` on layers already
|
|
3826
|
+
* there. No layer and no draw call is added; what costs more is GPU fill,
|
|
3827
|
+
* because a bigger glyph covers more pixels (about 6–7 % more blended
|
|
3828
|
+
* fragments per pixel on the chart bench — the PR has the numbers).
|
|
3829
|
+
*
|
|
3830
|
+
* ===========================================================================
|
|
3831
|
+
* WHICH LABELS ARE "DEPTH NUMBERS"
|
|
3832
|
+
* ===========================================================================
|
|
3833
|
+
*
|
|
3834
|
+
* Exactly the ones the depth-unit switch converts (`buildLabelLayer` in
|
|
3835
|
+
* `layer-builder.ts`): soundings, contour values, and the depth printed beside
|
|
3836
|
+
* a rock, wreck or obstruction. The unit switch already treats those three as
|
|
3837
|
+
* one claim — its own note says a rock's figure "is the SAME depth claim as a
|
|
3838
|
+
* sounding" — and a size switch that enlarged the soundings around a rock but
|
|
3839
|
+
* left the rock's own depth small would make the hazard the quietest number
|
|
3840
|
+
* on that part of the chart.
|
|
3841
|
+
*
|
|
3842
|
+
* Not the dredged-channel note (`DRGNOTE`): it is a sentence fitted inside
|
|
3843
|
+
* its own channel polygon at a computed size, and scaling it would stop it
|
|
3844
|
+
* fitting. Not the bridge note: a clearance is a height, not a depth.
|
|
3845
|
+
*
|
|
3846
|
+
* ===========================================================================
|
|
3847
|
+
* WHY NOT A BOLD FACE
|
|
3848
|
+
* ===========================================================================
|
|
3849
|
+
*
|
|
3850
|
+
* The chart's glyph sets are Open Sans Regular, Semibold and Italic — the tile
|
|
3851
|
+
* worker's `/v1/glyphs` (`cloudflare/tile-worker/glyphs/GLYPHS.json`) and the
|
|
3852
|
+
* offline chart-assets pack serve those three and nothing else, and a
|
|
3853
|
+
* fontstack no glyph host serves is the failure `labels.ts`'s SOUNDG note
|
|
3854
|
+
* describes (Native lost every sounding). Soundings are already Semibold. So "bolder" here is
|
|
3855
|
+
* size: stroke width scales with the glyph, and at 1x device pixels (a Pi's
|
|
3856
|
+
* panel) a 14 px Semibold numeral is both heavier and crisper than a 10 px one.
|
|
3857
|
+
*/
|
|
3858
|
+
|
|
3859
|
+
/** The two choices, in presentation order. */
|
|
3860
|
+
declare const DEPTH_LABEL_SIZES: readonly ["standard", "large"];
|
|
3861
|
+
type DepthLabelSize = (typeof DEPTH_LABEL_SIZES)[number];
|
|
3862
|
+
/**
|
|
3863
|
+
* Standard is the chart as it has always been drawn, and it is what a style
|
|
3864
|
+
* generated without the option gets: byte-identical, so the served style, the
|
|
3865
|
+
* native-render goldens and every client that never asks are unchanged.
|
|
3866
|
+
*/
|
|
3867
|
+
declare const DEFAULT_DEPTH_LABEL_SIZE: DepthLabelSize;
|
|
3868
|
+
/** Case-insensitive; anything unrecognised is `null`, never a throw. */
|
|
3869
|
+
declare function parseDepthLabelSize(raw: string | null | undefined): DepthLabelSize | null;
|
|
3870
|
+
/** The S-57 classes whose label is a depth figure. See the header. */
|
|
3871
|
+
declare const DEPTH_LABEL_CLASSES: ReadonlySet<string>;
|
|
3872
|
+
/**
|
|
3873
|
+
* Sounding collision padding at Large, px. Standard is 6.
|
|
3874
|
+
*
|
|
3875
|
+
* ⚠ THIS IS THE ONE THAT DECIDES HOW MANY SOUNDINGS SURVIVE. MapLibre drops a
|
|
3876
|
+
* sounding whose box (glyphs + padding) overlaps one already placed — the
|
|
3877
|
+
* shallowest places first, so what drops is the deeper figure. A 1.4x numeral
|
|
3878
|
+
* inside Standard's 6 px padding lost a quarter of the soundings: bigger
|
|
3879
|
+
* numbers, fewer of them, which is not what was asked for. Trimming the
|
|
3880
|
+
* padding gives the box back.
|
|
3881
|
+
*
|
|
3882
|
+
* Measured 2026-10-05 on the chart bench (`scripts/chart-bench`, Boston, DAY,
|
|
3883
|
+
* 1280x800 at 1x), soundings placed, Standard → Large at this padding:
|
|
3884
|
+
*
|
|
3885
|
+
* z11.5 515 → 539 (+5%) z12.3 434 → 415 (−4%)
|
|
3886
|
+
* z13 374 → 366 (−2%) z14 326 → 311 (−5%)
|
|
3887
|
+
*
|
|
3888
|
+
* and at Standard's 6 px: 391 / 246 at z11.5 / z14 (−24% / −25%). 3 px kept
|
|
3889
|
+
* z14 level but put 17% MORE figures on the coastal view, which reads as
|
|
3890
|
+
* clutter rather than as the same chart drawn bigger.
|
|
3891
|
+
*/
|
|
3892
|
+
declare const LARGE_SOUNDING_PADDING_PX = 3.5;
|
|
3893
|
+
/**
|
|
3894
|
+
* Apply a depth-label size to one generated label layer.
|
|
3895
|
+
*
|
|
3896
|
+
* Standard — and any class that is not a depth figure — returns the SAME
|
|
3897
|
+
* object, untouched. Large returns a copy with only the properties listed in
|
|
3898
|
+
* the header changed.
|
|
3899
|
+
*/
|
|
3900
|
+
declare function applyDepthLabelSize(objectClass: string, layer: StyleLayer, size: DepthLabelSize | undefined): StyleLayer;
|
|
3901
|
+
|
|
3756
3902
|
/**
|
|
3757
3903
|
* Builds Mapbox GL Style layer specs from S-52 lookup entries.
|
|
3758
3904
|
* Wraps the existing atlas resolveStyle() and adds source/source-layer/filter.
|
|
@@ -3968,6 +4114,14 @@ interface StyleGeneratorOptions extends BuildSourcesOptions {
|
|
|
3968
4114
|
* at small sizes on screen.
|
|
3969
4115
|
*/
|
|
3970
4116
|
soundingFontWeight?: "regular" | "semibold";
|
|
4117
|
+
/**
|
|
4118
|
+
* How big the depth figures are drawn — soundings, contour values and the
|
|
4119
|
+
* depth beside a rock, wreck or obstruction. "standard" (default) is
|
|
4120
|
+
* byte-identical to omitting it; "large" enlarges those labels only, and
|
|
4121
|
+
* never their text, colours, sort keys, filters or layer set. See
|
|
4122
|
+
* depth-label-size.ts.
|
|
4123
|
+
*/
|
|
4124
|
+
depthLabelSize?: DepthLabelSize;
|
|
3971
4125
|
}
|
|
3972
4126
|
declare function generateStyle(palette?: ColorTableName, opts?: StyleGeneratorOptions & {
|
|
3973
4127
|
bandFan?: BandFanMode;
|
|
@@ -5350,4 +5504,4 @@ declare class Chrt {
|
|
|
5350
5504
|
warmTiles(region?: string): Promise<TileTokenResponse>;
|
|
5351
5505
|
}
|
|
5352
5506
|
|
|
5353
|
-
export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_CODE_ALIASES, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, BASE_ATTRIBUTION, BASE_BUNDLE_ATTRIBUTION, BASE_BUNDLE_ID, BASE_BUNDLE_MAXZOOM, BASE_BUNDLE_SCHEMA, BASE_BUNDLE_SOURCE_LAYERS, BASE_CLIENT_RASTER_BEFORE_ID, BASE_MAXZOOM, BASE_MINZOOM, BASE_REGION, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, BUILD_PARAM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, DEPARE_FILL_BRANCH_TOKENS, DEPARE_FILL_FALLBACK_TOKEN, DRAPEABLE_LAYER_TYPES, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, LAMP_CORE_LAYER_ID, LAMP_GLOW_LAYER_ID, LAMP_LAYER_IDS, LAMP_TICK_MS, LAND_ATTRIBUTION, LAND_BUILD_MAXZOOM, LAND_REGION, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LampLayer, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsObservation, type MarineConditionsOptions, type MarineConditionsResponse, type MarineConditionsSeries, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NIGHT_INK, NIGHT_MUTED_INK, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, OPAQUE_SPLIT_OF, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, PLACENAME_LAND_CLASSES, PLACENAME_SOURCE_LAYER, PLACENAME_WATER_CLASSES, type ParsedSigseqTerms, type PmtilesVectorSource, type Poi, type PoiCoverage, type PoiDataset, type PoiOptions, type PoiResponse, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, RELIEF_ATTRIBUTION, RELIEF_ENCODING, RELIEF_REGION, RELIEF_TILE_SIZE, type ResolvedStyle, type ResolvedTheme, type S101ArtworkProvenance, type S101Feature, S101_AREA_FILL_NAMES, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_LINE_STYLE_NAMES, S101_NEW_SYMBOLS, S101_NO_OFFICIAL_COUNTERPART, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SIGPER_TOLERANCE_SECONDS, SIGSEQ_MAX_TERMS, SOUNDING_LAYERS, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SigseqRefusal, type SigseqTerm, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyBaseBundle, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildAirportTierExpression, buildBuiltUpAreaTierExpression, buildFlashPattern, buildLabelLayer, buildLakeTierExpression, buildLampLayers, buildLandAreaTierExpression, buildLandRegionTierExpression, buildLayersForClass, buildOfflineStyle, buildPlaceNameLayers, buildRiverTierExpression, buildSeaAreaTierExpression, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, capLuminance, cellBandCharacters, cellBandMatch, chrtAtonTintExpression, chrtHouseColor, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, contrastRatio, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, depthAreaClassLayerId, depthAreaSplitIds, deriveMarinerName, drapeHalves, drapedFirst, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, isDepthAreaClassLayerId, isDrapeable, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lampRhythmColour, lampRhythmOpacity, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, opaqueSplitBaseOf, paginate, parseListCodes, parseSigseqTerms, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, relativeLuminance, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, rhythmProperties, s101ArtworkProvenance, sanitizeCustomStyleConfig, scaleLinearLight, scaleSizeValue, scaminToMinZoom, sectorLimitToArcBearing, splitOpaqueDepthAreas, styleModeBand, terrainStackCount, themeChrtGlyph, tileTemplate, uncoveredSectorArcs, withinBboxFilter, worldMinusBboxPolygon };
|
|
5507
|
+
export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_CODE_ALIASES, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, BASE_ATTRIBUTION, BASE_BUNDLE_ATTRIBUTION, BASE_BUNDLE_ID, BASE_BUNDLE_MAXZOOM, BASE_BUNDLE_SCHEMA, BASE_BUNDLE_SOURCE_LAYERS, BASE_CLIENT_RASTER_BEFORE_ID, BASE_MAXZOOM, BASE_MINZOOM, BASE_REGION, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, BUILD_PARAM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_DEPTH_LABEL_SIZE, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, DEPARE_FILL_BRANCH_TOKENS, DEPARE_FILL_FALLBACK_TOKEN, DEPTH_LABEL_CLASSES, DEPTH_LABEL_SIZES, DRAPEABLE_LAYER_TYPES, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DepthLabelSize, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, LAMP_CORE_LAYER_ID, LAMP_GLOW_LAYER_ID, LAMP_LAYER_IDS, LAMP_TICK_MS, LAND_ATTRIBUTION, LAND_BUILD_MAXZOOM, LAND_REGION, LARGE_SOUNDING_PADDING_PX, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LampLayer, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsObservation, type MarineConditionsOptions, type MarineConditionsResponse, type MarineConditionsSeries, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NIGHT_INK, NIGHT_MUTED_INK, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, OPAQUE_SPLIT_OF, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, PLACENAME_LAND_CLASSES, PLACENAME_SOURCE_LAYER, PLACENAME_WATER_CLASSES, type ParsedSigseqTerms, type PmtilesVectorSource, type Poi, type PoiCoverage, type PoiDataset, type PoiOptions, type PoiResponse, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, RELIEF_ATTRIBUTION, RELIEF_ENCODING, RELIEF_REGION, RELIEF_TILE_SIZE, type ResolvedStyle, type ResolvedTheme, type S101ArtworkProvenance, type S101Feature, S101_AREA_FILL_NAMES, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_LINE_STYLE_NAMES, S101_NEW_SYMBOLS, S101_NO_OFFICIAL_COUNTERPART, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SIGPER_TOLERANCE_SECONDS, SIGSEQ_MAX_TERMS, SOUNDING_LAYERS, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SigseqRefusal, type SigseqTerm, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyBaseBundle, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyDepthLabelSize, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildAirportTierExpression, buildBuiltUpAreaTierExpression, buildFlashPattern, buildLabelLayer, buildLakeTierExpression, buildLampLayers, buildLandAreaTierExpression, buildLandRegionTierExpression, buildLayersForClass, buildOfflineStyle, buildPlaceNameLayers, buildRiverTierExpression, buildSeaAreaTierExpression, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, capLuminance, cellBandCharacters, cellBandMatch, chrtAtonTintExpression, chrtHouseColor, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, contrastRatio, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, depthAreaClassLayerId, depthAreaSplitIds, deriveMarinerName, drapeHalves, drapedFirst, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, isDepthAreaClassLayerId, isDrapeable, isLabelLayerVisible, isMapLive, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lampRhythmColour, lampRhythmOpacity, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, opaqueSplitBaseOf, paginate, parseDepthLabelSize, parseListCodes, parseSigseqTerms, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, relativeLuminance, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, rhythmProperties, s101ArtworkProvenance, sanitizeCustomStyleConfig, scaleLinearLight, scaleSizeValue, scaminToMinZoom, sectorLimitToArcBearing, splitOpaqueDepthAreas, styleModeBand, terrainStackCount, themeChrtGlyph, tileTemplate, uncoveredSectorArcs, withinBboxFilter, worldMinusBboxPolygon };
|
package/dist/index.js
CHANGED
|
@@ -5027,6 +5027,11 @@ function capLuminance(hex, ceiling) {
|
|
|
5027
5027
|
var NIGHT_INK = S52_NIGHT.CHBLK;
|
|
5028
5028
|
var NIGHT_MUTED_INK = scaleLinearLight(S52_NIGHT.CHBLK, 0.43);
|
|
5029
5029
|
|
|
5030
|
+
// src/atlas/map-live.ts
|
|
5031
|
+
function isMapLive(map) {
|
|
5032
|
+
return map._removed !== true;
|
|
5033
|
+
}
|
|
5034
|
+
|
|
5030
5035
|
// src/atlas/s52-linestyles-generated.ts
|
|
5031
5036
|
var S52_LINESTYLES = {
|
|
5032
5037
|
ACHARE51: {
|
|
@@ -27703,6 +27708,67 @@ function iconExpressionForFamily(objectClass, family) {
|
|
|
27703
27708
|
}
|
|
27704
27709
|
}
|
|
27705
27710
|
|
|
27711
|
+
// src/atlas/depth-label-size.ts
|
|
27712
|
+
var DEPTH_LABEL_SIZES = ["standard", "large"];
|
|
27713
|
+
var DEFAULT_DEPTH_LABEL_SIZE = "standard";
|
|
27714
|
+
function parseDepthLabelSize(raw) {
|
|
27715
|
+
if (!raw) return null;
|
|
27716
|
+
const lower = raw.toLowerCase();
|
|
27717
|
+
return DEPTH_LABEL_SIZES.find((s) => s === lower) ?? null;
|
|
27718
|
+
}
|
|
27719
|
+
var DEPTH_LABEL_CLASSES = /* @__PURE__ */ new Set([
|
|
27720
|
+
"SOUNDG",
|
|
27721
|
+
"DEPCNT",
|
|
27722
|
+
"UWTROC",
|
|
27723
|
+
"OBSTRN",
|
|
27724
|
+
"WRECKS"
|
|
27725
|
+
]);
|
|
27726
|
+
var SEMIBOLD = ["Open Sans Semibold"];
|
|
27727
|
+
var HAZARD_DEPTH = {
|
|
27728
|
+
textSize: ["interpolate", ["linear"], ["zoom"], 12, 12, 16, 15],
|
|
27729
|
+
haloWidth: 1.4,
|
|
27730
|
+
font: SEMIBOLD
|
|
27731
|
+
};
|
|
27732
|
+
var LARGE = {
|
|
27733
|
+
// Standard: 7 / 8 / 10 / 12 at z8 / 11 / 14 / 16, halo 1.0, Semibold.
|
|
27734
|
+
SOUNDG: {
|
|
27735
|
+
textSize: ["interpolate", ["linear"], ["zoom"], 8, 10, 11, 11, 14, 14, 16, 17],
|
|
27736
|
+
haloWidth: 1.2,
|
|
27737
|
+
font: SEMIBOLD
|
|
27738
|
+
},
|
|
27739
|
+
// Standard: 8 / 10 at z10 / 14, halo 1.2, Regular.
|
|
27740
|
+
//
|
|
27741
|
+
// ⚠ ~1.2x, NOT 1.4x, AND SEMIBOLD CARRIES THE REST. A contour value rides
|
|
27742
|
+
// its line (`symbol-placement: line`) and needs a straight-enough run to fit;
|
|
27743
|
+
// it also shares rank 300 with the soundings, which place first. At 1.4x the
|
|
27744
|
+
// Boston harbour view kept 15 of Standard's 20 contour labels; at 1.2x, 18.
|
|
27745
|
+
DEPCNT: {
|
|
27746
|
+
textSize: ["interpolate", ["linear"], ["zoom"], 10, 10, 14, 12],
|
|
27747
|
+
haloWidth: 1.2,
|
|
27748
|
+
font: SEMIBOLD
|
|
27749
|
+
},
|
|
27750
|
+
UWTROC: HAZARD_DEPTH,
|
|
27751
|
+
OBSTRN: HAZARD_DEPTH,
|
|
27752
|
+
WRECKS: HAZARD_DEPTH
|
|
27753
|
+
};
|
|
27754
|
+
var LARGE_SOUNDING_PADDING_PX = 3.5;
|
|
27755
|
+
function applyDepthLabelSize(objectClass, layer, size) {
|
|
27756
|
+
if (size !== "large") return layer;
|
|
27757
|
+
const large = LARGE[objectClass];
|
|
27758
|
+
if (large === void 0) return layer;
|
|
27759
|
+
const layout = {
|
|
27760
|
+
...layer.layout ?? {},
|
|
27761
|
+
"text-size": large.textSize,
|
|
27762
|
+
"text-font": [...large.font]
|
|
27763
|
+
};
|
|
27764
|
+
if (objectClass === "SOUNDG") layout["text-padding"] = LARGE_SOUNDING_PADDING_PX;
|
|
27765
|
+
return {
|
|
27766
|
+
...layer,
|
|
27767
|
+
layout,
|
|
27768
|
+
paint: { ...layer.paint, "text-halo-width": large.haloWidth }
|
|
27769
|
+
};
|
|
27770
|
+
}
|
|
27771
|
+
|
|
27706
27772
|
// src/atlas/base-bundle.ts
|
|
27707
27773
|
var BASE_BUNDLE_ID = BASE_REGION;
|
|
27708
27774
|
var BASE_BUNDLE_SCHEMA = "chrt.basemap-bundle/1";
|
|
@@ -29043,7 +29109,7 @@ function buildLabelLayer2(objectClass, ct, sourceId = DEFAULT_REGION, depthUnits
|
|
|
29043
29109
|
if (getLabelBehavior(objectClass) === "orientation-cross-band") {
|
|
29044
29110
|
layer.filter = LABEL_ANCHOR_FILTER;
|
|
29045
29111
|
}
|
|
29046
|
-
return layer;
|
|
29112
|
+
return applyDepthLabelSize(objectClass, layer, labelOpts.depthLabelSize);
|
|
29047
29113
|
}
|
|
29048
29114
|
function getGeomTypesForClass(objectClass, defaultType) {
|
|
29049
29115
|
if (SYMBOL_MAP[objectClass] && defaultType === "symbol") {
|
|
@@ -29392,6 +29458,12 @@ var BASE_THEMES = {
|
|
|
29392
29458
|
// CHRTland's own tan — one land colour
|
|
29393
29459
|
inlandWater: "#B9CFDD",
|
|
29394
29460
|
// muted, unmistakably not a charted blue
|
|
29461
|
+
// The uncharted hatch's stripe, held to 2.3:1 against `inlandWater` in
|
|
29462
|
+
// every palette (`inland-hatch-contrast.test.ts`) — the hatch says "we have
|
|
29463
|
+
// not charted this water", and stripes the eye cannot find say nothing.
|
|
29464
|
+
// DAY 3.08:1, darker than its ground. Also the colour the artwork file
|
|
29465
|
+
// itself is drawn in.
|
|
29466
|
+
inlandHatch: "#5B7383",
|
|
29395
29467
|
// State furniture. These three were referenced by the layers but missing
|
|
29396
29468
|
// from this table (and its type — the long-standing TS2339 trio), so the
|
|
29397
29469
|
// lines shipped on MapLibre's DEFAULT black. Now deliberate: a hairline
|
|
@@ -29422,6 +29494,9 @@ var BASE_THEMES = {
|
|
|
29422
29494
|
boundary: "#293135",
|
|
29423
29495
|
jurisdiction: "#867D64",
|
|
29424
29496
|
inlandWater: "#62717A",
|
|
29497
|
+
// Owner's choice, 2026-10-04: dark stripes, 2.37:1. The DAY stripe here
|
|
29498
|
+
// was 1.02:1 — invisible, so an uncharted lake read as plain water.
|
|
29499
|
+
inlandHatch: "#2E383F",
|
|
29425
29500
|
// Label stays DARK here — the halo is still mid-toned, so 3:1 is reachable
|
|
29426
29501
|
// downward and a bright label would be a new light source at dusk.
|
|
29427
29502
|
stateLine: "#B5A987",
|
|
@@ -29455,6 +29530,10 @@ var BASE_THEMES = {
|
|
|
29455
29530
|
boundary: "#131719",
|
|
29456
29531
|
jurisdiction: "#353128",
|
|
29457
29532
|
inlandWater: "#232A30",
|
|
29533
|
+
// The DAY stripe, lighter than this ground: 2.92:1, and L 0.16, under the
|
|
29534
|
+
// NIGHT muted-ink ceiling (`night-luminance.test.ts`). Red night draws the
|
|
29535
|
+
// NIGHT chart, so this is its stripe too.
|
|
29536
|
+
inlandHatch: "#5B7383",
|
|
29458
29537
|
stateLine: "#484236",
|
|
29459
29538
|
stateLabel: "#837963",
|
|
29460
29539
|
stateHalo: "#353128",
|
|
@@ -30581,7 +30660,8 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
30581
30660
|
label: buildLabelLayer2(objectClass, palette, sourceId, opts.depthUnits ?? "meters", {
|
|
30582
30661
|
safetyContour: opts.safetyContour,
|
|
30583
30662
|
twoShadeSoundings: opts.twoShadeSoundings,
|
|
30584
|
-
soundingFontWeight: opts.soundingFontWeight
|
|
30663
|
+
soundingFontWeight: opts.soundingFontWeight,
|
|
30664
|
+
depthLabelSize: opts.depthLabelSize
|
|
30585
30665
|
})
|
|
30586
30666
|
});
|
|
30587
30667
|
}
|
|
@@ -31927,6 +32007,7 @@ export {
|
|
|
31927
32007
|
ChrtError,
|
|
31928
32008
|
DEFAULT_CLICK_TOLERANCE,
|
|
31929
32009
|
DEFAULT_CUSTOM_STYLE_CONFIG,
|
|
32010
|
+
DEFAULT_DEPTH_LABEL_SIZE,
|
|
31930
32011
|
DEFAULT_INSPECT_CLASS_RANK,
|
|
31931
32012
|
DEFAULT_LABEL_SETTINGS,
|
|
31932
32013
|
DEFAULT_NAV_AID_SETTINGS,
|
|
@@ -31938,6 +32019,8 @@ export {
|
|
|
31938
32019
|
DEFAULT_WATER_BODY_SETTINGS,
|
|
31939
32020
|
DEPARE_FILL_BRANCH_TOKENS,
|
|
31940
32021
|
DEPARE_FILL_FALLBACK_TOKEN,
|
|
32022
|
+
DEPTH_LABEL_CLASSES,
|
|
32023
|
+
DEPTH_LABEL_SIZES,
|
|
31941
32024
|
DRAPEABLE_LAYER_TYPES,
|
|
31942
32025
|
INSPECT_CLASS_RANK,
|
|
31943
32026
|
INSPECT_RANK_DEVIATIONS,
|
|
@@ -31954,6 +32037,7 @@ export {
|
|
|
31954
32037
|
LAND_ATTRIBUTION,
|
|
31955
32038
|
LAND_BUILD_MAXZOOM,
|
|
31956
32039
|
LAND_REGION,
|
|
32040
|
+
LARGE_SOUNDING_PADDING_PX,
|
|
31957
32041
|
NAUTICAL_SYMBOLS,
|
|
31958
32042
|
NAV_AID_LAYER_GROUPS,
|
|
31959
32043
|
NAV_AID_QUERY_LAYERS,
|
|
@@ -32008,6 +32092,7 @@ export {
|
|
|
32008
32092
|
applyChrtSymbolSet,
|
|
32009
32093
|
applyColorTheme,
|
|
32010
32094
|
applyCustomStyleSettings,
|
|
32095
|
+
applyDepthLabelSize,
|
|
32011
32096
|
applyRasterSymbolSet,
|
|
32012
32097
|
applyS101SymbolSet,
|
|
32013
32098
|
atonIconExpression,
|
|
@@ -32088,6 +32173,7 @@ export {
|
|
|
32088
32173
|
isDepthAreaClassLayerId,
|
|
32089
32174
|
isDrapeable,
|
|
32090
32175
|
isLabelLayerVisible,
|
|
32176
|
+
isMapLive,
|
|
32091
32177
|
isNavAidLayer,
|
|
32092
32178
|
isNavAidLayerVisible,
|
|
32093
32179
|
isSoundingLayerVisible,
|
|
@@ -32105,6 +32191,7 @@ export {
|
|
|
32105
32191
|
normalizeTheme,
|
|
32106
32192
|
opaqueSplitBaseOf,
|
|
32107
32193
|
paginate,
|
|
32194
|
+
parseDepthLabelSize,
|
|
32108
32195
|
parseListCodes,
|
|
32109
32196
|
parseSigseqTerms,
|
|
32110
32197
|
parseSymbolFamily,
|