@massif-maps/web 6.1.0-rc.1

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.
@@ -0,0 +1,2459 @@
1
+ // ../../bindings/js/dist/observable.js
2
+ var Observable = class {
3
+ constructor() {
4
+ this.mListeners = {};
5
+ }
6
+ on(eventNames2, callback, thisArg) {
7
+ this.addEventListener(eventNames2, callback, thisArg);
8
+ }
9
+ once(eventNames2, callback, thisArg) {
10
+ this.addEventListener(eventNames2, callback, thisArg, true);
11
+ }
12
+ off(eventNames2, callback, thisArg) {
13
+ this.removeEventListener(eventNames2, callback, thisArg);
14
+ }
15
+ /** `eventNames` may list several, comma-separated, as NativeScript's does. */
16
+ addEventListener(eventNames2, callback, thisArg, once = false) {
17
+ var _a;
18
+ for (const name of names(eventNames2)) {
19
+ ((_a = this.mListeners)[name] ?? (_a[name] = [])).push({ callback, thisArg, once });
20
+ }
21
+ }
22
+ removeEventListener(eventNames2, callback, thisArg) {
23
+ for (const name of names(eventNames2)) {
24
+ const kept = (this.mListeners[name] ?? []).filter((l) => callback && (l.callback !== callback || thisArg !== void 0 && l.thisArg !== thisArg));
25
+ if (kept.length) {
26
+ this.mListeners[name] = kept;
27
+ } else {
28
+ delete this.mListeners[name];
29
+ }
30
+ }
31
+ }
32
+ hasListeners(eventName) {
33
+ return !!this.mListeners[eventName]?.length;
34
+ }
35
+ notify(data) {
36
+ const listeners = this.mListeners[data.eventName];
37
+ if (!listeners) {
38
+ return;
39
+ }
40
+ for (const listener of listeners.slice()) {
41
+ if (listener.once) {
42
+ this.removeEventListener(data.eventName, listener.callback, listener.thisArg);
43
+ }
44
+ listener.callback.call(listener.thisArg, data);
45
+ }
46
+ }
47
+ };
48
+ function names(eventNames2) {
49
+ return eventNames2.split(",").map((name) => name.trim()).filter(Boolean);
50
+ }
51
+
52
+ // ../../bindings/js/dist/bridge.js
53
+ var UNAVAILABLE = { available: false, canConsume: false };
54
+ var bridge = UNAVAILABLE;
55
+ function setBridge(platform) {
56
+ bridge = platform;
57
+ }
58
+
59
+ // ../../bindings/js/dist/schema.js
60
+ var PROPS = {
61
+ "massif::Address": "categories,t;country,s;county,s;houseNumber,s;locality,s;name,s;neighbourhood,s;postcode,s;region,s;street,s",
62
+ "massif::AnimationStyle": "fadeAnimationType,e,AnimationType;phaseInDuration,f;phaseOutDuration,f;relativeSpeed,f;sizeAnimationType,e,AnimationType",
63
+ "massif::AnimationStyleBuilder": "fadeAnimationType,e,AnimationType;phaseInDuration,f;phaseOutDuration,f;relativeSpeed,f;sizeAnimationType,e,AnimationType",
64
+ "massif::AssetPackage": "assetNames,t",
65
+ "massif::BalloonPopup": "balloonPopupEventListener,o,massif::BalloonPopupEventListener;description,s;style,o,massif::BalloonPopupStyle;title,s",
66
+ "massif::BalloonPopupButton": "style,o,massif::BalloonPopupButtonStyle;tag,v;text,s",
67
+ "massif::BalloonPopupButtonClickInfo": "button,o,massif::BalloonPopupButton;clickInfo,t;clickType,e,ClickType;vectorElement,o,massif::VectorElement",
68
+ "massif::BalloonPopupButtonStyle": "backgroundColor,c;buttonWidth,i;cornerRadius,i;strokeColor,c;strokeWidth,i;textColor,c;textFontName,s;textFontSize,i;textMargins,t",
69
+ "massif::BalloonPopupButtonStyleBuilder": "buttonWidth,i;cornerRadius,i;strokeColor,c;strokeWidth,i;textColor,c;textFontName,s;textFontSize,i;textMargins,t",
70
+ "massif::BalloonPopupMargins": "bottom,i;left,i;right,i;top,i",
71
+ "massif::BalloonPopupStyle": "backgroundColor,c;buttonMargins,t;cornerRadius,i;descriptionColor,c;descriptionField,s;descriptionFontName,s;descriptionFontSize,i;descriptionMargins,t;descriptionWrap,b;leftColor,c;leftImage,o,massif::Bitmap;leftMargins,t;rightColor,c;rightImage,o,massif::Bitmap;rightMargins,t;strokeColor,c;strokeWidth,i;titleColor,c;titleField,s;titleFontName,s;titleFontSize,i;titleMargins,t;titleWrap,b;triangleHeight,i;triangleWidth,i",
72
+ "massif::BalloonPopupStyleBuilder": "buttonMargins,t;cornerRadius,i;descriptionColor,c;descriptionField,s;descriptionFontName,s;descriptionFontSize,i;descriptionMargins,t;descriptionWrap,b;leftColor,c;leftImage,o,massif::Bitmap;leftMargins,t;rightColor,c;rightImage,o,massif::Bitmap;rightMargins,t;strokeColor,c;strokeWidth,i;titleColor,c;titleField,s;titleFontName,s;titleFontSize,i;titleMargins,t;titleWrap,b;triangleHeight,i;triangleWidth,i",
73
+ "massif::BaseMapView": "cameraPos,p;flightActive,b;flightProgress,f;focusPos,p;mapRenderer,o,massif::MapRenderer;rotation,f;tilt,f;zoom,f",
74
+ "massif::Billboard": "baseBillboard,o,massif::Billboard;bounds,p;geometry,o,massif::Geometry;rootGeometry,o,massif::Geometry;rotation,f",
75
+ "massif::BillboardStyle": "animationStyle,o,massif::AnimationStyle;attachAnchorPointX,f;attachAnchorPointY,f;causesOverlap,b;hideIfOverlapped,b;horizontalOffset,f;placementPriority,i;scaleWithDPI,b;verticalOffset,f",
76
+ "massif::BillboardStyleBuilder": "animationStyle,o,massif::AnimationStyle;attachAnchorPointX,f;attachAnchorPointY,f;causesOverlap,b;hideIfOverlapped,b;horizontalOffset,f;placementPriority,i;scaleWithDPI,b;verticalOffset,f",
77
+ "massif::BinaryData": "size,i",
78
+ "massif::Bitmap": "bytesPerPixel,i;colorFormat,e,ColorFormat;height,i;width,i",
79
+ "massif::BundleAssetPackage": "basePath,s;localAssetNames,t",
80
+ "massif::CacheTileDataSource": "capacity,i;dataSource,o,massif::TileDataSource",
81
+ "massif::CartoCSSStyleSet": "assetPackage,o,massif::AssetPackage;cartoCSS,s",
82
+ "massif::CelestialArc": "belowHorizonVisible,b;clickRadius,f;radius,f;segmented,b;width,f",
83
+ "massif::CelestialClickInfo": "altitude,f;azimuth,f;celestialObject,o,massif::CelestialObject;clickInfo,t;clickType,e,ClickType",
84
+ "massif::CelestialImage": "bitmap,o,massif::Bitmap;luminanceAlpha,b",
85
+ "massif::CelestialLabel": "anchorPointX,f;anchorPointY,f;backgroundColor,c;backgroundRadius,f;clickable,b;fontName,s;fontSize,f;haloColor,c;haloWidth,f;offsetX,f;offsetY,f;paddingX,f;paddingY,f;text,s;textColor,c",
86
+ "massif::CelestialLayer": "celestialEventListener,o,massif::CelestialEventListener",
87
+ "massif::CelestialObject": "altitude,f;azimuth,f;color,c;directionAnchored,b;distance,f;metaData,g,v;occludedByMap,b;position,p;positionAltitude,f;visible,b",
88
+ "massif::CelestialSprite": "angularSize,f;bitmap,o,massif::Bitmap;clickRadius,f;screenSize,f;softness,f",
89
+ "massif::ClickInfo": "clickType,e,ClickType;duration,f",
90
+ "massif::ClusteredVectorLayer": "animatedClusters,b;clusterElementBuilder,o,massif::ClusterElementBuilder;maximumClusterZoom,f;minimumClusterDistance,f",
91
+ "massif::Color": "ARGB,i;a,i;b,i;g,i;r,i",
92
+ "massif::CompiledStyleSet": "assetPackage,o,massif::AssetPackage;styleAssetName,s;styleName,s",
93
+ "massif::ContourTileDataSource": "baseInterval,f;labelInterval,f;labelStubsEnabled,b;layerName,s;minVisibleZoom,i;resolution,i;seamlessEdgesEnabled,b;simplifyTolerance,f;terrainOptions,o,massif::TerrainOptions",
94
+ "massif::CullState": "viewState,t",
95
+ "massif::CustomPopup": "popupHandler,o,massif::CustomPopupHandler",
96
+ "massif::CustomRasterTileLayer": "shaderSource,s",
97
+ "massif::DirAssetPackage": "dirPath,s;localAssetNames,t",
98
+ "massif::EditableVectorLayer": "selectedVectorElement,o,massif::VectorElement;vectorEditEventListener,o,massif::VectorEditEventListener",
99
+ "massif::Feature": "geometry,o,massif::Geometry;geometryGeoJSON,s;properties,v",
100
+ "massif::FeatureBuilder": "geometry,o,massif::Geometry",
101
+ "massif::FeatureCollection": "featureCount,i",
102
+ "massif::FeatureCollectionSearchService": "featureCollection,o,massif::FeatureCollection;maxResults,i;projection,o,massif::Projection",
103
+ "massif::FogOptions": "color,c;enabled,b;highColor,c;horizonBlend,f;rangeEnd,f;rangeStart,f;shaderSource,s;spaceColor,c;starIntensity,f;verticalRangeEnd,f;verticalRangeStart,f",
104
+ "massif::GeoJSONGeometryReader": "targetProjection,o,massif::Projection",
105
+ "massif::GeoJSONGeometryWriter": "sourceProjection,o,massif::Projection;z,b",
106
+ "massif::GeoJSONVectorTileDataSource": "defaultLayerBuffer,f;simplifyTolerance,f",
107
+ "massif::GeocodingRequest": "location,p;locationRadius,f;projection,o,massif::Projection;query,s",
108
+ "massif::GeocodingResult": "address,t;featureCollection,o,massif::FeatureCollection;projection,o,massif::Projection;rank,f",
109
+ "massif::GeocodingService": "autocomplete,b;language,s;maxResults,i",
110
+ "massif::Geometry": "bounds,p;centerPos,p;geoJSON,s;type,e,GeometryType",
111
+ "massif::GeometryCollection": "geometry,o,massif::MultiGeometry;style,o,massif::GeometryCollectionStyle",
112
+ "massif::GeometryCollectionStyle": "lineStyle,o,massif::LineStyle;pointStyle,o,massif::PointStyle;polygonStyle,o,massif::PolygonStyle",
113
+ "massif::GeometryCollectionStyleBuilder": "lineStyle,o,massif::LineStyle;pointStyle,o,massif::PointStyle;polygonStyle,o,massif::PolygonStyle",
114
+ "massif::HTTPTileDataSource": "HTTPHeaders,g,s;TMSScheme,b;baseURL,s;maxAgeHeaderCheck,b;subdomains,t;timeout,i",
115
+ "massif::HillshadeRasterTileLayer": "accentColor,c;contourColor,c;contourEnabled,b;contourInterval,f;contourWidth,f;contrast,f;elevationEncodingEnabled,b;exagerateHeightScaleEnabled,b;exaggeration,f;heightScale,f;highlightColor,c;hillshadeMethod,e,HillshadeMethod;illuminationDirection,t;illuminationMapRotationEnabled,b;legacyHeightScaleEnabled,b;normalMapLightingShader,s;shadowColor,c;terrainPaintEnabled,b;terrainPaintFullDetailEnabled,b",
116
+ "massif::Label": "style,o,massif::LabelStyle",
117
+ "massif::LabelStyle": "anchorPointX,f;anchorPointY,f;flippable,b;orientationMode,e,BillboardOrientation;renderScale,f;scalingMode,e,BillboardScaling",
118
+ "massif::LabelStyleBuilder": "anchorPointX,f;anchorPointY,f;flippable,b;orientationMode,e,BillboardOrientation;renderScale,f;scalingMode,e,BillboardScaling",
119
+ "massif::Layer": "cullDelay,i;metaData,g,v;opacity,f;postProcessed,b;updatePriority,i;visible,b;visibleZoomRange,t",
120
+ "massif::Layers": "count,i",
121
+ "massif::LightOptions": "ambientColor,c;ambientIntensity,f;dayCycleLightStops,t;dayCycleLightsEnabled,b;dayCycleRisingLightStops,t;shadowBias,f;shadowCascades,i;shadowCasterMargin,i;shadowDistance,f;shadowMapSize,i;shadowNormalOffset,f;shadowSoftness,f;shadowStrength,f;sunAltitude,f;sunAzimuth,f;sunColor,c;sunIntensity,f;sunOverridingStyle,b;terrainLightingEnabled,b",
122
+ "massif::LightStop": "ambientColor,c;ambientIntensity,f;sunAltitude,f;sunColor,c;sunIntensity,f",
123
+ "massif::Line": "geometry,o,massif::LineGeometry;style,o,massif::LineStyle",
124
+ "massif::LineGeometry": "poses,t",
125
+ "massif::LineStyle": "bitmap,o,massif::Bitmap;clickWidth,f;lineEndType,e,LineEndType;lineJoinType,e,LineJoinType;stretchFactor,f;width,f",
126
+ "massif::LineStyleBuilder": "bitmap,o,massif::Bitmap;clickWidth,f;lineEndType,e,LineEndType;lineJoinType,e,LineJoinType;stretchFactor,f;width,f",
127
+ "massif::LocalVectorDataSource": "geometrySimplifier,o,massif::GeometrySimplifier",
128
+ "massif::Log": "logEventListener,o,massif::LogEventListener;showDebug,b;showError,b;showInfo,b;showWarn,b;tag,s",
129
+ "massif::MBVectorTileDecoder": "cartoCSSStyle,o,massif::CartoCSSStyleSet;compiledStyle,o,massif::CompiledStyleSet;featureIdOverride,b;params,g,s;styleLayerNames,t;styleParameters,t;tileFormat,e,TileFormat",
130
+ "massif::ManeuverArrowBuilder": "lengthAfter,f;lengthBefore,f",
131
+ "massif::MapBounds": "center,p;delta,t;max,p;min,p",
132
+ "massif::MapBoxOnlineGeocodingService": "customServiceURL,s",
133
+ "massif::MapBoxOnlineReverseGeocodingService": "customServiceURL,s",
134
+ "massif::MapClickInfo": "clickInfo,t;clickPos,p;clickType,e,ClickType",
135
+ "massif::MapEnvelope": "bounds,p;convexHull,t",
136
+ "massif::MapInteractionInfo": "animationStarted,b;panAction,b;rotateAction,b;tiltAction,b;zoomAction,b",
137
+ "massif::MapMoveInfo": "reason,e,MapMoveReason",
138
+ "massif::MapPos": "x,f;y,f;z,f",
139
+ "massif::MapRange": "length,f;max,f;midrange,f;min,f",
140
+ "massif::MapRenderer": "mapRendererListener,o,massif::MapRendererListener;postProcessEffect,o,massif::PostProcessEffect",
141
+ "massif::MapTile": "frameNr,i;tileId,i;x,i;y,i;zoom,i",
142
+ "massif::MapTilerOnlineTileDataSource": "customServiceURL,s;timeout,i",
143
+ "massif::MapVec": "length,f;normalized,t;x,f;y,f;z,f",
144
+ "massif::Marker": "style,o,massif::MarkerStyle",
145
+ "massif::MarkerStyle": "anchorPointX,f;anchorPointY,f;bitmap,o,massif::Bitmap;clickSize,f;orientationMode,e,BillboardOrientation;scalingMode,e,BillboardScaling;size,f",
146
+ "massif::MarkerStyleBuilder": "anchorPointX,f;anchorPointY,f;bitmap,o,massif::Bitmap;clickSize,f;orientationMode,e,BillboardOrientation;scalingMode,e,BillboardScaling;size,f",
147
+ "massif::MultiGeometry": "geometryCount,i",
148
+ "massif::NMLModel": "rotationAngle,f;rotationAxis,t;scale,f;style,o,massif::NMLModelStyle",
149
+ "massif::NMLModelStyle": "modelAsset,o,massif::BinaryData;orientationMode,e,BillboardOrientation;scalingMode,e,BillboardScaling",
150
+ "massif::NMLModelStyleBuilder": "modelAsset,o,massif::BinaryData;orientationMode,e,BillboardOrientation;scalingMode,e,BillboardScaling",
151
+ "massif::Options": "DPI,f;ambientLightColor,c;backgroundBitmap,o,massif::Bitmap;baseProjection,o,massif::Projection;clearColor,c;clickMovingTolerance,f;clickTypeDetection,b;debugTileBorders,b;doubleClickDetection,b;doubleClickMaxDuration,f;drawDistance,f;envelopeThreadPoolSize,i;fieldOfViewY,f;focusPointOffset,t;fogOptions,o,massif::FogOptions;freeRoamLookSensitivity,f;freeRoamMode,e,FreeRoamMode;freeRoamMoveSpeed,f;kineticPan,b;kineticRotation,b;kineticZoom,b;labelPadding,f;labelViewDistance,f;layersLabelsProcessedInReverseOrder,b;lightOptions,o,massif::LightOptions;longClickDuration,f;mainLightColor,c;mainLightDirection,t;panBounds,p;panningMode,e,PanningMode;panningSpeedMode,e,PanningSpeedMode;pivotMode,e,PivotMode;renderProjectionMode,e,RenderProjectionMode;restrictedPanning,b;rotatable,b;rotationGestures,b;seamlessPanning,b;skyColor,c;skyOptions,o,massif::SkyOptions;terrainOptions,o,massif::TerrainOptions;tileDrawSize,i;tileLODFactor,f;tileLODMaxZoomLevelsOnScreen,f;tileLODTileCountRatio,f;tileStyleZoomLift,i;tileThreadPoolSize,i;tiltGestureReversed,b;tiltRange,t;userInput,b;zoomGestures,b;zoomOffset,f;zoomRange,t",
152
+ "massif::PackageInfo": "metaInfo,o,massif::PackageMetaInfo;name,s;packageId,s;packageType,e,PackageType;size,i;tileMask,o,massif::PackageTileMask;version,i",
153
+ "massif::PackageManager": "localPackages,t;packageManagerListener,o,massif::PackageManagerListener;serverPackageListAge,i;serverPackageListMetaInfo,o,massif::PackageMetaInfo;serverPackages,t",
154
+ "massif::PackageManagerTileDataSource": "packageManager,o,massif::PackageManager",
155
+ "massif::PackageMetaInfo": "variant,v",
156
+ "massif::PackageStatus": "currentAction,e,PackageAction;paused,b;progress,f",
157
+ "massif::PackageTileMask": "maxZoomLevel,i;stringValue,s",
158
+ "massif::PeliasOnlineGeocodingService": "customServiceURL,s",
159
+ "massif::PeliasOnlineReverseGeocodingService": "customServiceURL,s",
160
+ "massif::PersistentCacheTileDataSource": "cacheOnlyMode,b;open,b",
161
+ "massif::Point": "geometry,o,massif::PointGeometry;style,o,massif::PointStyle",
162
+ "massif::PointDetailTileDataSource": "detailZoom,i;layerName,s;maxDetailLevels,i;maxFeatures,i;rankProperty,s",
163
+ "massif::PointGeometry": "pos,p",
164
+ "massif::PointStyle": "bitmap,o,massif::Bitmap;clickSize,f;size,f",
165
+ "massif::PointStyleBuilder": "bitmap,o,massif::Bitmap;clickSize,f;size,f",
166
+ "massif::Polygon": "geometry,o,massif::PolygonGeometry;style,o,massif::PolygonStyle",
167
+ "massif::Polygon3D": "geometry,o,massif::PolygonGeometry;height,f;style,o,massif::Polygon3DStyle",
168
+ "massif::Polygon3DStyle": "sideColor,c",
169
+ "massif::Polygon3DStyleBuilder": "sideColor,c",
170
+ "massif::PolygonGeometry": "holes,t;poses,t;rings,t",
171
+ "massif::PolygonStyle": "lineStyle,o,massif::LineStyle",
172
+ "massif::PolygonStyleBuilder": "lineStyle,o,massif::LineStyle",
173
+ "massif::Popup": "anchorPointX,f;anchorPointY,f;style,o,massif::PopupStyle",
174
+ "massif::PopupClickInfo": "clickInfo,t;clickPos,p;clickType,e,ClickType;elementClickPos,t;popup,o,massif::Popup",
175
+ "massif::PopupDrawInfo": "DPToPX,f;anchorScreenPos,t;popup,o,massif::Popup;screenBounds,t",
176
+ "massif::PostProcessEffect": "fragmentShader,s;name,s;terrainDepthRequired,b;terrainNormalsRequired,b",
177
+ "massif::Projection": "bounds,p;name,s",
178
+ "massif::RasterTileClickInfo": "clickInfo,t;clickPos,p;clickType,e,ClickType;interpolatedColor,c;layer,o,massif::Layer;mapTile,t;nearestColor,c",
179
+ "massif::RasterTileLayer": "rasterTileEventListener,o,massif::RasterTileEventListener;textureCacheCapacity,i;tileBlendingSpeed,f;tileFilterMode,e,RasterTileFilterMode",
180
+ "massif::ReverseGeocodingRequest": "location,p;projection,o,massif::Projection;searchRadius,f",
181
+ "massif::ReverseGeocodingService": "language,s",
182
+ "massif::RouteMatchingPoint": "edgeIndex,i;pos,p;type,e,RouteMatchingPointType",
183
+ "massif::RouteMatchingRequest": "accuracy,f;points,t;projection,o,massif::Projection",
184
+ "massif::RouteMatchingResult": "matchingEdges,t;matchingPoints,t;points,t;projection,o,massif::Projection;rawResult,s",
185
+ "massif::RoutingInstruction": "action,e,RoutingAction;azimuth,f;distance,f;geometryTag,v;instruction,s;pointIndex,i;streetName,s;time,f;turnAngle,f",
186
+ "massif::RoutingRequest": "params,g,v;points,t;projection,o,massif::Projection",
187
+ "massif::RoutingResult": "instructionCount,i;instructions,t;instructionsJSON,s;pointCount,i;points,t;projection,o,massif::Projection;rawResult,s;totalDistance,f;totalTime,f",
188
+ "massif::RoutingService": "profile,s",
189
+ "massif::ScreenBounds": "center,t;max,t;min,t",
190
+ "massif::ScreenPos": "x,f;y,f",
191
+ "massif::SearchRequest": "filterExpression,s;geometry,o,massif::Geometry;projection,o,massif::Projection;regexFilter,s;searchRadius,f",
192
+ "massif::SkyOptions": "atmosphereColor,c;atmosphereLuminance,f;atmosphereSunIntensity,f;enabled,b;groundColor,c;haloColor,c;horizonBlend,f;horizonColor,c;quality,e,SkyQuality;shaderSource,s;skyColor,c;sunDiscEnabled,b;type,e,SkyType",
193
+ "massif::SolidLayer": "bitmap,o,massif::Bitmap;bitmapScale,f;color,c",
194
+ "massif::Style": "color,c",
195
+ "massif::StyleBuilder": "color,c",
196
+ "massif::TerrainOptions": "autoFlattenDuration,f;autoFlattenParallax,f;autoFlattenRiseDuration,f;autoFlattenTilt,f;backgroundColor,c;billboardOcclusionEnabled,b;billboardOcclusionTolerance,f;bridges3DEnabled,b;cameraClampDuration,f;cameraClearance,f;cameraClearanceFraction,f;depthBias,f;drapeCacheSize,i;drapeFillsEnabled,b;drapeLinesEnabled,b;drapeResolution,i;drapeWorkingSet,i;elevationCacheSize,i;elevationPrefetchEnabled,b;enabled,b;exaggeration,f;flattenMode,e,TerrainFlattenMode;flattenRatio,f;flattened,b;focusLift,f;maxTileZoomCoarsening,i;maxTileZoomOffset,i;maxZoom,i;meshCacheSize,i;meshResolution,i;minZoom,i;noDrapeLayerFilter,s;normalSampleDistance,f;postProcessDownscale,i;seamlessTileEdgesEnabled,b;sharedGroundEnabled,b;subdivideDistance,f;surfaceNodeResolution,i;surfaceShaderSource,s;switching,b;textOcclusionOpacity,f;tileEdgeStitchingEnabled,b;viewDistance,f;viewDistanceFactor,f;viewDistanceMax,f",
197
+ "massif::Text": "style,o,massif::TextStyle;title,s",
198
+ "massif::TextMargins": "bottom,i;left,i;right,i;top,i",
199
+ "massif::TextStyle": "backgroundColor,c;borderColor,c;borderWidth,f;breakLines,b;fontColor,c;fontName,s;fontSize,f;strokeColor,c;strokeWidth,f;textField,s;textMargins,t",
200
+ "massif::TextStyleBuilder": "backgroundColor,c;borderColor,c;borderWidth,f;breakLines,b;fontName,s;fontSize,f;strokeColor,c;strokeWidth,f;textField,s;textMargins,t",
201
+ "massif::TileData": "data,o,massif::BinaryData;height,i;maxAge,i;rawPixels,b;replaceWithParent,b;width,i",
202
+ "massif::TileDataSource": "dataExtent,p;maxOverzoomLevel,i;maxZoom,i;metaData,g,v;minZoom,i;projection,o,massif::Projection",
203
+ "massif::TileDownloadInfo": "progress,f;tile,t;tileCount,i",
204
+ "massif::TileLayer": "UTFGridDataSource,o,massif::TileDataSource;UTFGridEventListener,o,massif::UTFGridEventListener;dataSource,o,massif::TileDataSource;frameNr,i;maxOverzoomLevel,i;maxUnderzoomLevel,i;preloading,b;preloadingTileCount,i;projection,o,massif::Projection;synchronizedRefresh,b;tileLoadListener,o,massif::TileLoadListener;tileSubstitutionPolicy,e,TileSubstitutionPolicy;visibleTileCount,i;zoomLevelBias,f",
205
+ "massif::TomTomOnlineGeocodingService": "customServiceURL,s",
206
+ "massif::TomTomOnlineReverseGeocodingService": "customServiceURL,s",
207
+ "massif::TorqueTileDecoder": "animationDuration,f;frameCount,i;resolution,i;styleSet,o,massif::CartoCSSStyleSet",
208
+ "massif::UTFGridClickInfo": "clickInfo,t;clickPos,p;clickType,e,ClickType;elementInfo,v;layer,o,massif::Layer",
209
+ "massif::ValhallaOnlineRoutingService": "HTTPHeaders,g,s;customServiceURL,s;timeout,i",
210
+ "massif::Variant": "arraySize,i;bool,b;double,f;long,i;objectKeys,t;string,s;type,e,VariantType",
211
+ "massif::VectorData": "elements,t",
212
+ "massif::VectorDataSource": "dataExtent,p;projection,o,massif::Projection",
213
+ "massif::VectorElement": "bounds,p;geometry,o,massif::Geometry;id,i;metaData,g,v;visible,b",
214
+ "massif::VectorElementClickInfo": "clickInfo,t;clickPos,p;clickType,e,ClickType;elementClickPos,p;layer,o,massif::Layer;vectorElement,o,massif::VectorElement",
215
+ "massif::VectorElementDragInfo": "mapPos,p;screenPos,t;vectorElement,o,massif::VectorElement;vectorElementDragMode,e,VectorElementDragMode",
216
+ "massif::VectorElementSearchService": "dataSource,o,massif::VectorDataSource;maxResults,i",
217
+ "massif::VectorLayer": "ZBuffering,b;dataSource,o,massif::VectorDataSource;vectorElementEventListener,o,massif::VectorElementEventListener",
218
+ "massif::VectorTileClickInfo": "clickInfo,t;clickPos,p;clickType,e,ClickType;feature,o,massif::VectorTileFeature;featureClickPos,p;featureId,i;featureLayerName,s;featurePos,p;featurePosIndex,i;layer,o,massif::Layer;mapTile,t",
219
+ "massif::VectorTileDecoder": "maxZoom,i;minZoom,i",
220
+ "massif::VectorTileFeature": "distance,f;id,i;layerName,s;mapTile,t",
221
+ "massif::VectorTileFeatureBuilder": "id,i;layerName,s;mapTile,t",
222
+ "massif::VectorTileLayer": "buildingRenderOrder,e,VectorTileRenderOrder;clickHandlerLayerFilter,s;clickRadius,f;labelBlendingSpeed,f;labelPerspectiveScaling,f;labelRenderOrder,e,VectorTileRenderOrder;layerBlendingSpeed,f;rendererLayerFilter,s;tileCacheCapacity,i;tileDecoder,o,massif::VectorTileDecoder;vectorTileEventListener,o,massif::VectorTileEventListener",
223
+ "massif::VectorTileSearchService": "dataSource,o,massif::TileDataSource;layers,t;maxResults,i;maxZoom,i;minZoom,i;preventDuplicates,b;projection,o,massif::Projection;sortByDistance,b;tileDecoder,o,massif::VectorTileDecoder",
224
+ "massif::ViewState": "DPI,f;DPToPX,f;FOVY,i;aspectRatio,f;cameraChanged,b;far,f;height,i;near,f;rotation,f;screenHeight,i;screenWidth,i;tilt,f;unitToDPCoef,f;unitToPXCoef,f;width,i;zoom,f;zoom0Distance,f",
225
+ "massif::WKBGeometryWriter": "bigEndian,b;z,b",
226
+ "massif::WKTGeometryWriter": "z,b",
227
+ "massif::ZippedAssetPackage": "localAssetNames,t"
228
+ };
229
+ var ALIASES = {
230
+ "massif::Options": "background=backgroundBitmap;fog=fogOptions;light=lightOptions;projection=baseProjection;sky=skyOptions;terrain=terrainOptions",
231
+ "massif::TileLayer": "source=dataSource",
232
+ "massif::VectorTileLayer": "style=tileDecoder"
233
+ };
234
+ var BASES = {
235
+ "massif::AssetTileDataSource": "massif::TileDataSource",
236
+ "massif::BalloonPopup": "massif::Popup",
237
+ "massif::BalloonPopupButtonStyle": "massif::Style",
238
+ "massif::BalloonPopupButtonStyleBuilder": "massif::StyleBuilder",
239
+ "massif::BalloonPopupStyle": "massif::PopupStyle",
240
+ "massif::BalloonPopupStyleBuilder": "massif::PopupStyleBuilder",
241
+ "massif::Billboard": "massif::VectorElement",
242
+ "massif::BillboardStyle": "massif::Style",
243
+ "massif::BillboardStyleBuilder": "massif::StyleBuilder",
244
+ "massif::BitmapOverlayRasterTileDataSource": "massif::TileDataSource",
245
+ "massif::BundleAssetPackage": "massif::AssetPackage",
246
+ "massif::CacheTileDataSource": "massif::TileDataSource",
247
+ "massif::CelestialArc": "massif::CelestialObject",
248
+ "massif::CelestialImage": "massif::CelestialObject",
249
+ "massif::CelestialLabel": "massif::CelestialObject",
250
+ "massif::CelestialLayer": "massif::Layer",
251
+ "massif::CelestialSprite": "massif::CelestialObject",
252
+ "massif::ClusteredVectorLayer": "massif::VectorLayer",
253
+ "massif::CombinedTileDataSource": "massif::TileDataSource",
254
+ "massif::CompositeVectorTileLayer": "massif::VectorTileLayer",
255
+ "massif::ContourTileDataSource": "massif::TileDataSource",
256
+ "massif::CustomPopup": "massif::Popup",
257
+ "massif::CustomRasterTileLayer": "massif::RasterTileLayer",
258
+ "massif::DirAssetPackage": "massif::AssetPackage",
259
+ "massif::DouglasPeuckerGeometrySimplifier": "massif::GeometrySimplifier",
260
+ "massif::DownloadTask": "massif::CancelableTask",
261
+ "massif::EPSG3857": "massif::Projection",
262
+ "massif::EPSG4326": "massif::Projection",
263
+ "massif::EditableVectorLayer": "massif::VectorLayer",
264
+ "massif::FetchTask": "massif::CancelableTask",
265
+ "massif::FetchTaskBase": "massif::CancelableTask",
266
+ "massif::GeoJSONVectorTileDataSource": "massif::TileDataSource",
267
+ "massif::GeocodingAddress": "massif::Address",
268
+ "massif::GeometryCollection": "massif::VectorElement",
269
+ "massif::GeometryCollectionStyle": "massif::Style",
270
+ "massif::GeometryCollectionStyleBuilder": "massif::StyleBuilder",
271
+ "massif::HTTPTileDataSource": "massif::TileDataSource",
272
+ "massif::HillshadeRasterTileLayer": "massif::CustomRasterTileLayer",
273
+ "massif::Label": "massif::Billboard",
274
+ "massif::LabelStyle": "massif::BillboardStyle",
275
+ "massif::LabelStyleBuilder": "massif::BillboardStyleBuilder",
276
+ "massif::Line": "massif::VectorElement",
277
+ "massif::LineGeometry": "massif::Geometry",
278
+ "massif::LineStyle": "massif::Style",
279
+ "massif::LineStyleBuilder": "massif::StyleBuilder",
280
+ "massif::LocalVectorDataSource": "massif::VectorDataSource",
281
+ "massif::MBTilesTileDataSource": "massif::TileDataSource",
282
+ "massif::MBVectorTileDecoder": "massif::VectorTileDecoder",
283
+ "massif::MapBoxElevationDataDecoder": "massif::ElevationDecoder",
284
+ "massif::MapBoxOnlineGeocodingService": "massif::GeocodingService",
285
+ "massif::MapBoxOnlineReverseGeocodingService": "massif::ReverseGeocodingService",
286
+ "massif::MapTilerOnlineTileDataSource": "massif::TileDataSource",
287
+ "massif::Marker": "massif::Billboard",
288
+ "massif::MarkerStyle": "massif::BillboardStyle",
289
+ "massif::MarkerStyleBuilder": "massif::BillboardStyleBuilder",
290
+ "massif::MemoryCacheTileDataSource": "massif::CacheTileDataSource",
291
+ "massif::MergedMBVTTileDataSource": "massif::TileDataSource",
292
+ "massif::MultiGeometry": "massif::Geometry",
293
+ "massif::MultiLineGeometry": "massif::MultiGeometry",
294
+ "massif::MultiOSMOfflineGeocodingService": "massif::GeocodingService",
295
+ "massif::MultiOSMOfflineReverseGeocodingService": "massif::ReverseGeocodingService",
296
+ "massif::MultiPointGeometry": "massif::MultiGeometry",
297
+ "massif::MultiPolygonGeometry": "massif::MultiGeometry",
298
+ "massif::MultiTileDataSource": "massif::TileDataSource",
299
+ "massif::MultiValhallaOfflineRoutingService": "massif::RoutingService",
300
+ "massif::NMLModel": "massif::Billboard",
301
+ "massif::NMLModelStyle": "massif::BillboardStyle",
302
+ "massif::NMLModelStyleBuilder": "massif::BillboardStyleBuilder",
303
+ "massif::OSMOfflineGeocodingService": "massif::GeocodingService",
304
+ "massif::OSMOfflineReverseGeocodingService": "massif::ReverseGeocodingService",
305
+ "massif::OSRMOfflineRoutingService": "massif::RoutingService",
306
+ "massif::OrderedTileDataSource": "massif::TileDataSource",
307
+ "massif::PMTilesTileDataSource": "massif::TileDataSource",
308
+ "massif::PackageManagerGeocodingService": "massif::GeocodingService",
309
+ "massif::PackageManagerReverseGeocodingService": "massif::ReverseGeocodingService",
310
+ "massif::PackageManagerRoutingService": "massif::RoutingService",
311
+ "massif::PackageManagerTileDataSource": "massif::TileDataSource",
312
+ "massif::PackageManagerValhallaRoutingService": "massif::RoutingService",
313
+ "massif::PeliasOnlineGeocodingService": "massif::GeocodingService",
314
+ "massif::PeliasOnlineReverseGeocodingService": "massif::ReverseGeocodingService",
315
+ "massif::PersistentCacheTileDataSource": "massif::CacheTileDataSource",
316
+ "massif::Point": "massif::VectorElement",
317
+ "massif::PointDetailTileDataSource": "massif::TileDataSource",
318
+ "massif::PointGeometry": "massif::Geometry",
319
+ "massif::PointStyle": "massif::Style",
320
+ "massif::PointStyleBuilder": "massif::StyleBuilder",
321
+ "massif::Polygon": "massif::VectorElement",
322
+ "massif::Polygon3D": "massif::VectorElement",
323
+ "massif::Polygon3DStyle": "massif::Style",
324
+ "massif::Polygon3DStyleBuilder": "massif::StyleBuilder",
325
+ "massif::PolygonGeometry": "massif::Geometry",
326
+ "massif::PolygonStyle": "massif::Style",
327
+ "massif::PolygonStyleBuilder": "massif::StyleBuilder",
328
+ "massif::Popup": "massif::Billboard",
329
+ "massif::PopupStyle": "massif::BillboardStyle",
330
+ "massif::PopupStyleBuilder": "massif::BillboardStyleBuilder",
331
+ "massif::RasterTileLayer": "massif::TileLayer",
332
+ "massif::SGREOfflineRoutingService": "massif::RoutingService",
333
+ "massif::SolidLayer": "massif::Layer",
334
+ "massif::TerrariumElevationDataDecoder": "massif::ElevationDecoder",
335
+ "massif::Text": "massif::Label",
336
+ "massif::TextStyle": "massif::LabelStyle",
337
+ "massif::TextStyleBuilder": "massif::LabelStyleBuilder",
338
+ "massif::TileLayer": "massif::Layer",
339
+ "massif::TomTomOnlineGeocodingService": "massif::GeocodingService",
340
+ "massif::TomTomOnlineReverseGeocodingService": "massif::ReverseGeocodingService",
341
+ "massif::TorqueTileDecoder": "massif::VectorTileDecoder",
342
+ "massif::TorqueTileLayer": "massif::VectorTileLayer",
343
+ "massif::ValhallaOfflineRoutingService": "massif::RoutingService",
344
+ "massif::ValhallaOnlineRoutingService": "massif::RoutingService",
345
+ "massif::VectorLayer": "massif::Layer",
346
+ "massif::VectorTileFeature": "massif::Feature",
347
+ "massif::VectorTileFeatureBuilder": "massif::FeatureBuilder",
348
+ "massif::VectorTileFeatureCollection": "massif::FeatureCollection",
349
+ "massif::VectorTileLayer": "massif::TileLayer",
350
+ "massif::ZippedAssetPackage": "massif::AssetPackage"
351
+ };
352
+ var ENUMS = {
353
+ AnimationType: "ANIMATION_TYPE_NONE=0,ANIMATION_TYPE_STEP=1,ANIMATION_TYPE_LINEAR=2,ANIMATION_TYPE_SMOOTHSTEP=3,ANIMATION_TYPE_SPRING=4",
354
+ BillboardOrientation: "BILLBOARD_ORIENTATION_FACE_CAMERA=0,BILLBOARD_ORIENTATION_FACE_CAMERA_GROUND=1,BILLBOARD_ORIENTATION_GROUND=2",
355
+ BillboardScaling: "BILLBOARD_SCALING_WORLD_SIZE=0,BILLBOARD_SCALING_SCREEN_SIZE=1,BILLBOARD_SCALING_CONST_SCREEN_SIZE=2",
356
+ ClickType: "CLICK_TYPE_SINGLE=0,CLICK_TYPE_LONG=1,CLICK_TYPE_DOUBLE=2,CLICK_TYPE_DUAL=3",
357
+ ClusterBuilderMode: "CLUSTER_BUILDER_MODE_ELEMENTS=0,CLUSTER_BUILDER_MODE_ELEMENT_COUNT=1",
358
+ ColorFormat: "COLOR_FORMAT_UNSUPPORTED=0,COLOR_FORMAT_BGRA=1,COLOR_FORMAT_RGBA_4444=2,COLOR_FORMAT_RGB_565=3",
359
+ CompositeSourceType: "COMPOSITE_SOURCE_TYPE_RASTER=0,COMPOSITE_SOURCE_TYPE_HILLSHADE=1,COMPOSITE_SOURCE_TYPE_VECTOR=2",
360
+ FlightEasing: "FLIGHT_EASING_EASE=0,FLIGHT_EASING_LINEAR=1,FLIGHT_EASING_EASE_IN=2,FLIGHT_EASING_EASE_OUT=3,FLIGHT_EASING_EASE_IN_OUT=4",
361
+ FreeRoamMode: "FREE_ROAM_MODE_OFF=0,FREE_ROAM_MODE_LOOK=1,FREE_ROAM_MODE_FIRST_PERSON=2",
362
+ GeometryType: "GEOMETRY_TYPE_POINT=0,GEOMETRY_TYPE_LINE=1,GEOMETRY_TYPE_POLYGON=2,GEOMETRY_TYPE_MULTIPOINT=3,GEOMETRY_TYPE_MULTILINE=4,GEOMETRY_TYPE_MULTIPOLYGON=5,GEOMETRY_TYPE_COLLECTION=6",
363
+ HillshadeMethod: "STANDARD=0,COMBINED=1,IGOR=2,MULTIDIRECTIONAL=3,BASIC=4",
364
+ LineEndType: "LINE_END_TYPE_NONE=0,LINE_END_TYPE_SQUARE=1,LINE_END_TYPE_ROUND=2",
365
+ LineJoinType: "LINE_JOIN_TYPE_NONE=0,LINE_JOIN_TYPE_MITER=1,LINE_JOIN_TYPE_BEVEL=2,LINE_JOIN_TYPE_ROUND=3",
366
+ LocalSpatialIndexType: "LOCAL_SPATIAL_INDEX_TYPE_NULL=0,LOCAL_SPATIAL_INDEX_TYPE_KDTREE=1",
367
+ MBTilesScheme: "MBTILES_SCHEME_TMS=0,MBTILES_SCHEME_XYZ=1",
368
+ MapMoveReason: "MAP_MOVE_REASON_GESTURE=0,MAP_MOVE_REASON_ANIMATION=1,MAP_MOVE_REASON_API=2",
369
+ PackageAction: "PACKAGE_ACTION_READY=0,PACKAGE_ACTION_WAITING=1,PACKAGE_ACTION_DOWNLOADING=2,PACKAGE_ACTION_COPYING=3,PACKAGE_ACTION_REMOVING=4",
370
+ PackageErrorType: "PACKAGE_ERROR_TYPE_SYSTEM=0,PACKAGE_ERROR_TYPE_CONNECTION=1,PACKAGE_ERROR_TYPE_DOWNLOAD_LIMIT_EXCEEDED=2,PACKAGE_ERROR_TYPE_PACKAGE_TOO_BIG=3,PACKAGE_ERROR_TYPE_NO_OFFLINE_PLAN=4",
371
+ PackageTileStatus: "PACKAGE_TILE_STATUS_MISSING=0,PACKAGE_TILE_STATUS_PARTIAL=1,PACKAGE_TILE_STATUS_FULL=2",
372
+ PackageType: "PACKAGE_TYPE_MAP=0,PACKAGE_TYPE_ROUTING=1,PACKAGE_TYPE_GEOCODING=2,PACKAGE_TYPE_VALHALLA_ROUTING=3",
373
+ PanningMode: "PANNING_MODE_FREE=0,PANNING_MODE_STICKY=1,PANNING_MODE_STICKY_FINAL=2",
374
+ PanningSpeedMode: "PANNING_SPEED_MODE_MAP=0,PANNING_SPEED_MODE_ANCHORED=1,PANNING_SPEED_MODE_CONSTANT=2",
375
+ PivotMode: "PIVOT_MODE_TOUCHPOINT=0,PIVOT_MODE_CENTERPOINT=1",
376
+ RasterTileFilterMode: "RASTER_TILE_FILTER_MODE_NEAREST=0,RASTER_TILE_FILTER_MODE_BILINEAR=1,RASTER_TILE_FILTER_MODE_BICUBIC=2",
377
+ RenderProjectionMode: "RENDER_PROJECTION_MODE_PLANAR=0,RENDER_PROJECTION_MODE_SPHERICAL=1",
378
+ RouteMatchingPointType: "ROUTE_MATCHING_POINT_UNMATCHED=0,ROUTE_MATCHING_POINT_INTERPOLATED=1,ROUTE_MATCHING_POINT_MATCHED=2",
379
+ RoutingAction: "ROUTING_ACTION_HEAD_ON=0,ROUTING_ACTION_FINISH=1,ROUTING_ACTION_NO_TURN=2,ROUTING_ACTION_GO_STRAIGHT=3,ROUTING_ACTION_TURN_RIGHT=4,ROUTING_ACTION_UTURN=5,ROUTING_ACTION_TURN_LEFT=6,ROUTING_ACTION_REACH_VIA_LOCATION=7,ROUTING_ACTION_ENTER_ROUNDABOUT=8,ROUTING_ACTION_LEAVE_ROUNDABOUT=9,ROUTING_ACTION_STAY_ON_ROUNDABOUT=10,ROUTING_ACTION_START_AT_END_OF_STREET=11,ROUTING_ACTION_ENTER_AGAINST_ALLOWED_DIRECTION=12,ROUTING_ACTION_LEAVE_AGAINST_ALLOWED_DIRECTION=13,ROUTING_ACTION_GO_UP=14,ROUTING_ACTION_GO_DOWN=15,ROUTING_ACTION_WAIT=16,ROUTING_ACTION_ENTER_FERRY=17,ROUTING_ACTION_LEAVE_FERRY=18",
380
+ SkyQuality: "SKY_QUALITY_LOW=0,SKY_QUALITY_MEDIUM=1,SKY_QUALITY_HIGH=2",
381
+ SkyType: "SKY_TYPE_GRADIENT=0,SKY_TYPE_ATMOSPHERE=1",
382
+ TerrainFlattenMode: "TERRAIN_FLATTEN_MODE_RENDER=0,TERRAIN_FLATTEN_MODE_FULL=1",
383
+ TileFormat: "TILE_FORMAT_AUTO=0,TILE_FORMAT_MVT=1,TILE_FORMAT_MLT=2",
384
+ TileLODProfile: "TILE_LOD_PROFILE_REFERENCE=0,TILE_LOD_PROFILE_MOBILE=1,TILE_LOD_PROFILE_DESKTOP=2",
385
+ TileSubstitutionPolicy: "TILE_SUBSTITUTION_POLICY_ALL=0,TILE_SUBSTITUTION_POLICY_VISIBLE=1,TILE_SUBSTITUTION_POLICY_NONE=2",
386
+ VariantType: "VARIANT_TYPE_NULL=0,VARIANT_TYPE_STRING=1,VARIANT_TYPE_BOOL=2,VARIANT_TYPE_INTEGER=3,VARIANT_TYPE_DOUBLE=4,VARIANT_TYPE_ARRAY=5,VARIANT_TYPE_OBJECT=6",
387
+ VectorElementDragMode: "VECTOR_ELEMENT_DRAG_MODE_VERTEX=0,VECTOR_ELEMENT_DRAG_MODE_ELEMENT=1",
388
+ VectorElementDragPointStyle: "VECTOR_ELEMENT_DRAG_POINT_STYLE_NORMAL=0,VECTOR_ELEMENT_DRAG_POINT_STYLE_VIRTUAL=1,VECTOR_ELEMENT_DRAG_POINT_STYLE_SELECTED=2",
389
+ VectorElementDragResult: "VECTOR_ELEMENT_DRAG_RESULT_IGNORE=0,VECTOR_ELEMENT_DRAG_RESULT_STOP=1,VECTOR_ELEMENT_DRAG_RESULT_MODIFY=2,VECTOR_ELEMENT_DRAG_RESULT_DELETE=3",
390
+ VectorTileRenderOrder: "VECTOR_TILE_RENDER_ORDER_HIDDEN=-1,VECTOR_TILE_RENDER_ORDER_LAYER=0,VECTOR_TILE_RENDER_ORDER_LAST=1",
391
+ massifChangeType: "PACKAGES_ADDED=0,PACKAGES_DELETED=1",
392
+ massifCommand: "NOP=0,DOWNLOAD_PACKAGE_LIST=1,DOWNLOAD_PACKAGE=2,IMPORT_PACKAGE=3,REMOVE_PACKAGE=4,DOWNLOAD_STYLE=5",
393
+ massifPackageChangeType: "PACKAGES_UPDATED=0,PACKAGES_ADDED=1,PACKAGES_DELETED=2"
394
+ };
395
+ var SPEC_CLASS = {
396
+ "assets": { "bundle": "massif::BundleAssetPackage", "dir": "massif::DirAssetPackage", "zip": "massif::ZippedAssetPackage" },
397
+ "celestial": { "arc": "massif::CelestialArc", "image": "massif::CelestialImage", "label": "massif::CelestialLabel", "sprite": "massif::CelestialSprite" },
398
+ "effect": { "postprocess": "massif::PostProcessEffect" },
399
+ "element": { "balloon": "massif::BalloonPopup", "line": "massif::Line", "marker": "massif::Marker", "point": "massif::Point", "polygon": "massif::Polygon", "text": "massif::Text" },
400
+ "elementstyle": { "balloon": "massif::BalloonPopupStyle", "line": "massif::LineStyle", "marker": "massif::MarkerStyle", "point": "massif::PointStyle", "polygon": "massif::PolygonStyle", "text": "massif::TextStyle" },
401
+ "feature": { "feature": "massif::Feature" },
402
+ "geocoding": { "multi-osm-offline": "massif::MultiOSMOfflineGeocodingService", "multi-osm-offline-reverse": "massif::MultiOSMOfflineReverseGeocodingService" },
403
+ "geometry": { "line": "massif::LineGeometry", "point": "massif::PointGeometry", "polygon": "massif::PolygonGeometry" },
404
+ "layer": { "celestial": "massif::CelestialLayer", "composite-vector": "massif::CompositeVectorTileLayer", "elements": "massif::VectorLayer", "hillshade": "massif::HillshadeRasterTileLayer", "raster": "massif::RasterTileLayer", "solid": "massif::SolidLayer", "vector": "massif::VectorTileLayer" },
405
+ "options": { "fog": "massif::FogOptions", "light": "massif::LightOptions", "sky": "massif::SkyOptions", "terrain": "massif::TerrainOptions" },
406
+ "routing": { "multi-valhalla-offline": "massif::MultiValhallaOfflineRoutingService", "valhalla-offline": "massif::ValhallaOfflineRoutingService", "valhalla-online": "massif::ValhallaOnlineRoutingService" },
407
+ "search": { "request": "massif::SearchRequest", "vectortile": "massif::VectorTileSearchService" },
408
+ "source": { "assets": "massif::AssetTileDataSource", "combined": "massif::CombinedTileDataSource", "contour": "massif::ContourTileDataSource", "geojson": "massif::GeoJSONVectorTileDataSource", "http": "massif::HTTPTileDataSource", "local": "massif::LocalVectorDataSource", "maptiler": "massif::MapTilerOnlineTileDataSource", "mbtiles": "massif::MBTilesTileDataSource", "memory-cache": "massif::MemoryCacheTileDataSource", "merged-mbvt": "massif::MergedMBVTTileDataSource", "multi": "massif::MultiTileDataSource", "ordered": "massif::OrderedTileDataSource", "persistent-cache": "massif::PersistentCacheTileDataSource", "pmtiles": "massif::PMTilesTileDataSource", "point-detail": "massif::PointDetailTileDataSource" },
409
+ "style": { "mbvt": "massif::MBVectorTileDecoder" },
410
+ "styleset": { "cartocss": "massif::CartoCSSStyleSet", "project": "massif::CompiledStyleSet" }
411
+ };
412
+ var KIND_OF_CLASS = {
413
+ "massif::AssetPackage": "assets",
414
+ "massif::AssetTileDataSource": "source",
415
+ "massif::BalloonPopup": "element",
416
+ "massif::BalloonPopupStyle": "elementstyle",
417
+ "massif::BalloonPopupStyleBuilder": "elementstyle",
418
+ "massif::Billboard": "element",
419
+ "massif::BillboardStyle": "elementstyle",
420
+ "massif::BillboardStyleBuilder": "elementstyle",
421
+ "massif::BinaryData": "data",
422
+ "massif::Bitmap": "bitmap",
423
+ "massif::BundleAssetPackage": "assets",
424
+ "massif::CacheTileDataSource": "source",
425
+ "massif::CartoCSSStyleSet": "styleset",
426
+ "massif::CelestialArc": "celestial",
427
+ "massif::CelestialImage": "celestial",
428
+ "massif::CelestialLabel": "celestial",
429
+ "massif::CelestialLayer": "layer",
430
+ "massif::CelestialObject": "celestial",
431
+ "massif::CelestialSprite": "celestial",
432
+ "massif::CombinedTileDataSource": "source",
433
+ "massif::CompiledStyleSet": "styleset",
434
+ "massif::CompositeVectorTileLayer": "layer",
435
+ "massif::ContourTileDataSource": "source",
436
+ "massif::CustomRasterTileLayer": "layer",
437
+ "massif::DirAssetPackage": "assets",
438
+ "massif::Feature": "feature",
439
+ "massif::FogOptions": "options",
440
+ "massif::GeoJSONVectorTileDataSource": "source",
441
+ "massif::GeocodingRequest": "geocoding",
442
+ "massif::GeocodingService": "geocoding",
443
+ "massif::Geometry": "geometry",
444
+ "massif::HTTPTileDataSource": "source",
445
+ "massif::HillshadeRasterTileLayer": "layer",
446
+ "massif::Label": "element",
447
+ "massif::LabelStyle": "elementstyle",
448
+ "massif::LabelStyleBuilder": "elementstyle",
449
+ "massif::Layer": "layer",
450
+ "massif::LightOptions": "options",
451
+ "massif::Line": "element",
452
+ "massif::LineGeometry": "geometry",
453
+ "massif::LineStyle": "elementstyle",
454
+ "massif::LineStyleBuilder": "elementstyle",
455
+ "massif::LocalVectorDataSource": "source",
456
+ "massif::MBTilesTileDataSource": "source",
457
+ "massif::MBVectorTileDecoder": "style",
458
+ "massif::MapTilerOnlineTileDataSource": "source",
459
+ "massif::Marker": "element",
460
+ "massif::MarkerStyle": "elementstyle",
461
+ "massif::MarkerStyleBuilder": "elementstyle",
462
+ "massif::MemoryCacheTileDataSource": "source",
463
+ "massif::MergedMBVTTileDataSource": "source",
464
+ "massif::MultiOSMOfflineGeocodingService": "geocoding",
465
+ "massif::MultiOSMOfflineReverseGeocodingService": "geocoding",
466
+ "massif::MultiTileDataSource": "source",
467
+ "massif::MultiValhallaOfflineRoutingService": "routing",
468
+ "massif::OrderedTileDataSource": "source",
469
+ "massif::PMTilesTileDataSource": "source",
470
+ "massif::PersistentCacheTileDataSource": "source",
471
+ "massif::Point": "element",
472
+ "massif::PointDetailTileDataSource": "source",
473
+ "massif::PointGeometry": "geometry",
474
+ "massif::PointStyle": "elementstyle",
475
+ "massif::PointStyleBuilder": "elementstyle",
476
+ "massif::Polygon": "element",
477
+ "massif::PolygonGeometry": "geometry",
478
+ "massif::PolygonStyle": "elementstyle",
479
+ "massif::PolygonStyleBuilder": "elementstyle",
480
+ "massif::Popup": "element",
481
+ "massif::PopupStyle": "elementstyle",
482
+ "massif::PopupStyleBuilder": "elementstyle",
483
+ "massif::PostProcessEffect": "effect",
484
+ "massif::Projection": "projection",
485
+ "massif::RasterTileLayer": "layer",
486
+ "massif::ReverseGeocodingRequest": "geocoding",
487
+ "massif::ReverseGeocodingService": "geocoding",
488
+ "massif::RouteMatchingRequest": "routing",
489
+ "massif::RoutingRequest": "routing",
490
+ "massif::RoutingService": "routing",
491
+ "massif::SearchRequest": "search",
492
+ "massif::SkyOptions": "options",
493
+ "massif::SolidLayer": "layer",
494
+ "massif::Style": "elementstyle",
495
+ "massif::StyleBuilder": "elementstyle",
496
+ "massif::TerrainOptions": "options",
497
+ "massif::Text": "element",
498
+ "massif::TextStyle": "elementstyle",
499
+ "massif::TextStyleBuilder": "elementstyle",
500
+ "massif::TileDataSource": "source",
501
+ "massif::TileLayer": "layer",
502
+ "massif::ValhallaOfflineRoutingService": "routing",
503
+ "massif::ValhallaOnlineRoutingService": "routing",
504
+ "massif::VectorDataSource": "source",
505
+ "massif::VectorElement": "element",
506
+ "massif::VectorLayer": "layer",
507
+ "massif::VectorTileDecoder": "style",
508
+ "massif::VectorTileLayer": "layer",
509
+ "massif::VectorTileSearchService": "search",
510
+ "massif::ZippedAssetPackage": "assets"
511
+ };
512
+ var METHODS = {
513
+ "massif::BaseMapView": "fitBounds,v;flyTo,v;mapToScreen,j;moveCameraTo,v;moveTo,v;screenToMap,j;stopFlight,v",
514
+ "massif::CelestialArc": "setCircle,v;setDirections,v;setSegments,v",
515
+ "massif::CelestialImage": "setAnchors,v",
516
+ "massif::CelestialLabel": "setAnchorPoint,v;setOffset,v",
517
+ "massif::CelestialLayer": "add,v;clear,v;remove,b",
518
+ "massif::CelestialObject": "setDirection,v",
519
+ "massif::CompositeVectorTileLayer": "addExternalDataSource,v;addVectorDataSource,v;getExternalChildLayer,o,massif::Layer;getExternalDataSourceNames,j;removeExternalDataSource,b;setExternalDataSourceMaxOverzoomLevel,v;setExternalDataSourceZoomLevelBias,v",
520
+ "massif::FeatureCollection": "getFeature,o,massif::Feature",
521
+ "massif::FeatureCollectionSearchService": "findFeatures,o,massif::FeatureCollection",
522
+ "massif::GeoJSONVectorTileDataSource": "addFeature,v;createLayer,i;deleteLayer,v;removeFeature,v;setLayerGeoJSON,v;updateFeature,v",
523
+ "massif::GeocodingService": "calculateAddresses,j",
524
+ "massif::HillshadeRasterTileLayer": "getElevation,f;getElevations,d",
525
+ "massif::Layer": "refresh,v",
526
+ "massif::Layers": "add,v;clear,v;get,o,massif::Layer;insert,v;remove,b;set,v",
527
+ "massif::LightOptions": "setSunPositionFromTime,v",
528
+ "massif::LocalVectorDataSource": "add,v;clear,v;remove,b",
529
+ "massif::MBVectorTileDecoder": "addFallbackFont,v;getLegend,j;getStyleParameter,s;setStyleParameter,b;setStyleParameters,v",
530
+ "massif::MultiOSMOfflineGeocodingService": "add,v;remove,b",
531
+ "massif::MultiOSMOfflineReverseGeocodingService": "add,v;remove,b",
532
+ "massif::MultiTileDataSource": "add,v;remove,b",
533
+ "massif::MultiValhallaOfflineRoutingService": "add,v;addLocale,v;remove,b;setConfigurationParameter,v",
534
+ "massif::PersistentCacheTileDataSource": "clear,v;startDownloadArea,v;stopAllDownloads,v",
535
+ "massif::PostProcessEffect": "setFloatParameter,v",
536
+ "massif::ReverseGeocodingService": "calculateAddresses,j",
537
+ "massif::RouteMatchingRequest": "setCustomParameter,v",
538
+ "massif::RoutingRequest": "setCustomParameter,v",
539
+ "massif::RoutingResult": "getInstruction,o,massif::RoutingInstruction;getPoints,d",
540
+ "massif::RoutingService": "calculateRoute,o,massif::RoutingResult;matchRoute,o,massif::RouteMatchingResult",
541
+ "massif::TerrainOptions": "calculateHorizon,d;setSurfaceParameter,v",
542
+ "massif::TileData": "getMetaDataElement,j",
543
+ "massif::TileDataSource": "getMetaDataElement,j;loadTile,o,massif::TileData;setMetaDataElement,v",
544
+ "massif::TileLayer": "clearTileCaches,v",
545
+ "massif::VectorTileFeatureCollection": "getFeature,o,massif::VectorTileFeature",
546
+ "massif::VectorTileSearchService": "findFeatures,o,massif::VectorTileFeatureCollection"
547
+ };
548
+ var EVENTS = {
549
+ "massif::CelestialLayer": { "celestial.clicked": { payload: "massif::CelestialClickInfo", consume: true }, "sky.clicked": { payload: "massif::CelestialClickInfo", consume: true } },
550
+ "massif::Options": { "map.clicked": { payload: "massif::MapClickInfo", consume: false }, "map.idle": { payload: "", consume: false }, "map.interaction": { payload: "massif::MapInteractionInfo", consume: false }, "map.moved": { payload: "massif::MapMoveInfo", consume: false }, "map.stable": { payload: "massif::MapMoveInfo", consume: false } },
551
+ "massif::PersistentCacheTileDataSource": { "download.completed": { payload: "", consume: false }, "download.failed": { payload: "massif::TileDownloadInfo", consume: false }, "download.progress": { payload: "massif::TileDownloadInfo", consume: false }, "download.started": { payload: "massif::TileDownloadInfo", consume: false } },
552
+ "massif::VectorLayer": { "vectorelement.clicked": { payload: "massif::VectorElementClickInfo", consume: true } },
553
+ "massif::VectorTileLayer": { "vectortile.clicked": { payload: "massif::VectorTileClickInfo", consume: true } }
554
+ };
555
+ var CLASS_NAMES = "Address,AnimationStyle,AnimationStyleBuilder,AssetPackage,AssetTileDataSource,BalloonPopup,BalloonPopupButton,BalloonPopupButtonClickInfo,BalloonPopupButtonStyle,BalloonPopupButtonStyleBuilder,BalloonPopupEventListener,BalloonPopupMargins,BalloonPopupStyle,BalloonPopupStyleBuilder,BaseMapView,Billboard,BillboardStyle,BillboardStyleBuilder,BinaryData,Bitmap,BitmapOverlayRasterTileDataSource,BundleAssetPackage,CacheTileDataSource,CartoCSSStyleSet,CelestialArc,CelestialClickInfo,CelestialEventListener,CelestialImage,CelestialLabel,CelestialLayer,CelestialObject,CelestialSprite,ClickInfo,ClusterElementBuilder,ClusterFetchTask,ClusteredVectorLayer,Color,CombinedTileDataSource,CompiledStyleSet,CompositeVectorTileLayer,ContourTileDataSource,CullState,CustomPopup,CustomPopupHandler,CustomRasterTileLayer,DataSourceListener,DirAssetPackage,DouglasPeuckerGeometrySimplifier,DownloadTask,EPSG3857,EPSG4326,EditableVectorLayer,ElevationDecoder,EventListener,Feature,FeatureBuilder,FeatureCollection,FeatureCollectionSearchService,FetchTask,FetchTaskBase,FetchingTasks,FetchingTileTasks,FogOptions,GeoJSONGeometryReader,GeoJSONGeometryWriter,GeoJSONVectorTileDataSource,GeocodingAddress,GeocodingRequest,GeocodingResult,GeocodingService,Geometry,GeometryCollection,GeometryCollectionStyle,GeometryCollectionStyleBuilder,GeometrySimplifier,HTTPTileDataSource,HillshadeRasterTileLayer,Label,LabelStyle,LabelStyleBuilder,Layer,Layers,LightOptions,LightStop,Line,LineGeometry,LineStyle,LineStyleBuilder,LocalVectorDataSource,Log,LogEventListener,MBTilesTileDataSource,MBVectorTileDecoder,ManeuverArrowBuilder,MapBounds,MapBoxElevationDataDecoder,MapBoxOnlineGeocodingService,MapBoxOnlineReverseGeocodingService,MapClickInfo,MapEnvelope,MapEventListener,MapInteractionInfo,MapMoveInfo,MapPos,MapRange,MapRenderer,MapRendererListener,MapTile,MapTilerOnlineTileDataSource,MapVec,Marker,MarkerStyle,MarkerStyleBuilder,MassifApi,MassifInterop,MemoryCacheTileDataSource,MergedMBVTTileDataSource,MultiGeometry,MultiLineGeometry,MultiOSMOfflineGeocodingService,MultiOSMOfflineReverseGeocodingService,MultiPointGeometry,MultiPolygonGeometry,MultiTileDataSource,MultiValhallaOfflineRoutingService,NMLModel,NMLModelStyle,NMLModelStyleBuilder,OSMOfflineGeocodingService,OSMOfflineReverseGeocodingService,OSRMOfflineRoutingService,OnChangeListener,Options,OptionsListener,OrderedTileDataSource,PMTilesTileDataSource,PackageInfo,PackageManager,PackageManagerGeocodingService,PackageManagerListener,PackageManagerReverseGeocodingService,PackageManagerRoutingService,PackageManagerTileDataSource,PackageManagerValhallaRoutingService,PackageMetaInfo,PackageStatus,PackageTileMask,PeliasOnlineGeocodingService,PeliasOnlineReverseGeocodingService,PersistentCacheTileDataSource,PersistentTaskQueue,Point,PointDetailTileDataSource,PointGeometry,PointStyle,PointStyleBuilder,Polygon,Polygon3D,Polygon3DStyle,Polygon3DStyleBuilder,PolygonGeometry,PolygonStyle,PolygonStyleBuilder,Popup,PopupClickInfo,PopupDrawInfo,PopupStyle,PopupStyleBuilder,PostProcessEffect,Projection,RasterTileClickInfo,RasterTileEventListener,RasterTileLayer,RedrawRequestListener,RendererCaptureListener,ReverseGeocodingRequest,ReverseGeocodingService,RouteMatchingEdge,RouteMatchingPoint,RouteMatchingRequest,RouteMatchingResult,RoutingInstruction,RoutingRequest,RoutingResult,RoutingService,SGREOfflineRoutingService,ScreenBounds,ScreenPos,SearchRequest,SkyOptions,SolidLayer,Style,StyleBuilder,TerrainOptions,TerrariumElevationDataDecoder,Text,TextMargins,TextStyle,TextStyleBuilder,TileData,TileDataSource,TileDecoderListener,TileDownloadInfo,TileDownloadListener,TileInfo,TileLayer,TileLoadListener,TileUtils,TomTomOnlineGeocodingService,TomTomOnlineReverseGeocodingService,TorqueTileDecoder,TorqueTileLayer,TouchHandlerListener,UTFGridClickInfo,UTFGridEventListener,UiDispatcher,ValhallaOfflineRoutingService,ValhallaOnlineRoutingService,Variant,VariantArrayBuilder,VariantObjectBuilder,VectorData,VectorDataSource,VectorEditEventListener,VectorElement,VectorElementClickInfo,VectorElementDragInfo,VectorElementEventListener,VectorElementSearchService,VectorLayer,VectorTileClickInfo,VectorTileDecoder,VectorTileEventListener,VectorTileFeature,VectorTileFeatureBuilder,VectorTileFeatureCollection,VectorTileLayer,VectorTileSearchService,ViewState,WKBGeometryReader,WKBGeometryWriter,WKTGeometryReader,WKTGeometryWriter,ZippedAssetPackage";
556
+
557
+ // ../../bindings/js/dist/resolve.js
558
+ var propCache = {};
559
+ var aliasCache = {};
560
+ var methodCache = {};
561
+ function parseProps(cls) {
562
+ let table = propCache[cls];
563
+ if (!table) {
564
+ table = propCache[cls] = {};
565
+ const encoded = PROPS[cls];
566
+ if (encoded) {
567
+ for (const entry of encoded.split(";")) {
568
+ const [name, code, arg] = entry.split(",");
569
+ table[name] = arg ? { code, arg } : { code };
570
+ }
571
+ }
572
+ }
573
+ return table;
574
+ }
575
+ function parseAliases(cls) {
576
+ let table = aliasCache[cls];
577
+ if (!table) {
578
+ table = aliasCache[cls] = {};
579
+ const encoded = ALIASES[cls];
580
+ if (encoded) {
581
+ for (const entry of encoded.split(";")) {
582
+ const [alias, path] = entry.split("=");
583
+ table[alias] = path;
584
+ }
585
+ }
586
+ }
587
+ return table;
588
+ }
589
+ function parseMethods(cls) {
590
+ let table = methodCache[cls];
591
+ if (!table) {
592
+ table = methodCache[cls] = {};
593
+ const encoded = METHODS[cls];
594
+ if (encoded) {
595
+ for (const entry of encoded.split(";")) {
596
+ const [name, code, arg] = entry.split(",");
597
+ table[name] = arg ? { code, arg } : { code };
598
+ }
599
+ }
600
+ }
601
+ return table;
602
+ }
603
+ function propertyNames(cls) {
604
+ const names2 = [];
605
+ let walk = cls;
606
+ while (walk) {
607
+ for (const name of Object.keys(parseProps(walk))) {
608
+ if (names2.indexOf(name) < 0) {
609
+ names2.push(name);
610
+ }
611
+ }
612
+ walk = BASES[walk];
613
+ }
614
+ return names2;
615
+ }
616
+ function findProperty(cls, name) {
617
+ let walk = cls;
618
+ while (walk) {
619
+ const found = parseProps(walk)[name] ?? parseProps(walk)[parseAliases(walk)[name]];
620
+ if (found) {
621
+ return found;
622
+ }
623
+ walk = BASES[walk];
624
+ }
625
+ return null;
626
+ }
627
+ function resolvePath(cls, path) {
628
+ if (!path) {
629
+ return null;
630
+ }
631
+ const segments = path.split(".");
632
+ let current = cls;
633
+ for (let i = 0; i < segments.length; i++) {
634
+ const prop = findProperty(current, segments[i]);
635
+ if (!prop) {
636
+ return null;
637
+ }
638
+ if (i === segments.length - 1) {
639
+ return prop.code === "g" ? { code: "v" } : prop;
640
+ }
641
+ if (prop.code === "o") {
642
+ current = prop.arg;
643
+ continue;
644
+ }
645
+ if (prop.code === "g") {
646
+ return { code: prop.arg ?? "s" };
647
+ }
648
+ return prop.code === "t" || prop.code === "p" || prop.code === "v" ? { code: "v" } : null;
649
+ }
650
+ return null;
651
+ }
652
+ function findMethod(cls, name) {
653
+ let walk = cls;
654
+ while (walk) {
655
+ const found = parseMethods(walk)[name];
656
+ if (found) {
657
+ return found;
658
+ }
659
+ walk = BASES[walk];
660
+ }
661
+ return null;
662
+ }
663
+ function resolveMethod(cls, path) {
664
+ const cut = path.lastIndexOf(".");
665
+ if (cut < 0) {
666
+ return findMethod(cls, path);
667
+ }
668
+ const owner = resolvePath(cls, path.substring(0, cut));
669
+ return owner && owner.code === "o" ? findMethod(owner.arg, path.substring(cut + 1)) : null;
670
+ }
671
+ function findEvent(cls, event) {
672
+ let walk = cls;
673
+ while (walk) {
674
+ const table = EVENTS[walk];
675
+ if (table && event in table) {
676
+ return table[event];
677
+ }
678
+ walk = BASES[walk];
679
+ }
680
+ return null;
681
+ }
682
+ function eventNames(cls) {
683
+ const names2 = [];
684
+ let walk = cls;
685
+ while (walk) {
686
+ for (const name of Object.keys(EVENTS[walk] ?? {})) {
687
+ if (names2.indexOf(name) < 0) {
688
+ names2.push(name);
689
+ }
690
+ }
691
+ walk = BASES[walk];
692
+ }
693
+ return names2;
694
+ }
695
+ var enumTables;
696
+ function tables() {
697
+ if (!enumTables) {
698
+ const built = { byName: {}, byValue: {} };
699
+ for (const enumType of Object.keys(ENUMS)) {
700
+ const reverse = built.byValue[enumType] = {};
701
+ for (const member of ENUMS[enumType].split(",")) {
702
+ const cut = member.lastIndexOf("=");
703
+ const name = member.substring(0, cut);
704
+ const value = member.substring(cut + 1);
705
+ built.byName[name] = Number(value);
706
+ reverse[value] = name;
707
+ }
708
+ }
709
+ enumTables = built;
710
+ }
711
+ return enumTables;
712
+ }
713
+ function enumValue(name) {
714
+ return tables().byName[name];
715
+ }
716
+ function enumName(enumType, value) {
717
+ const table = enumType ? tables().byValue[enumType] : void 0;
718
+ return table && table[value] !== void 0 ? table[value] : value;
719
+ }
720
+ function classOfSpec(kind, type) {
721
+ return SPEC_CLASS[kind]?.[type] ?? null;
722
+ }
723
+ function specKindOf(cppClass) {
724
+ return KIND_OF_CLASS[cppClass] ?? null;
725
+ }
726
+ var known;
727
+ function knownClasses() {
728
+ if (!known) {
729
+ known = {};
730
+ for (const name of CLASS_NAMES.split(",")) {
731
+ known[name] = true;
732
+ }
733
+ }
734
+ return known;
735
+ }
736
+ function classOfShortName(short) {
737
+ return short && knownClasses()[short] ? `massif::${short}` : null;
738
+ }
739
+ function isKnownClass(cls) {
740
+ return !!knownClasses()[cls.replace("massif::", "")];
741
+ }
742
+ function isSubclassOf(cls, base) {
743
+ let walk = cls;
744
+ while (walk) {
745
+ if (walk === base) {
746
+ return true;
747
+ }
748
+ walk = BASES[walk];
749
+ }
750
+ return false;
751
+ }
752
+
753
+ // ../../bindings/js/dist/index.js
754
+ var Result = {
755
+ OK: 0,
756
+ BAD_HANDLE: 1,
757
+ UNKNOWN_CLASS: 2,
758
+ UNKNOWN_PROPERTY: 3,
759
+ READONLY: 4,
760
+ UNSUPPORTED_TYPE: 5,
761
+ NULL_OBJECT: 8
762
+ };
763
+ var MassifApiError = class extends Error {
764
+ constructor(message, result) {
765
+ super(message);
766
+ this.result = result;
767
+ this.name = "MassifApiError";
768
+ }
769
+ };
770
+ function isAvailable() {
771
+ return bridge.available;
772
+ }
773
+ function canConsume() {
774
+ return bridge.canConsume;
775
+ }
776
+ function requireApi() {
777
+ if (!bridge.available) {
778
+ throw new MassifApiError("this MassifMaps build has no surface API - the SDK was built without all/native/api");
779
+ }
780
+ }
781
+ var DELIVERY_ORIGIN = 0;
782
+ var payloadProtos = {};
783
+ function payloadProto(payloadClass) {
784
+ let proto = payloadProtos[payloadClass];
785
+ if (!proto) {
786
+ proto = payloadProtos[payloadClass] = {};
787
+ for (const name of propertyNames(payloadClass)) {
788
+ Object.defineProperty(proto, name, {
789
+ enumerable: true,
790
+ configurable: true,
791
+ get() {
792
+ return this.get(name);
793
+ }
794
+ });
795
+ }
796
+ }
797
+ return proto;
798
+ }
799
+ var Subscription = class {
800
+ constructor(id) {
801
+ this.id = id;
802
+ this.mRemoved = false;
803
+ this.mCancelPending = null;
804
+ }
805
+ get valid() {
806
+ return !this.mRemoved;
807
+ }
808
+ remove() {
809
+ if (this.mRemoved) {
810
+ return false;
811
+ }
812
+ this.mRemoved = true;
813
+ if (this.mCancelPending) {
814
+ this.mCancelPending();
815
+ this.mCancelPending = null;
816
+ }
817
+ return bridge.off(this.id);
818
+ }
819
+ /** @internal */
820
+ onRemove(cancel) {
821
+ this.mCancelPending = cancel;
822
+ }
823
+ };
824
+ function parseJson(text) {
825
+ if (text === null || text === "") {
826
+ return null;
827
+ }
828
+ try {
829
+ return JSON.parse(text);
830
+ } catch (e) {
831
+ return text;
832
+ }
833
+ }
834
+ function isSpec(value) {
835
+ return !!value && typeof value === "object" && !Array.isArray(value) && !(value instanceof MassifObject) && typeof value.handle !== "number" && typeof value.type === "string";
836
+ }
837
+ function handleOf(value) {
838
+ if (typeof value === "number") {
839
+ return value;
840
+ }
841
+ if (value && typeof value.handle === "number") {
842
+ return value.handle;
843
+ }
844
+ return 0;
845
+ }
846
+ function toPosition(position) {
847
+ if (Array.isArray(position)) {
848
+ return position;
849
+ }
850
+ const lng = position.longitude ?? position.lng ?? position.lon;
851
+ const lat = position.latitude ?? position.lat;
852
+ const altitude = position.altitude ?? position.alt;
853
+ if (lng === void 0 || lat === void 0) {
854
+ throw new MassifApiError(`not a position: ${JSON.stringify(position)}`);
855
+ }
856
+ return altitude ? [lng, lat, altitude] : [lng, lat];
857
+ }
858
+ function argsJson(args) {
859
+ return JSON.stringify(args.map((a) => a instanceof MassifObject ? a.handle : a));
860
+ }
861
+ var PropertyGroup = class {
862
+ constructor(owner, prefix, className) {
863
+ this.owner = owner;
864
+ this.prefix = prefix;
865
+ this.className = className;
866
+ }
867
+ /** The full path this group would write, for logging or for a raw call. */
868
+ path(path) {
869
+ return this.prefix ? `${this.prefix}.${path}` : path;
870
+ }
871
+ get(path) {
872
+ return this.owner.get(this.path(path));
873
+ }
874
+ set(path, value) {
875
+ this.owner.set(this.path(path), value);
876
+ return this;
877
+ }
878
+ /** Applies several properties in one call, prefixed - so the owner batches them as one. */
879
+ apply(values) {
880
+ const prefixed = {};
881
+ for (const key of Object.keys(values)) {
882
+ prefixed[this.path(key)] = values[key];
883
+ }
884
+ this.owner.apply(prefixed);
885
+ return this;
886
+ }
887
+ getPos(path, projection) {
888
+ return this.owner.getPos(this.path(path), projection);
889
+ }
890
+ group(path) {
891
+ return this.owner.group(this.path(path));
892
+ }
893
+ /** @see MassifObject.child */
894
+ child(path) {
895
+ return this.owner.child(this.path(path));
896
+ }
897
+ };
898
+ var MassifObject = class _MassifObject extends Observable {
899
+ constructor(handle, className, id) {
900
+ super();
901
+ this.handle = handle;
902
+ this.className = className;
903
+ this.id = id;
904
+ this.mSubscriptions = {};
905
+ this.mDefaults = {};
906
+ this.mDestroyed = false;
907
+ }
908
+ /**
909
+ * Whether this object is of a class, or of one below it.
910
+ *
911
+ * `instanceof`, for an API that addresses classes by name: `layer.is('massif::RasterTileLayer')`
912
+ * is how an app asks "is this one of the raster ones" without the SDK's proxy classes.
913
+ */
914
+ is(className) {
915
+ return isSubclassOf(this.className, className);
916
+ }
917
+ /** Whether the handle still resolves. False after `destroy`, and after the id was dropped. */
918
+ get valid() {
919
+ return !this.mDestroyed && bridge.isValid(this.handle);
920
+ }
921
+ // --- properties ---------------------------------------------------------------------------
922
+ /**
923
+ * Reads a property.
924
+ *
925
+ * The path may walk object properties (`fogOptions.rangeStart`), into a struct
926
+ * (`clickInfo.clickType`) and into free-form data (`properties.name`). An enum comes back as
927
+ * its constant name, a position as `[lon, lat]`, a struct as the JSON it encodes.
928
+ */
929
+ get(path) {
930
+ return this.read(path);
931
+ }
932
+ read(path) {
933
+ const info = resolvePath(this.className, path);
934
+ switch (info?.code) {
935
+ case "b":
936
+ return bridge.getBool(this.handle, path, false);
937
+ case "i":
938
+ case "c":
939
+ return bridge.getInt(this.handle, path, 0);
940
+ case "f":
941
+ return bridge.getFloat(this.handle, path, 0);
942
+ case "s":
943
+ return bridge.getString(this.handle, path);
944
+ case "e":
945
+ return enumName(info.arg, bridge.getInt(this.handle, path, 0));
946
+ case "p":
947
+ return parseJson(bridge.getPos(this.handle, path, ""));
948
+ case "t":
949
+ return parseJson(bridge.getString(this.handle, path));
950
+ case "o":
951
+ throw new MassifApiError(`${path} is an object property - reach it with group('${path}'), child('${path}') or read a path through it`);
952
+ default:
953
+ return parseJson(bridge.getString(this.handle, path));
954
+ }
955
+ }
956
+ /**
957
+ * Writes a property. Every path but an object one takes the JavaScript value directly - an
958
+ * enum by its constant name, a position as an array.
959
+ */
960
+ set(path, value) {
961
+ const result = this.write(path, value);
962
+ if (result !== Result.OK) {
963
+ throw new MassifApiError(`${this.className}.${path}: ${resultName(result)}`, result);
964
+ }
965
+ return this;
966
+ }
967
+ /** The same without throwing, for a path that may legitimately not be there. */
968
+ trySet(path, value) {
969
+ return this.write(path, value);
970
+ }
971
+ write(path, value) {
972
+ const info = resolvePath(this.className, path);
973
+ switch (info?.code) {
974
+ case "b":
975
+ return bridge.setBool(this.handle, path, !!value);
976
+ case "i":
977
+ case "c":
978
+ return bridge.setInt(this.handle, path, value);
979
+ case "f":
980
+ return bridge.setFloat(this.handle, path, value);
981
+ case "s":
982
+ return bridge.setString(this.handle, path, String(value));
983
+ case "e":
984
+ return bridge.setInt(this.handle, path, enumValue(String(value)) ?? Number(value));
985
+ case "o":
986
+ return isSpec(value) ? this.writeSpec(path, info.arg, value) : bridge.setObject(this.handle, path, handleOf(value));
987
+ case "p":
988
+ case "t":
989
+ case "v":
990
+ return bridge.setString(this.handle, path, JSON.stringify(value));
991
+ default:
992
+ return this.writeByType(path, value);
993
+ }
994
+ }
995
+ /**
996
+ * An OBJECT property written from an INLINE SPEC, the way a constructor argument takes one.
997
+ *
998
+ * `setObject` carries a handle and nothing else, so a spec used to collapse to NULL_HANDLE -
999
+ * which CLEARS the property and returns OK. Setting `backgroundBitmap` that way blanked the
1000
+ * map background and reported success.
1001
+ *
1002
+ * The built object is registered under an id derived from the target, so it stays alive as
1003
+ * long as the property points at it and a second write replaces it rather than leaking.
1004
+ */
1005
+ writeSpec(path, objectClass, spec) {
1006
+ const kind = specKindOf(objectClass);
1007
+ if (!kind) {
1008
+ return Result.UNKNOWN_CLASS;
1009
+ }
1010
+ const id = `${this.id ?? this.handle}.${path}`;
1011
+ find(kind, id, objectClass)?.destroy();
1012
+ const built = create(kind, id, spec, objectClass);
1013
+ return bridge.setObject(this.handle, path, built.handle);
1014
+ }
1015
+ /** The fallback for a path the tables cannot resolve: pick the verb from the value. */
1016
+ writeByType(path, value) {
1017
+ if (typeof value === "boolean") {
1018
+ return bridge.setBool(this.handle, path, value);
1019
+ }
1020
+ if (typeof value === "number") {
1021
+ return bridge.setFloat(this.handle, path, value);
1022
+ }
1023
+ if (typeof value === "string") {
1024
+ const asEnum = enumValue(value);
1025
+ return asEnum === void 0 ? bridge.setString(this.handle, path, value) : bridge.setInt(this.handle, path, asEnum);
1026
+ }
1027
+ if (value instanceof _MassifObject) {
1028
+ return bridge.setObject(this.handle, path, value.handle);
1029
+ }
1030
+ return bridge.setString(this.handle, path, JSON.stringify(value));
1031
+ }
1032
+ /**
1033
+ * Applies several properties in ONE crossing.
1034
+ *
1035
+ * `set` per key is one JNI or JSI call each, and configuring a layer writes a dozen. The
1036
+ * facade takes the whole object as JSON, which is the shape a spec already has.
1037
+ *
1038
+ * A key whose value is another object - a handle or an inline spec - cannot be JSON, so those
1039
+ * go one by one as before. So does everything, on an SDK built before `setAll`.
1040
+ */
1041
+ apply(values) {
1042
+ const setAll = bridge.setAll;
1043
+ const batched = {};
1044
+ const single = [];
1045
+ for (const key of Object.keys(values)) {
1046
+ const value = values[key];
1047
+ if (!setAll || value instanceof _MassifObject || isSpec(value) || resolvePath(this.className, key)?.code === "o") {
1048
+ single.push(key);
1049
+ } else {
1050
+ batched[key] = value;
1051
+ }
1052
+ }
1053
+ if (setAll && Object.keys(batched).length) {
1054
+ const result = setAll(this.handle, JSON.stringify(batched), "");
1055
+ if (result !== Result.OK) {
1056
+ single.unshift(...Object.keys(batched));
1057
+ }
1058
+ }
1059
+ for (const key of single) {
1060
+ this.set(key, values[key]);
1061
+ }
1062
+ return this;
1063
+ }
1064
+ getPos(path, projection) {
1065
+ const json = bridge.getPos(this.handle, path, projection ?? "");
1066
+ return json ? JSON.parse(json) : null;
1067
+ }
1068
+ /** A scope over an object property, so its own properties read short. */
1069
+ group(path) {
1070
+ const info = resolvePath(this.className, path);
1071
+ if (!info || info.code !== "o") {
1072
+ throw new MassifApiError(`${this.className}.${path} is not an object property`);
1073
+ }
1074
+ return new PropertyGroup(this, path, info.arg);
1075
+ }
1076
+ /**
1077
+ * The object an object property points at, as an object the CALLER OWNS - `destroy()` it.
1078
+ *
1079
+ * `group` reads THROUGH a child; this hands it over, which is what SHARING one needs: an
1080
+ * overlay drawing the base map's tiles with a different style points at that source rather
1081
+ * than building a second one over the same file.
1082
+ *
1083
+ * Null when the property is empty.
1084
+ */
1085
+ child(path) {
1086
+ const info = resolvePath(this.className, path);
1087
+ if (!info || info.code !== "o") {
1088
+ throw new MassifApiError(`${this.className}.${path} is not an object property`);
1089
+ }
1090
+ const handle = bridge.getObject(this.handle, path);
1091
+ return handle ? new _MassifObject(handle, info.arg) : null;
1092
+ }
1093
+ // --- methods ------------------------------------------------------------------------------
1094
+ /**
1095
+ * Runs a method. The path may traverse object properties, so
1096
+ * `layer.call('tileDecoder.setStyleParameter', 'buildings', 'false')` reaches the decoder
1097
+ * without registering it under an id of its own.
1098
+ *
1099
+ * A result that is an object is handed back as a `MassifObject` the CALLER OWNS - call
1100
+ * `destroy()` on it, or it stays registered. Everything else is copied out already.
1101
+ */
1102
+ call(method, ...args) {
1103
+ return this.invoke(method, args);
1104
+ }
1105
+ /**
1106
+ * The untyped form of `call`, for the named wrappers below and in the subclasses.
1107
+ *
1108
+ * They know which class declares the method they are calling; `call`'s generic does not,
1109
+ * because `C` is whatever the caller parameterised the object with.
1110
+ */
1111
+ invoke(method, args) {
1112
+ const info = resolveMethod(this.className, method);
1113
+ let result;
1114
+ try {
1115
+ result = bridge.call(this.handle, method, argsJson(args));
1116
+ } catch (e) {
1117
+ throw new MassifApiError(`${this.className}.${method}: ${e?.message ?? e}`);
1118
+ }
1119
+ return this.readResult(result, info?.code, info?.arg, true);
1120
+ }
1121
+ readResult(handle, code, cls, owned) {
1122
+ if (!handle) {
1123
+ return void 0;
1124
+ }
1125
+ try {
1126
+ switch (code) {
1127
+ case "v":
1128
+ return void 0;
1129
+ case "b":
1130
+ return bridge.getBool(handle, "", false);
1131
+ case "i":
1132
+ return bridge.getInt(handle, "", 0);
1133
+ case "f":
1134
+ return bridge.getFloat(handle, "", 0);
1135
+ case "s":
1136
+ return bridge.getString(handle, "");
1137
+ case "d":
1138
+ return bridge.getDoubles(handle);
1139
+ case "o": {
1140
+ if (!cls) {
1141
+ throw new MassifApiError("an object result with no class - regenerate the typings with `npm run typings.api`");
1142
+ }
1143
+ owned = false;
1144
+ return new _MassifObject(handle, cls);
1145
+ }
1146
+ default:
1147
+ return parseJson(bridge.getString(handle, ""));
1148
+ }
1149
+ } finally {
1150
+ if (owned) {
1151
+ bridge.destroy(handle);
1152
+ }
1153
+ }
1154
+ }
1155
+ /**
1156
+ * The same on a worker, with the result delivered as an event the promise resolves from.
1157
+ *
1158
+ * `extract` runs INSIDE the delivery, which is the only place an object result is alive - the
1159
+ * facade frees the payload once the handlers have run. Read what you need out of it:
1160
+ *
1161
+ * ```ts
1162
+ * const bytes = await source.callAsync('loadTile', [[8467, 5852, 14]], (tile) => tile.getData('data'));
1163
+ * ```
1164
+ *
1165
+ * A scalar or a flat array is copied out already, so `extract` can be left off for those.
1166
+ */
1167
+ callAsync(method, args, extract) {
1168
+ const info = resolveMethod(this.className, method);
1169
+ if (info?.code === "o" && !extract) {
1170
+ throw new MassifApiError(`${this.className}.${String(method)} returns an object - pass an extract function, it runs while the result is alive`);
1171
+ }
1172
+ const event = `${String(method)}.done.${nextCallId()}`;
1173
+ let call = 0;
1174
+ let subscription;
1175
+ const promise = new Promise((resolve, reject) => {
1176
+ subscription = this.subscribeRaw(event, (payload) => {
1177
+ subscription?.remove();
1178
+ if (!payload) {
1179
+ reject(new MassifApiError(`${this.className}.${String(method)} failed`));
1180
+ return false;
1181
+ }
1182
+ try {
1183
+ const value = info?.code === "o" || extract ? new _MassifObject(payload, info?.arg ?? this.className) : null;
1184
+ resolve(extract ? extract(value) : this.readResult(payload, info?.code, info?.arg, false));
1185
+ } catch (e) {
1186
+ reject(e);
1187
+ }
1188
+ return false;
1189
+ });
1190
+ try {
1191
+ call = bridge.callAsync(this.handle, method, argsJson(args), event);
1192
+ } catch (e) {
1193
+ subscription?.remove();
1194
+ reject(new MassifApiError(`${this.className}.${String(method)}: ${e?.message ?? e}`));
1195
+ }
1196
+ });
1197
+ promise.cancel = () => {
1198
+ const cancelled = call ? bridge.cancelCall(call) : false;
1199
+ subscription?.remove();
1200
+ return cancelled;
1201
+ };
1202
+ return promise;
1203
+ }
1204
+ /** Cancels every queued or running async call on this object. */
1205
+ cancelCalls() {
1206
+ return bridge.cancelCalls(this.handle);
1207
+ }
1208
+ collect(map, options = {}) {
1209
+ const countPath = options.countPath ?? "featureCount";
1210
+ const method = options.method ?? "getFeature";
1211
+ const count = bridge.getInt(this.handle, countPath, 0);
1212
+ const out = [];
1213
+ for (let i = 0; i < count; i++) {
1214
+ const element = this.invoke(method, [i]);
1215
+ if (!element) {
1216
+ continue;
1217
+ }
1218
+ try {
1219
+ out.push(map(element, i));
1220
+ } finally {
1221
+ element.destroy();
1222
+ }
1223
+ }
1224
+ return out;
1225
+ }
1226
+ /**
1227
+ * Anything, as JSON.
1228
+ *
1229
+ * The escape hatch for a path the tables cannot type - a key inside a feature's free-form
1230
+ * properties, or a class more derived than the one this object was wrapped as.
1231
+ */
1232
+ json(path = "") {
1233
+ return parseJson(bridge.getString(this.handle, path));
1234
+ }
1235
+ /** A blob, without turning it into a string. An empty path means the handle IS the blob. */
1236
+ getData(path = "") {
1237
+ return bridge.getData(this.handle, path);
1238
+ }
1239
+ /** A bulk numeric result - a route's path, an elevation profile - flat and in one crossing. */
1240
+ getDoubles() {
1241
+ return bridge.getDoubles(this.handle);
1242
+ }
1243
+ // --- events -------------------------------------------------------------------------------
1244
+ /** The delivery options every later subscription on this object starts from. */
1245
+ eventOptions(options) {
1246
+ this.mDefaults = { ...this.mDefaults, ...options };
1247
+ return this;
1248
+ }
1249
+ /** Every facade event this object answers to, its own and its bases'. */
1250
+ get events() {
1251
+ return eventNames(this.className);
1252
+ }
1253
+ /**
1254
+ * Subscribes with options of its own, and hands back the subscription to remove.
1255
+ *
1256
+ * `on` is the Observable form and covers most cases; this is for a handler that needs a
1257
+ * different projection or delivery from the object's default.
1258
+ */
1259
+ subscribe(event, handler, options) {
1260
+ const consumable = this.consumes(event);
1261
+ return this.subscribeRaw(event, (payload, snapshot) => {
1262
+ const data = this.eventData(event, payload, consumable, snapshot);
1263
+ handler(data);
1264
+ warnIfIgnored(data, consumable, event);
1265
+ return consumable && data.consumed;
1266
+ }, options);
1267
+ }
1268
+ /** Whether `consumed` will be honoured for this subscription. */
1269
+ consumes(event) {
1270
+ return bridge.canConsume && !!findEvent(this.className, event)?.consume;
1271
+ }
1272
+ subscribeRaw(event, handler, options) {
1273
+ requireApi();
1274
+ this.beforeSubscribe(event);
1275
+ const merged = { ...this.mDefaults, ...options };
1276
+ const throttle = merged.throttle ?? 0;
1277
+ const debounce = merged.debounce ?? 0;
1278
+ const consumable = this.consumes(event);
1279
+ if (debounce && consumable) {
1280
+ throw new MassifApiError(`${event} is consumable, so it cannot be debounced - the SDK is waiting for the answer now, not in ${debounce} ms`);
1281
+ }
1282
+ let last = 0;
1283
+ let timer = null;
1284
+ const deliver = (payload) => {
1285
+ if (throttle) {
1286
+ const now = Date.now();
1287
+ if (now - last < throttle) {
1288
+ return false;
1289
+ }
1290
+ last = now;
1291
+ }
1292
+ if (debounce) {
1293
+ const snapshot = payload ? parseJson(bridge.getString(payload, "")) : null;
1294
+ if (timer) {
1295
+ clearTimeout(timer);
1296
+ }
1297
+ timer = setTimeout(() => {
1298
+ timer = null;
1299
+ try {
1300
+ handler(0, snapshot);
1301
+ } catch (error) {
1302
+ console.error(`MassifMaps: debounced handler for '${event}' threw`, error);
1303
+ }
1304
+ }, debounce);
1305
+ return false;
1306
+ }
1307
+ return handler(payload);
1308
+ };
1309
+ const id = bridge.on(this.handle, event, (_target, _event, payload) => {
1310
+ try {
1311
+ return deliver(payload);
1312
+ } catch (error) {
1313
+ console.error(`MassifMaps: handler for '${event}' threw`, error);
1314
+ return false;
1315
+ }
1316
+ }, DELIVERY_ORIGIN, false, merged.projection ?? "", consumable);
1317
+ if (!id) {
1318
+ throw new MassifApiError(`could not subscribe to ${event} on ${this.className} - a stale handle, or an unknown projection`);
1319
+ }
1320
+ const subscription = new Subscription(id);
1321
+ if (debounce) {
1322
+ subscription.onRemove(() => {
1323
+ if (timer) {
1324
+ clearTimeout(timer);
1325
+ timer = null;
1326
+ }
1327
+ });
1328
+ }
1329
+ return subscription;
1330
+ }
1331
+ /** Hook for a subclass that has to install a native listener before the first subscription. */
1332
+ beforeSubscribe(event) {
1333
+ }
1334
+ eventData(event, payload, consumable, snapshot) {
1335
+ const info = findEvent(this.className, event);
1336
+ const fromSnapshot = snapshot !== void 0 && snapshot !== null;
1337
+ let object;
1338
+ const payloadObject = () => {
1339
+ if (object === void 0) {
1340
+ object = payload && info?.payload ? new _MassifObject(payload, info.payload) : null;
1341
+ }
1342
+ return object;
1343
+ };
1344
+ const proto = (payload || fromSnapshot) && info?.payload ? payloadProto(info.payload) : null;
1345
+ const data = Object.assign(proto ? Object.create(proto) : {}, {
1346
+ eventName: event,
1347
+ object: this,
1348
+ consumed: false,
1349
+ consumable,
1350
+ get: (path) => {
1351
+ if (fromSnapshot) {
1352
+ return path ? snapshot[path] : snapshot;
1353
+ }
1354
+ const target = payloadObject();
1355
+ if (!target) {
1356
+ throw new MassifApiError(`${event} carries no payload`);
1357
+ }
1358
+ return target.get(path);
1359
+ },
1360
+ getPos: (path, projection) => {
1361
+ if (fromSnapshot) {
1362
+ return snapshot[path] ?? null;
1363
+ }
1364
+ const target = payloadObject();
1365
+ return target ? target.getPos(path, projection) : null;
1366
+ }
1367
+ });
1368
+ Object.defineProperty(data, "payload", { enumerable: true, configurable: true, get: payloadObject });
1369
+ return data;
1370
+ }
1371
+ /**
1372
+ * Observable's `on`, with the event name and the payload typed.
1373
+ *
1374
+ * ```ts
1375
+ * layer.on('vectortile.clicked', (e) => console.log(e.get('featureLayerName')));
1376
+ * ```
1377
+ *
1378
+ * Deliberately NOT widened to `string`: a typo in an event name is the failure this whole
1379
+ * layer exists to catch, and `addEventListener` is still there for a name of your own.
1380
+ */
1381
+ on(event, callback, thisArg) {
1382
+ super.on(event, callback, thisArg);
1383
+ }
1384
+ once(event, callback, thisArg) {
1385
+ super.once(event, callback, thisArg);
1386
+ }
1387
+ off(event, callback, thisArg) {
1388
+ super.off(event, callback, thisArg);
1389
+ }
1390
+ /**
1391
+ * Observable's own hook. A facade event takes its native subscription here, on the first
1392
+ * handler, so nothing is listening that nobody asked for.
1393
+ */
1394
+ addEventListener(eventNames2, callback, thisArg, ...rest) {
1395
+ super.addEventListener(eventNames2, callback, thisArg, ...rest);
1396
+ for (const name of splitEvents(eventNames2)) {
1397
+ if (!this.mSubscriptions[name] && findEvent(this.className, name) !== null) {
1398
+ const consumable = this.consumes(name);
1399
+ this.mSubscriptions[name] = this.subscribeRaw(name, (payload, snapshot) => {
1400
+ const data = this.eventData(name, payload, consumable, snapshot);
1401
+ this.notify(data);
1402
+ warnIfIgnored(data, consumable, name);
1403
+ return consumable && data.consumed;
1404
+ });
1405
+ }
1406
+ }
1407
+ }
1408
+ removeEventListener(eventNames2, callback, thisArg) {
1409
+ super.removeEventListener(eventNames2, callback, thisArg);
1410
+ for (const name of splitEvents(eventNames2)) {
1411
+ if (this.mSubscriptions[name] && !this.hasListeners(name)) {
1412
+ this.mSubscriptions[name].remove();
1413
+ delete this.mSubscriptions[name];
1414
+ }
1415
+ }
1416
+ }
1417
+ // --- lifetime -----------------------------------------------------------------------------
1418
+ /**
1419
+ * Drops the id and the context's reference to the object. Subscriptions and pending async
1420
+ * calls die with it, which is what stops a handler running against a freed object.
1421
+ */
1422
+ destroy() {
1423
+ if (this.mDestroyed) {
1424
+ return false;
1425
+ }
1426
+ this.mDestroyed = true;
1427
+ for (const name of Object.keys(this.mSubscriptions)) {
1428
+ this.mSubscriptions[name].remove();
1429
+ }
1430
+ this.mSubscriptions = {};
1431
+ return bridge.destroy(this.handle);
1432
+ }
1433
+ toString() {
1434
+ return `${this.constructor.name}(${this.className}#${this.handle}${this.id ? ` "${this.id}"` : ""})`;
1435
+ }
1436
+ };
1437
+ function splitEvents(eventNames2) {
1438
+ return eventNames2.split(",").map((n) => n.trim()).filter(Boolean);
1439
+ }
1440
+ var callId = 0;
1441
+ function nextCallId() {
1442
+ return ++callId;
1443
+ }
1444
+ var warnedConsume = {};
1445
+ function warnIfIgnored(data, consumable, event) {
1446
+ if (!data.consumed || consumable || warnedConsume[event]) {
1447
+ return;
1448
+ }
1449
+ warnedConsume[event] = true;
1450
+ const why = bridge.canConsume ? "it is not a consumable event" : "this SDK's MassifApi.on does not take the consume flag";
1451
+ console.warn(`massif: a handler consumed ${event} but nothing will act on it - ${why}`);
1452
+ }
1453
+ function resultName(result) {
1454
+ for (const name of Object.keys(Result)) {
1455
+ if (Result[name] === result) {
1456
+ return name;
1457
+ }
1458
+ }
1459
+ return `result ${result}`;
1460
+ }
1461
+ var MassifLayer = class extends MassifObject {
1462
+ constructor() {
1463
+ super(...arguments);
1464
+ this.mBridged = {};
1465
+ }
1466
+ beforeSubscribe(event) {
1467
+ if (this.mBridged[event] || !this.id) {
1468
+ return;
1469
+ }
1470
+ const native = bridge.getNativeLayer(this.id);
1471
+ if (!native) {
1472
+ return;
1473
+ }
1474
+ if (event === "vectortile.clicked") {
1475
+ bridge.attachVectorTileEvents(native, this.handle);
1476
+ } else if (event === "vectorelement.clicked") {
1477
+ bridge.attachVectorElementEvents(native, this.handle);
1478
+ } else if (event === "celestial.clicked" || event === "sky.clicked") {
1479
+ if (!this.mBridged["celestial.clicked"] && !this.mBridged["sky.clicked"]) {
1480
+ bridge.attachCelestialEvents(native, this.handle);
1481
+ }
1482
+ } else {
1483
+ return;
1484
+ }
1485
+ this.mBridged[event] = true;
1486
+ }
1487
+ /** The native layer, to hand back to the object API - by id, or by handle when it has none. */
1488
+ get native() {
1489
+ return this.id ? bridge.getNativeLayer(this.id) : bridge.getNativeLayerByHandle(this.handle);
1490
+ }
1491
+ opacity(value) {
1492
+ return value === void 0 ? this.get("opacity") : this.set("opacity", value);
1493
+ }
1494
+ visible(value) {
1495
+ return value === void 0 ? this.get("visible") : this.set("visible", value);
1496
+ }
1497
+ zoomRange(range) {
1498
+ return range === void 0 ? this.get("visibleZoomRange") : this.set("visibleZoomRange", range);
1499
+ }
1500
+ // --- placement ----------------------------------------------------------------------------
1501
+ /** Moves the layer within the map's stack. 0 is the bottom. */
1502
+ moveTo(index) {
1503
+ this.requireMap().layers().insert(index, this);
1504
+ return this;
1505
+ }
1506
+ /** Takes it off the map. The object stays registered until it is destroyed. */
1507
+ detach() {
1508
+ this.requireMap().layers().remove(this);
1509
+ return this;
1510
+ }
1511
+ // --- the layer methods, by name -----------------------------------------------------------
1512
+ refresh() {
1513
+ this.invoke("refresh", []);
1514
+ return this;
1515
+ }
1516
+ /**
1517
+ * The layer's data source, as an object the CALLER OWNS.
1518
+ *
1519
+ * `child('dataSource')` typed as a source, so `.native` is there: handing the base map's tiles
1520
+ * to the app's own native code is the one thing the facade cannot express, and this is the
1521
+ * escape hatch for it.
1522
+ */
1523
+ source() {
1524
+ const child = this.child("dataSource");
1525
+ return child ? new MassifSource(child.handle, child.className) : null;
1526
+ }
1527
+ /** Drops this layer's tiles. `all` includes the preloading caches, not just the visible set. */
1528
+ clearTileCaches(all = false) {
1529
+ this.invoke("clearTileCaches", [all]);
1530
+ return this;
1531
+ }
1532
+ /**
1533
+ * Elevations under a set of positions, flat and in one crossing - a profile over a track is
1534
+ * thousands of numbers and neither JSON nor a per-element proxy is an acceptable way to move
1535
+ * them. Only a hillshade layer answers; anything else gives an empty array.
1536
+ */
1537
+ elevations(positions) {
1538
+ try {
1539
+ return this.invoke("getElevations", [positions.map(toPosition)]);
1540
+ } catch (e) {
1541
+ return [];
1542
+ }
1543
+ }
1544
+ // --- clicks, by name ----------------------------------------------------------------------
1545
+ // The payload is named OUTRIGHT rather than as MassifEventData<C, EventName<C>>: each of
1546
+ // these subscribes to ONE event, and a layer whose class is not narrowed - the common case,
1547
+ // since `layers().get(i)` and `child('dataSource')` hand back a bare `MassifLayer` - resolved
1548
+ // that to MassifEventData<any, string>, which has no payload fields on it at all.
1549
+ /** `on('vectortile.clicked', …)`, named. Set `e.consumed` to claim the click. */
1550
+ onFeatureClick(handler, options) {
1551
+ return this.subscribe("vectortile.clicked", handler, options);
1552
+ }
1553
+ /** `on('vectorelement.clicked', …)`, named - a marker or a popup the app added. */
1554
+ onElementClick(handler, options) {
1555
+ return this.subscribe("vectorelement.clicked", handler, options);
1556
+ }
1557
+ /** `on('celestial.clicked', …)`, named - an object of a celestial layer. Set `e.consumed` to claim the click. */
1558
+ onCelestialClick(handler, options) {
1559
+ return this.subscribe("celestial.clicked", handler, options);
1560
+ }
1561
+ /** `on('sky.clicked', …)`, named - a tap on empty sky: it hit nothing, and has no ground position for `map.clicked`. */
1562
+ onSkyClick(handler, options) {
1563
+ return this.subscribe("sky.clicked", handler, options);
1564
+ }
1565
+ requireMap() {
1566
+ if (!this.map) {
1567
+ throw new MassifApiError(`layer is not attached to a map: ${this}`);
1568
+ }
1569
+ return this.map;
1570
+ }
1571
+ };
1572
+ var MassifSource = class extends MassifObject {
1573
+ /** The native source, to hand back to the object API - by id, or by handle when it has none. */
1574
+ get native() {
1575
+ return this.id ? bridge.getNativeSource(this.id) : bridge.getNativeSourceByHandle(this.handle);
1576
+ }
1577
+ /**
1578
+ * One tile, BLOCKING - an HTTP source fetches it on the calling thread.
1579
+ * `loadTileAsync` is the one to use from the UI thread.
1580
+ */
1581
+ loadTile(tile) {
1582
+ const result = this.invoke("loadTile", [tile]);
1583
+ try {
1584
+ return result ? result.getData("data") : null;
1585
+ } finally {
1586
+ result?.destroy();
1587
+ }
1588
+ }
1589
+ /**
1590
+ * Declares a layer inside a `geojson` source and returns its index.
1591
+ *
1592
+ * The source re-tiles whatever it is given, so replacing the document later is one
1593
+ * `setGeoJSON` rather than rebuilding the layer above it.
1594
+ */
1595
+ createLayer(name) {
1596
+ return this.invoke("createLayer", [name]);
1597
+ }
1598
+ /**
1599
+ * Replaces a declared layer's document. The tiles are rebuilt on the tile thread, so this
1600
+ * costs the re-encode rather than a layer rebuild.
1601
+ *
1602
+ * A string is parsed here rather than passed through: the argument crosses as JSON already,
1603
+ * and sending text would arrive as a string-valued argument instead of a document.
1604
+ */
1605
+ setGeoJSON(layer, geojson) {
1606
+ this.invoke("setLayerGeoJSON", [layer, typeof geojson === "string" ? JSON.parse(geojson) : geojson]);
1607
+ return this;
1608
+ }
1609
+ /** Drops a declared layer and everything in it. */
1610
+ deleteLayer(layer) {
1611
+ this.invoke("deleteLayer", [layer]);
1612
+ return this;
1613
+ }
1614
+ /**
1615
+ * One feature at a time, for an app that edits what it is showing.
1616
+ *
1617
+ * `setGeoJSON` re-encodes and re-tiles the whole document; on a few hundred saved routes that is
1618
+ * the difference between instant and not. `update` matches on the feature's own `id`.
1619
+ */
1620
+ addFeature(layer, feature) {
1621
+ this.invoke("addFeature", [layer, feature]);
1622
+ return this;
1623
+ }
1624
+ updateFeature(layer, feature) {
1625
+ this.invoke("updateFeature", [layer, feature]);
1626
+ return this;
1627
+ }
1628
+ removeFeature(layer, id) {
1629
+ this.invoke("removeFeature", [layer, id]);
1630
+ return this;
1631
+ }
1632
+ /** The same on a worker. The bytes are copied out while the result is still alive. */
1633
+ loadTileAsync(tile) {
1634
+ return this.callAsync("loadTile", [tile], ((result) => result.getData("data")));
1635
+ }
1636
+ };
1637
+ var WRAPPERS = {
1638
+ layer: MassifLayer,
1639
+ source: MassifSource
1640
+ };
1641
+ function wrapperFor(kind) {
1642
+ return WRAPPERS[kind] ?? MassifObject;
1643
+ }
1644
+ function create(kind, id, spec, className) {
1645
+ requireApi();
1646
+ let handle;
1647
+ try {
1648
+ handle = bridge.create(kind, id, JSON.stringify(spec));
1649
+ } catch (e) {
1650
+ throw new MassifApiError(`create ${kind}:${id}: ${e?.message ?? e}`);
1651
+ }
1652
+ if (!handle) {
1653
+ throw new MassifApiError(`create ${kind}:${id} returned no handle`);
1654
+ }
1655
+ const resolved = className ?? classOfSpec(kind, spec.type) ?? "massif::Layer";
1656
+ return new (wrapperFor(kind))(handle, resolved, id);
1657
+ }
1658
+ function createLayer(id, spec) {
1659
+ return create("layer", id, spec);
1660
+ }
1661
+ function createSource(id, spec) {
1662
+ return create("source", id, spec);
1663
+ }
1664
+ function find(kind, id, className) {
1665
+ requireApi();
1666
+ const handle = bridge.findObject(kind, id);
1667
+ if (!handle) {
1668
+ return null;
1669
+ }
1670
+ return new (wrapperFor(kind))(handle, className, id);
1671
+ }
1672
+ function destroy(kind, id) {
1673
+ return bridge.available ? bridge.unregisterObject(kind, id) : false;
1674
+ }
1675
+ function wrap(handle, className, id) {
1676
+ return new MassifObject(handle, className, id);
1677
+ }
1678
+ function wrapLayer(handle, className, id) {
1679
+ return new MassifLayer(handle, className, id);
1680
+ }
1681
+ function adoptLayer(id, nativeLayer, className) {
1682
+ requireApi();
1683
+ const handle = bridge.adoptLayer("layer", id, nativeLayer);
1684
+ if (!handle) {
1685
+ throw new MassifApiError(`could not adopt layer "${id}" - the id is taken, or the class is not a wrapped one`);
1686
+ }
1687
+ return new MassifLayer(handle, resolveNativeClass(nativeLayer, className, "massif::Layer"), id);
1688
+ }
1689
+ function adoptSource(id, nativeSource, className) {
1690
+ requireApi();
1691
+ const handle = bridge.adoptSource("source", id, nativeSource);
1692
+ if (!handle) {
1693
+ throw new MassifApiError(`could not adopt source "${id}" - the id is taken, or the class is not a wrapped one`);
1694
+ }
1695
+ return new MassifSource(handle, resolveNativeClass(nativeSource, className, "massif::TileDataSource"), id);
1696
+ }
1697
+ function adoptAssets(id, nativeAssets, className) {
1698
+ requireApi();
1699
+ const handle = bridge.adoptAssets("assets", id, nativeAssets);
1700
+ if (!handle) {
1701
+ throw new MassifApiError(`could not adopt assets "${id}" - the id is taken, or the class is not a wrapped one`);
1702
+ }
1703
+ return new MassifObject(handle, resolveNativeClass(nativeAssets, className, "massif::AssetPackage"), id);
1704
+ }
1705
+ function resolveNativeClass(nativeObject, given, fallback) {
1706
+ if (given) {
1707
+ if (!isKnownClass(given)) {
1708
+ throw new MassifApiError(`${given} is not a class the typings know - regenerate them with \`npm run typings.api\``);
1709
+ }
1710
+ return given;
1711
+ }
1712
+ return classOfShortName(bridge.nativeShortClassName(nativeObject)) ?? fallback;
1713
+ }
1714
+ var MassifElements = class {
1715
+ constructor(map, id, sourceSpec) {
1716
+ this.map = map;
1717
+ this.id = id;
1718
+ this.sourceSpec = sourceSpec;
1719
+ this.mCounter = 0;
1720
+ }
1721
+ /**
1722
+ * Adds an element - a `marker`, a `balloon`. The spec's `style` either names one registered
1723
+ * earlier or carries it inline, which is what most apps write.
1724
+ *
1725
+ * @returns the element, for `remove`. Its properties read and write by path like any other.
1726
+ */
1727
+ add(spec) {
1728
+ const element = this.map.object("element", `${this.id}.el${++this.mCounter}`, spec);
1729
+ this.built().source.call("add", element.handle);
1730
+ return element;
1731
+ }
1732
+ /**
1733
+ * Registers a style under an id so many elements share ONE style object - which is what
1734
+ * matters once there are thousands of them.
1735
+ */
1736
+ style(styleId, spec) {
1737
+ return this.map.object("elementstyle", `${this.id}.${styleId}`, spec);
1738
+ }
1739
+ /** Removes one element. It stays registered until it is destroyed. */
1740
+ remove(element) {
1741
+ return this.mSource && element ? this.mSource.call("remove", element.handle) : false;
1742
+ }
1743
+ /** Removes every element this has added. */
1744
+ clear() {
1745
+ this.mSource?.call("clear");
1746
+ return this;
1747
+ }
1748
+ /**
1749
+ * Clicks on the elements themselves, with the element's position on the payload.
1750
+ *
1751
+ * Set `e.consumed` in the handler to claim the tap, which is what an app wants whenever
1752
+ * "tap a marker" and "tap the map" mean different things - otherwise one tap does both.
1753
+ */
1754
+ onClick(handler, options) {
1755
+ return this.built().layer.subscribe("vectorelement.clicked", handler, options);
1756
+ }
1757
+ /** The layer they are drawn on, for opacity, visibility and ordering. */
1758
+ layer() {
1759
+ return this.built().layer;
1760
+ }
1761
+ /** The source holding them, for anything else a local source reaches. */
1762
+ source() {
1763
+ return this.built().source;
1764
+ }
1765
+ /** Built on first use, so a map that never adds an element pays nothing. */
1766
+ built() {
1767
+ if (!this.mSource || !this.mLayer) {
1768
+ this.mSource = this.map.object("source", this.id, this.sourceSpec ?? { type: "local", projection: { type: "EPSG:4326" } });
1769
+ this.mLayer = this.map.addLayer(this.id, { type: "elements", source: this.id });
1770
+ }
1771
+ return { source: this.mSource, layer: this.mLayer };
1772
+ }
1773
+ };
1774
+ function log() {
1775
+ return find("static", "Log", "massif::Log");
1776
+ }
1777
+ var MapCamera = class {
1778
+ /**
1779
+ * @param view The ADOPTED map view - every call below is a facade call on its handle.
1780
+ * @param size The view's pixel size, for the fitBounds default. A size is a property of the
1781
+ * VIEW, not of the camera, and BaseMapView does not expose one - so the map, which
1782
+ * holds the NativeScript view, measures it.
1783
+ */
1784
+ constructor(view, size) {
1785
+ this.view = view;
1786
+ this.size = size;
1787
+ this.mDuration = 0;
1788
+ }
1789
+ /** Milliseconds every later move animates over. 0 is immediate, and is the default. */
1790
+ animate(ms) {
1791
+ this.mDuration = ms;
1792
+ return this;
1793
+ }
1794
+ /** Seconds, which is what the facade takes; the public API is milliseconds. */
1795
+ take(duration) {
1796
+ const ms = duration ?? this.mDuration;
1797
+ this.mDuration = 0;
1798
+ return ms / 1e3;
1799
+ }
1800
+ position(value) {
1801
+ if (value === void 0) {
1802
+ return this.view.getPos("focusPos");
1803
+ }
1804
+ return this.moveTo(value);
1805
+ }
1806
+ /** Where the camera IS, not what it looks at - kilometres apart at a low tilt. */
1807
+ eyePosition() {
1808
+ return this.view.getPos("cameraPos");
1809
+ }
1810
+ zoom(value, target) {
1811
+ if (value === void 0) {
1812
+ return this.view.get("zoom");
1813
+ }
1814
+ return this.moveTo(target ?? this.position(), { zoom: value });
1815
+ }
1816
+ rotation(degrees) {
1817
+ if (degrees === void 0) {
1818
+ return this.view.get("rotation");
1819
+ }
1820
+ return this.moveTo(this.position(), { rotation: degrees });
1821
+ }
1822
+ tilt(degrees) {
1823
+ if (degrees === void 0) {
1824
+ return this.view.get("tilt");
1825
+ }
1826
+ return this.moveTo(this.position(), { tilt: degrees });
1827
+ }
1828
+ /**
1829
+ * Position, zoom, rotation and tilt in ONE move.
1830
+ *
1831
+ * Four separate setters animate independently and visibly fight each other, which is the
1832
+ * whole reason this exists rather than a chain of the accessors above. With no duration it
1833
+ * is immediate, and works before the map has drawn - which is when a screen usually points
1834
+ * its camera.
1835
+ */
1836
+ moveTo(position, options = {}) {
1837
+ const pos = toPosition(position);
1838
+ const zoom = options.zoom ?? this.zoom();
1839
+ const rotation = options.rotation ?? this.rotation();
1840
+ const tilt = options.tilt ?? this.tilt();
1841
+ const seconds = this.take(options.duration);
1842
+ if (seconds > 0) {
1843
+ this.view.call("flyTo", pos, zoom, rotation, tilt, options.climbHeight ?? 0, seconds, "");
1844
+ } else {
1845
+ this.view.call("moveTo", pos, zoom, rotation, tilt);
1846
+ }
1847
+ return this;
1848
+ }
1849
+ /** Frames a `[min, max]` box. `screen` defaults to the whole view. */
1850
+ fitBounds(bounds, options = {}) {
1851
+ const { width, height } = this.size();
1852
+ const screen = options.screen ? [[options.screen.min.x, options.screen.min.y], [options.screen.max.x, options.screen.max.y]] : [[0, 0], [width, height]];
1853
+ this.view.call("fitBounds", [toPosition(bounds[0]), toPosition(bounds[1])], screen, !!options.integerZoom, !!options.resetRotation, !!options.resetTilt, this.take(options.duration));
1854
+ return this;
1855
+ }
1856
+ /** Whether a flight is running. */
1857
+ isMoving() {
1858
+ return this.view.get("flightActive");
1859
+ }
1860
+ /** 0 to 1 through the current flight, or -1 when none is running. */
1861
+ progress() {
1862
+ return this.view.get("flightProgress");
1863
+ }
1864
+ stop() {
1865
+ this.view.call("stopFlight");
1866
+ return this;
1867
+ }
1868
+ /** Screen point to map position. */
1869
+ screenToMap(x, y) {
1870
+ return this.view.call("screenToMap", x, y);
1871
+ }
1872
+ mapToScreen(position) {
1873
+ const point = this.view.call("mapToScreen", toPosition(position));
1874
+ return { x: point[0], y: point[1] };
1875
+ }
1876
+ /**
1877
+ * What the view currently covers, as `[min, max]`.
1878
+ *
1879
+ * The two screen corners unprojected, which is what the answer is: there is no "bounds"
1880
+ * property, because a tilted or rotated camera does not have one - this is the axis-aligned box
1881
+ * around what it shows.
1882
+ */
1883
+ bounds() {
1884
+ const { height, width } = this.size();
1885
+ const first = this.screenToMap(0, 0);
1886
+ const second = this.screenToMap(width, height);
1887
+ return [
1888
+ [Math.min(first[0], second[0]), Math.min(first[1], second[1])],
1889
+ [Math.max(first[0], second[0]), Math.max(first[1], second[1])]
1890
+ ];
1891
+ }
1892
+ };
1893
+ var MapLayers = class extends MassifObject {
1894
+ constructor(handle, id) {
1895
+ super(handle, "massif::Layers", id);
1896
+ }
1897
+ /** How many layers the map is drawing, including any the object API put there. */
1898
+ count() {
1899
+ return this.get("count");
1900
+ }
1901
+ /** Appends. 0 is the bottom, so this puts the layer on top of everything else. */
1902
+ add(layer) {
1903
+ this.call("add", handleOf(layer));
1904
+ return this;
1905
+ }
1906
+ /** Puts the layer at `index`, moving everything at or above it up. */
1907
+ insert(index, layer) {
1908
+ this.call("insert", index, handleOf(layer));
1909
+ return this;
1910
+ }
1911
+ /**
1912
+ * Replaces the layer at `index` - what a rebuilt decoder needs, keeping the position.
1913
+ *
1914
+ * Not `set`: that is the property writer every object has, and a two-argument overload of it
1915
+ * would make every `layers.set('count', …)` typo compile.
1916
+ */
1917
+ replace(index, layer) {
1918
+ this.call("set", index, handleOf(layer));
1919
+ return this;
1920
+ }
1921
+ /** The layer at `index`, as a bare `Layer` - the list does not record what each one is. */
1922
+ at(index) {
1923
+ const layer = this.call("get", index);
1924
+ return layer ? new MassifLayer(layer.handle, "massif::Layer") : null;
1925
+ }
1926
+ remove(layer) {
1927
+ return this.call("remove", handleOf(layer));
1928
+ }
1929
+ /** Empties the stack. */
1930
+ clear() {
1931
+ this.call("clear");
1932
+ return this;
1933
+ }
1934
+ };
1935
+ var MassifMap = class extends MassifObject {
1936
+ constructor(handle, id, view) {
1937
+ super(handle, "massif::Options", id);
1938
+ this.view = view;
1939
+ this.mLayerById = {};
1940
+ this.mOwned = [];
1941
+ }
1942
+ /**
1943
+ * The map's layer list, ordered.
1944
+ *
1945
+ * `addLayer` covers the common case; this is for an app whose stack has an order of its own -
1946
+ * base map, then overlays, then its own markers - and so places a layer at an index, swaps one
1947
+ * in place when its decoder is rebuilt, or counts what is there.
1948
+ */
1949
+ layers() {
1950
+ if (!this.mLayers) {
1951
+ const id = `${this.id}:layers`;
1952
+ let handle = bridge.findObject("layers", id);
1953
+ if (!handle) {
1954
+ handle = bridge.adoptLayers("layers", id, this.view.mapView.getLayers());
1955
+ if (!handle) {
1956
+ throw new MassifApiError(`could not register the layer list of "${this.id}" under "${id}"`);
1957
+ }
1958
+ this.mOwned.push(["layers", id]);
1959
+ }
1960
+ this.mLayers = new MapLayers(handle, id);
1961
+ }
1962
+ return this.mLayers;
1963
+ }
1964
+ /**
1965
+ * Builds a layer from a spec and puts it on the map.
1966
+ *
1967
+ * ```ts
1968
+ * map.addLayer('base', {
1969
+ * type: 'vector',
1970
+ * source: { type: 'http', maxZoom: 14, url: 'https://…/{z}/{x}/{y}.pbf' },
1971
+ * style: { type: 'mbvt', project: { type: 'project', assets: { type: 'dir', path: '…' }, name: 'osm' } }
1972
+ * });
1973
+ * ```
1974
+ */
1975
+ addLayer(id, spec) {
1976
+ return this.add(this.object("layer", id, spec));
1977
+ }
1978
+ /**
1979
+ * Builds a layer this map OWNS but does not place it.
1980
+ *
1981
+ * For an app whose stack has an order of its own: it works out the index from the layers it has
1982
+ * already added, then calls `add(layer, index)` or `layers().insert(...)`. `addLayer` is the
1983
+ * one-liner for everything else.
1984
+ */
1985
+ buildLayer(id, spec) {
1986
+ const layer = this.object("layer", id, spec);
1987
+ layer.map = this;
1988
+ return layer;
1989
+ }
1990
+ /** Puts a layer built or adopted elsewhere on the map, optionally at a given index. */
1991
+ add(layer, index) {
1992
+ const layers = this.layers();
1993
+ if (index === void 0) {
1994
+ layers.add(layer);
1995
+ } else {
1996
+ layers.insert(index, layer);
1997
+ }
1998
+ layer.map = this;
1999
+ if (layer.id) {
2000
+ this.mLayerById[layer.id] = layer;
2001
+ }
2002
+ return layer;
2003
+ }
2004
+ /** Takes a layer off the map. The layer stays registered until it is destroyed. */
2005
+ removeLayer(layer) {
2006
+ if (layer instanceof MassifLayer && layer.id) {
2007
+ delete this.mLayerById[layer.id];
2008
+ }
2009
+ return this.layers().remove(layer);
2010
+ }
2011
+ /** A layer this map added or adopted, by the id it was given. */
2012
+ layer(id) {
2013
+ return this.mLayerById[id] ?? null;
2014
+ }
2015
+ /** How many layers the map is drawing, including any the object API put there. */
2016
+ layerCount() {
2017
+ return this.layers().count();
2018
+ }
2019
+ /** Adopts a layer built with the object API, and puts it under this map. */
2020
+ adopt(id, nativeLayer, className) {
2021
+ const layer = adoptLayer(id, nativeLayer, className);
2022
+ layer.map = this;
2023
+ this.mLayerById[id] = layer;
2024
+ return layer;
2025
+ }
2026
+ object(kind, id, spec, className) {
2027
+ const built = create(kind, id, spec, className);
2028
+ this.mOwned.push([kind, id]);
2029
+ return built;
2030
+ }
2031
+ /** A source this map owns. */
2032
+ source(id, spec) {
2033
+ return this.object("source", id, spec);
2034
+ }
2035
+ /**
2036
+ * A style this map owns.
2037
+ *
2038
+ * Worth an id whenever the app talks to it afterwards - a style parameter, a theme switch -
2039
+ * because a layer's style property cannot be read back as a handle.
2040
+ */
2041
+ style(id, spec) {
2042
+ return this.object("style", id, spec);
2043
+ }
2044
+ // --- markers and popups ---------------------------------------------------------------------
2045
+ /**
2046
+ * The map's own markers and popups, on a layer built the first time this is called.
2047
+ *
2048
+ * `sourceSpec` is how a map that does NOT work in lon/lat places its markers correctly; only
2049
+ * the first call builds, later ones return what it built.
2050
+ */
2051
+ elements(sourceSpec) {
2052
+ if (!this.mElements) {
2053
+ this.mElements = new MassifElements(this, `${this.id}.elements`, sourceSpec);
2054
+ }
2055
+ return this.mElements;
2056
+ }
2057
+ /** Adds a marker. The spec carries its position AND its style, inline or by id. */
2058
+ addMarker(spec) {
2059
+ return this.elements().add(spec);
2060
+ }
2061
+ /** The same for a balloon popup - a title and a body anchored to a position. */
2062
+ addPopup(spec) {
2063
+ return this.elements().add(spec);
2064
+ }
2065
+ /**
2066
+ * Releases the map's registration and every id it built - layers, sources, styles, elements.
2067
+ *
2068
+ * Not the view: the object API's map keeps working, which is the point of a facade that can
2069
+ * be adopted a piece at a time.
2070
+ */
2071
+ destroy() {
2072
+ for (let i = this.mOwned.length - 1; i >= 0; i--) {
2073
+ destroy(this.mOwned[i][0], this.mOwned[i][1]);
2074
+ }
2075
+ this.mOwned.length = 0;
2076
+ this.mElements = void 0;
2077
+ this.mCamera = void 0;
2078
+ return super.destroy();
2079
+ }
2080
+ /**
2081
+ * The view's size in pixels.
2082
+ *
2083
+ * A property of the VIEW, not of the map, but every caller that needs it has the map: framing a
2084
+ * route, working out how many metres a screen width covers.
2085
+ */
2086
+ size() {
2087
+ return { width: this.view.getMeasuredWidth?.() ?? 0, height: this.view.getMeasuredHeight?.() ?? 0 };
2088
+ }
2089
+ /**
2090
+ * A screenshot of the map.
2091
+ *
2092
+ * The one thing on this class that is not a facade call: reading the framebuffer is platform
2093
+ * code, and there is no verb for it. `wait` holds the capture until the tiles have settled.
2094
+ */
2095
+ capture(wait = false) {
2096
+ if (!this.view.captureRendering) {
2097
+ throw new MassifApiError("this map view cannot capture its rendering");
2098
+ }
2099
+ return this.view.captureRendering(wait);
2100
+ }
2101
+ /**
2102
+ * Asks for a frame.
2103
+ *
2104
+ * Rarely needed: the SDK redraws when a property that changes the picture is written. It is
2105
+ * here for the cases where an app knows better - a change made off the UI thread, or a view
2106
+ * that was hidden while the map moved.
2107
+ */
2108
+ requestRedraw() {
2109
+ this.view.requestRedraw?.();
2110
+ return this;
2111
+ }
2112
+ /** The camera. See MapCamera - a move is a flight, not a property. */
2113
+ camera() {
2114
+ if (!this.mCamera) {
2115
+ const id = `${this.id}:view`;
2116
+ let handle = bridge.findObject("view", id);
2117
+ if (!handle) {
2118
+ handle = bridge.adoptView("view", id, this.view.mapView.getBaseMapView());
2119
+ if (!handle) {
2120
+ throw new MassifApiError(`could not register the map view of "${this.id}"`);
2121
+ }
2122
+ this.mOwned.push(["view", id]);
2123
+ }
2124
+ const view = new MassifObject(handle, "massif::BaseMapView", id);
2125
+ this.mCamera = new MapCamera(view, () => this.size());
2126
+ }
2127
+ return this.mCamera;
2128
+ }
2129
+ /**
2130
+ * The projection every later handler's position reads default to.
2131
+ *
2132
+ * Shorthand for `eventOptions({ projection })`, and the one an app actually wants: ask once,
2133
+ * then read `e.getPos('clickPos')` plainly.
2134
+ */
2135
+ eventProjection(name) {
2136
+ return this.eventOptions({ projection: name });
2137
+ }
2138
+ // --- the map events, by name ---------------------------------------------------------------
2139
+ onClick(handler, options) {
2140
+ return this.subscribe("map.clicked", handler, options);
2141
+ }
2142
+ onMove(handler, options) {
2143
+ return this.subscribe("map.moved", handler, options);
2144
+ }
2145
+ onIdle(handler, options) {
2146
+ return this.subscribe("map.idle", handler, options);
2147
+ }
2148
+ onStable(handler, options) {
2149
+ return this.subscribe("map.stable", handler, options);
2150
+ }
2151
+ onInteraction(handler, options) {
2152
+ return this.subscribe("map.interaction", handler, options);
2153
+ }
2154
+ // --- the option groups, which is what most of an app touches -------------------------------
2155
+ /*
2156
+ * One accessor per options CLASS, not per option - that list is closed and does not grow with
2157
+ * the SDK, while the properties inside them are data.
2158
+ *
2159
+ * With no argument they scope onto what is already there. With a spec they BUILD it first,
2160
+ * which is what a map needs on the way in: Options starts with these properties empty, and
2161
+ * writing through an empty one is an error rather than a silent no-op.
2162
+ */
2163
+ /** `fogOptions.*` - fog on the mapbox model, independent of the terrain. */
2164
+ fog(spec) {
2165
+ return this.optionGroup("fogOptions", "fog", spec);
2166
+ }
2167
+ /** `skyOptions.*` - the sky dome behind the map. */
2168
+ sky(spec) {
2169
+ return this.optionGroup("skyOptions", "sky", spec);
2170
+ }
2171
+ /** `lightOptions.*` - sun direction and colour, which the terrain shades from. */
2172
+ light(spec) {
2173
+ return this.optionGroup("lightOptions", "light", spec);
2174
+ }
2175
+ /**
2176
+ * `terrainOptions.*` - 3D terrain from an elevation source.
2177
+ *
2178
+ * The elevation decoder comes from the source's own `encoding`, so nothing here names one.
2179
+ */
2180
+ terrain(spec) {
2181
+ return this.optionGroup("terrainOptions", "terrain", spec);
2182
+ }
2183
+ optionGroup(property, type, spec) {
2184
+ if (spec) {
2185
+ const built = this.object("options", `${this.id}.${type}`, spec);
2186
+ this.set(property, built.handle);
2187
+ }
2188
+ return this.group(property);
2189
+ }
2190
+ };
2191
+ function attach(view, options = {}) {
2192
+ requireApi();
2193
+ const existing = view.facadeMap?.();
2194
+ if (existing) {
2195
+ const { projection: existingProjection, throttle: existingThrottle, debounce: existingDebounce } = options;
2196
+ if (existingProjection || existingThrottle || existingDebounce) {
2197
+ existing.eventOptions({ projection: existingProjection, throttle: existingThrottle, debounce: existingDebounce });
2198
+ view.enableFacadeEvents?.();
2199
+ }
2200
+ return existing;
2201
+ }
2202
+ const nativeOptions = view.getOptions()?.getNative();
2203
+ if (!nativeOptions) {
2204
+ throw new MassifApiError("the map is not ready yet - attach from the mapReady event");
2205
+ }
2206
+ const id = options.id ?? "map";
2207
+ const handle = bridge.adoptOptions("options", id, nativeOptions);
2208
+ if (!handle) {
2209
+ throw new MassifApiError(`could not register the map under "${id}" - the id is taken`);
2210
+ }
2211
+ bridge.attachMapEvents(view.mapView, handle);
2212
+ const map = new MassifMap(handle, id, view);
2213
+ const { projection, throttle, debounce } = options;
2214
+ if (projection || throttle || debounce) {
2215
+ map.eventOptions({ projection, throttle, debounce });
2216
+ }
2217
+ return map;
2218
+ }
2219
+
2220
+ // ../../dist/web/bridge.mjs
2221
+ var OK = 0;
2222
+ var DELIVERY_UI = "ui";
2223
+ function createBridge(module) {
2224
+ const fn = (name, returns, args) => module.cwrap(name, returns, args);
2225
+ const c = {
2226
+ ctx: fn("mm_context_default", "number", [])(),
2227
+ create: fn("mm_create", "number", ["number", "string", "string", "string", "number"]),
2228
+ destroy: fn("mm_destroy", "number", ["number", "string", "string"]),
2229
+ destroyHandle: fn("mm_destroy_handle", "number", ["number", "number"]),
2230
+ find: fn("mm_find", "number", ["number", "string", "string", "number"]),
2231
+ valid: fn("mm_valid", "number", ["number", "number"]),
2232
+ setBool: fn("mm_set_bool", "number", ["number", "number", "string", "number"]),
2233
+ setDouble: fn("mm_set_double", "number", ["number", "number", "string", "number"]),
2234
+ setString: fn("mm_set_string", "number", ["number", "number", "string", "string"]),
2235
+ setJson: fn("mm_set_json", "number", ["number", "number", "string", "string"]),
2236
+ setObject: fn("mm_set_object", "number", ["number", "number", "string", "number"]),
2237
+ getObject: fn("mm_get_object", "number", ["number", "number", "string"]),
2238
+ getBool: fn("mm_get_bool", "number", ["number", "number", "string", "number"]),
2239
+ getDouble: fn("mm_get_double", "number", ["number", "number", "string", "number"]),
2240
+ getString: fn("mm_get_string", "number", ["number", "number", "string", "string", "number", "number", "number"]),
2241
+ call: fn("mm_call", "number", ["number", "number", "string", "string", "number"]),
2242
+ callAsync: fn("mm_call_async", "number", ["number", "number", "string", "string", "string", "number"]),
2243
+ cancelCall: fn("mm_cancel_call", "number", ["number", "number"]),
2244
+ cancelCalls: fn("mm_cancel_calls", "number", ["number", "number", "number"]),
2245
+ doublesCount: fn("mm_doubles_count", "number", ["number", "number", "number"]),
2246
+ doublesCopy: fn("mm_doubles_copy", "number", ["number", "number", "number", "number", "number"]),
2247
+ dataSize: fn("mm_data_size", "number", ["number", "number", "string", "number"]),
2248
+ dataCopy: fn("mm_data_copy", "number", ["number", "number", "string", "number", "number", "number"]),
2249
+ on: fn("mm_on", "number", ["number", "number", "string", "number", "number", "string", "number"]),
2250
+ off: fn("mm_off", "number", ["number", "number"]),
2251
+ offAll: fn("mm_off_all", "number", ["number", "number", "number"]),
2252
+ resultName: fn("mm_result_name", "string", ["number"]),
2253
+ adopt: fn("massifAdopt", "number", ["string", "string", "string"]),
2254
+ attachMapEvents: fn("massifAttachMapEvents", null, ["number"]),
2255
+ bridgeLayerClicks: fn("massifBridgeLayerClicks", "number", ["number"])
2256
+ };
2257
+ const ctx = c.ctx;
2258
+ const handlers = /* @__PURE__ */ new Map();
2259
+ const scratch = (size, body) => {
2260
+ const pointer = module._malloc(size);
2261
+ module.HEAPU8.fill(0, pointer, pointer + size);
2262
+ try {
2263
+ return body(pointer);
2264
+ } finally {
2265
+ module._free(pointer);
2266
+ }
2267
+ };
2268
+ const unsigned = (out) => module.getValue(out, "i32") >>> 0;
2269
+ const outInt = (body) => scratch(4, (out) => body(out) === OK ? unsigned(out) : 0);
2270
+ const fail = (what, code) => {
2271
+ throw new Error(`${what} failed: ${c.resultName(code)} (${code})`);
2272
+ };
2273
+ const readString = (handle, path, projection) => scratch(4, (needed) => {
2274
+ if (c.getString(ctx, handle, path, projection ?? "", 0, 0, needed) !== OK) {
2275
+ return null;
2276
+ }
2277
+ const size = module.getValue(needed, "i32");
2278
+ return scratch(size + 1, (buffer) => c.getString(ctx, handle, path, projection ?? "", buffer, size + 1, needed) === OK ? module.UTF8ToString(buffer) : null);
2279
+ });
2280
+ const readNumber = (getter, handle, path, fallback, type) => scratch(8, (out) => getter(ctx, handle, path, out) === OK ? module.getValue(out, type) : fallback);
2281
+ const part = (what) => ({ webPart: what });
2282
+ return {
2283
+ available: true,
2284
+ canConsume: false,
2285
+ create(kind, id, json) {
2286
+ let code = OK;
2287
+ const handle = scratch(4, (out) => {
2288
+ code = c.create(ctx, kind, id, json, out);
2289
+ return unsigned(out);
2290
+ });
2291
+ return code === OK ? handle : fail(`create ${kind} "${id}"`, code);
2292
+ },
2293
+ destroy: (handle) => c.destroyHandle(ctx, handle) === OK,
2294
+ isValid: (handle) => c.valid(ctx, handle) === OK,
2295
+ findObject: (kind, id) => outInt((out) => c.find(ctx, kind, id, out)),
2296
+ unregisterObject: (kind, id) => c.destroy(ctx, kind, id) === OK,
2297
+ // One numeric type in JavaScript; the ABI coerces a double into an int property.
2298
+ setFloat: (handle, path, value) => c.setDouble(ctx, handle, path, value),
2299
+ setInt: (handle, path, value) => c.setDouble(ctx, handle, path, value),
2300
+ setBool: (handle, path, value) => c.setBool(ctx, handle, path, value ? 1 : 0),
2301
+ setString: (handle, path, value) => c.setString(ctx, handle, path, value),
2302
+ setObject: (handle, path, value) => c.setObject(ctx, handle, path, value),
2303
+ setAll: (handle, json, projection) => c.setJson(ctx, handle, json, projection ?? ""),
2304
+ getObject: (handle, path) => c.getObject(ctx, handle, path) >>> 0,
2305
+ getFloat: (handle, path, fallback) => readNumber(c.getDouble, handle, path, fallback, "double"),
2306
+ getInt: (handle, path, fallback) => Math.trunc(readNumber(c.getDouble, handle, path, fallback, "double")),
2307
+ getBool: (handle, path, fallback) => !!readNumber(c.getBool, handle, path, fallback ? 1 : 0, "i32"),
2308
+ getString: (handle, path) => readString(handle, path, ""),
2309
+ getPos: (handle, path, projection) => readString(handle, path, projection) || null,
2310
+ call(handle, method, argsJson2) {
2311
+ let code = OK;
2312
+ const result = scratch(4, (out) => {
2313
+ code = c.call(ctx, handle, method, argsJson2, out);
2314
+ return unsigned(out);
2315
+ });
2316
+ return code === OK ? result : fail(`call ${method}`, code);
2317
+ },
2318
+ callAsync(handle, method, argsJson2, event) {
2319
+ let code = OK;
2320
+ const call = scratch(4, (out) => {
2321
+ code = c.callAsync(ctx, handle, method, argsJson2, event, out);
2322
+ return unsigned(out);
2323
+ });
2324
+ return code === OK ? call : fail(`callAsync ${method}`, code);
2325
+ },
2326
+ cancelCall: (call) => c.cancelCall(ctx, call) === OK,
2327
+ cancelCalls: (handle) => outInt((out) => c.cancelCalls(ctx, handle, out)),
2328
+ getDoubles(handle) {
2329
+ const count = outInt((out) => c.doublesCount(ctx, handle, out));
2330
+ if (!count) {
2331
+ return [];
2332
+ }
2333
+ return scratch(count * 8, (buffer) => scratch(4, (copied) => {
2334
+ c.doublesCopy(ctx, handle, buffer, count, copied);
2335
+ return Array.from(new Float64Array(module.HEAPF64.buffer, buffer, count));
2336
+ }));
2337
+ },
2338
+ getData(handle, path) {
2339
+ const size = outInt((out) => c.dataSize(ctx, handle, path, out));
2340
+ if (!size) {
2341
+ return null;
2342
+ }
2343
+ return scratch(size, (buffer) => scratch(4, (copied) => c.dataCopy(ctx, handle, path, buffer, size, copied) === OK ? module.HEAPU8.slice(buffer, buffer + size).buffer : null));
2344
+ },
2345
+ on(handle, event, handler, delivery, coalesce, projection) {
2346
+ const pointer = module.addFunction((userData, target, eventName, payload) => handler(target >>> 0, module.UTF8ToString(eventName), payload >>> 0) ? 1 : 0, "iiiii");
2347
+ const options = JSON.stringify({ delivery: DELIVERY_UI, coalesce: !!coalesce, ...projection ? { projection } : {} });
2348
+ const subscription = outInt((out) => c.on(ctx, handle, event, pointer, 0, options, out));
2349
+ if (subscription) {
2350
+ handlers.set(subscription, pointer);
2351
+ } else {
2352
+ module.removeFunction(pointer);
2353
+ }
2354
+ return subscription;
2355
+ },
2356
+ off(subscription) {
2357
+ const removed = c.off(ctx, subscription) === OK;
2358
+ const pointer = handlers.get(subscription);
2359
+ if (pointer !== void 0) {
2360
+ module.removeFunction(pointer);
2361
+ handlers.delete(subscription);
2362
+ }
2363
+ return removed;
2364
+ },
2365
+ // Table slots of these subscriptions stay until the page goes: the ABI does not say which they were.
2366
+ offAll: (handle) => outInt((out) => c.offAll(ctx, handle, out)),
2367
+ adoptOptions: (kind, id, native) => native?.webPart === "options" ? c.adopt(kind, "options", id) : 0,
2368
+ adoptLayers: (kind, id, native) => native?.webPart === "layers" ? c.adopt(kind, "layers", id) : 0,
2369
+ adoptView: (kind, id, native) => native?.webPart === "view" ? c.adopt(kind, "view", id) : 0,
2370
+ // Layers, sources and assets are only ever built from specs on the web: there is no object API.
2371
+ adoptLayer: () => 0,
2372
+ adoptSource: () => 0,
2373
+ adoptAssets: () => 0,
2374
+ getNativeLayer(id) {
2375
+ const handle = outInt((out) => c.find(ctx, "layer", id, out));
2376
+ return handle ? { webLayer: handle } : null;
2377
+ },
2378
+ getNativeSource: () => null,
2379
+ getNativeLayerByHandle: (handle) => ({ webLayer: handle }),
2380
+ getNativeSourceByHandle: () => null,
2381
+ attachMapEvents: (mapView, handle) => c.attachMapEvents(handle),
2382
+ attachVectorTileEvents: (layer, handle) => void c.bridgeLayerClicks(handle),
2383
+ attachVectorElementEvents: (layer, handle) => void c.bridgeLayerClicks(handle),
2384
+ attachCelestialEvents: (layer, handle) => void c.bridgeLayerClicks(handle),
2385
+ nativeShortClassName: () => null,
2386
+ /** The tokens a MapViewLike hands to the adopt calls above. */
2387
+ parts: { view: part("view"), options: part("options"), layers: part("layers") }
2388
+ };
2389
+ }
2390
+
2391
+ // ../../dist/web/massif.mjs
2392
+ function canvasSelector(canvas, id = "map") {
2393
+ if (!canvas.id) {
2394
+ canvas.id = `massif-${id}`;
2395
+ }
2396
+ return `#${canvas.id}`;
2397
+ }
2398
+ var MODULE_FILE = "massif-web.mjs";
2399
+ async function loadModule({ moduleUrl = new URL(MODULE_FILE, import.meta.url).href, ...options } = {}) {
2400
+ const { default: factory } = await import(
2401
+ /* webpackIgnore: true */
2402
+ moduleUrl
2403
+ );
2404
+ const base = new URL(".", new URL(moduleUrl, location.href)).href;
2405
+ return factory({ locateFile: (path) => base + path, ...options });
2406
+ }
2407
+
2408
+ // ../../dist/web/index.mjs
2409
+ var created = false;
2410
+ async function createMap(canvas, { id = "map", projection = "EPSG:4326", ...moduleOptions } = {}) {
2411
+ if (created) {
2412
+ throw new Error("createMap: this page already has a map");
2413
+ }
2414
+ created = true;
2415
+ const module = await loadModule(moduleOptions);
2416
+ const bridge2 = createBridge(module);
2417
+ setBridge(bridge2);
2418
+ if (!module.ccall("massifCreateMap", "number", ["string"], [canvasSelector(canvas, id)])) {
2419
+ throw new Error("createMap: this browser has no WebGL 2");
2420
+ }
2421
+ const view = {
2422
+ mapView: { getLayers: () => bridge2.parts.layers, getBaseMapView: () => bridge2.parts.view },
2423
+ getOptions: () => ({ getNative: () => bridge2.parts.options }),
2424
+ getMeasuredWidth: () => canvas.width,
2425
+ getMeasuredHeight: () => canvas.height
2426
+ };
2427
+ const map = attach(view, { id, projection });
2428
+ map.module = module;
2429
+ return map;
2430
+ }
2431
+ export {
2432
+ MapCamera,
2433
+ MapLayers,
2434
+ MassifApiError,
2435
+ MassifElements,
2436
+ MassifLayer,
2437
+ MassifMap,
2438
+ MassifObject,
2439
+ MassifSource,
2440
+ PropertyGroup,
2441
+ Result,
2442
+ Subscription,
2443
+ adoptAssets,
2444
+ adoptLayer,
2445
+ adoptSource,
2446
+ attach,
2447
+ canConsume,
2448
+ create,
2449
+ createLayer,
2450
+ createMap,
2451
+ createSource,
2452
+ destroy,
2453
+ find,
2454
+ isAvailable,
2455
+ log,
2456
+ setBridge,
2457
+ wrap,
2458
+ wrapLayer
2459
+ };