@nativescript-community/ui-massifmaps 3.0.1 → 4.0.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.
- package/CHANGELOG.md +41 -0
- package/README.md +237 -0
- package/api/bridge.android.d.ts +2 -0
- package/api/bridge.android.js +156 -0
- package/api/bridge.android.js.map +1 -0
- package/api/bridge.d.ts +91 -0
- package/api/bridge.ios.d.ts +2 -0
- package/api/bridge.ios.js +168 -0
- package/api/bridge.ios.js.map +1 -0
- package/api/index.common.d.ts +495 -0
- package/api/index.common.js +1448 -0
- package/api/index.common.js.map +1 -0
- package/api/index.d.ts +2 -0
- package/api/index.js +3 -0
- package/api/index.js.map +1 -0
- package/api/massif-api.d.ts +12471 -0
- package/api/resolve.d.ts +52 -0
- package/api/resolve.js +214 -0
- package/api/resolve.js.map +1 -0
- package/api/schema.d.ts +67 -0
- package/api/schema.js +539 -0
- package/api/schema.js.map +1 -0
- package/bindings/components/Options.d.ts +14 -13
- package/bindings/components/Options.js.map +1 -1
- package/bindings/core/Variant.d.ts +2 -1
- package/bindings/core/Variant.js.map +1 -1
- package/bindings/enums.d.ts +138 -0
- package/bindings/enums.js +153 -0
- package/bindings/enums.js.map +1 -0
- package/bindings/graphics/Bitmap.d.ts +2 -1
- package/bindings/graphics/Bitmap.js.map +1 -1
- package/bindings/layers/ClusterElementBuilder.d.ts +2 -1
- package/bindings/layers/ClusterElementBuilder.js.map +1 -1
- package/bindings/layers/CompositeVectorTileLayer.d.ts +3 -7
- package/bindings/layers/CompositeVectorTileLayer.js +3 -6
- package/bindings/layers/CompositeVectorTileLayer.js.map +1 -1
- package/bindings/layers/HillshadeRasterTileLayer.d.ts +3 -2
- package/bindings/layers/HillshadeRasterTileLayer.js.map +1 -1
- package/bindings/layers/Layer.d.ts +2 -1
- package/bindings/layers/Layer.js.map +1 -1
- package/bindings/layers/RasterTileLayer.d.ts +3 -2
- package/bindings/layers/RasterTileLayer.js.map +1 -1
- package/bindings/layers/TileLayer.d.ts +5 -3
- package/bindings/layers/TileLayer.js +1 -1
- package/bindings/layers/TileLayer.js.map +1 -1
- package/bindings/layers/VectorEditEventListener.d.ts +2 -1
- package/bindings/layers/VectorEditEventListener.js.map +1 -1
- package/bindings/layers/VectorTileLayer.d.ts +5 -4
- package/bindings/layers/VectorTileLayer.js.map +1 -1
- package/bindings/packagemanager/PackageInfo.d.ts +2 -1
- package/bindings/packagemanager/PackageInfo.js.map +1 -1
- package/bindings/packagemanager/PackageManagerListener.d.ts +2 -1
- package/bindings/packagemanager/PackageManagerListener.js.map +1 -1
- package/bindings/packagemanager/PackageStatus.d.ts +2 -1
- package/bindings/packagemanager/PackageStatus.js.map +1 -1
- package/bindings/packagemanager/PackageTileMask.d.ts +2 -1
- package/bindings/packagemanager/PackageTileMask.js.map +1 -1
- package/bindings/routing/RouteMatchingPoint.d.ts +2 -1
- package/bindings/routing/RouteMatchingPoint.js.map +1 -1
- package/bindings/routing/RoutingInstruction.js.map +1 -1
- package/bindings/styles/AnimationStyle.d.ts +3 -2
- package/bindings/styles/AnimationStyle.js.map +1 -1
- package/bindings/styles/AnimationStyleBuilder.d.ts +7 -6
- package/bindings/styles/AnimationStyleBuilder.js.map +1 -1
- package/bindings/styles/LabelStyle.js.map +1 -1
- package/bindings/styles/LabelStyleBuilder.d.ts +5 -4
- package/bindings/styles/LabelStyleBuilder.js.map +1 -1
- package/bindings/styles/LineStyle.d.ts +2 -1
- package/bindings/styles/LineStyle.js.map +1 -1
- package/bindings/styles/LineStyleBuilder.d.ts +6 -5
- package/bindings/styles/LineStyleBuilder.js.map +1 -1
- package/bindings/styles/MarkerStyle.js.map +1 -1
- package/bindings/styles/MarkerStyleBuilder.d.ts +5 -4
- package/bindings/styles/MarkerStyleBuilder.js.map +1 -1
- package/bindings/styles/NMLModelStyle.js.map +1 -1
- package/bindings/styles/NMLModelStyleBuilder.d.ts +5 -4
- package/bindings/styles/NMLModelStyleBuilder.js.map +1 -1
- package/bindings/ui/BalloonPopupButtonClickInfo.js.map +1 -1
- package/bindings/ui/ClickInfo.js.map +1 -1
- package/bindings/ui/MapClickInfo.js.map +1 -1
- package/bindings/ui/PopupClickInfo.js.map +1 -1
- package/bindings/ui/RasterTileClickInfo.js.map +1 -1
- package/bindings/ui/UTFGridClickInfo.js.map +1 -1
- package/bindings/ui/VectorElementClickInfo.js.map +1 -1
- package/bindings/ui/VectorElementDragInfo.d.ts +2 -1
- package/bindings/ui/VectorElementDragInfo.js.map +1 -1
- package/bindings/ui/VectorTileClickInfo.d.ts +3 -1
- package/bindings/ui/VectorTileClickInfo.js +5 -2
- package/bindings/ui/VectorTileClickInfo.js.map +1 -1
- package/bindings/utils/BundleAssetPackage.d.ts +15 -0
- package/bindings/utils/BundleAssetPackage.js +8 -0
- package/bindings/utils/BundleAssetPackage.js.map +1 -0
- package/bindings/utils/index.d.ts +1 -0
- package/bindings/utils/index.js +1 -0
- package/bindings/utils/index.js.map +1 -1
- package/bindings/vectortiles/MBVectorTileDecoder.d.ts +4 -3
- package/bindings/vectortiles/MBVectorTileDecoder.js.map +1 -1
- package/celestial/CelestialArc.android.d.ts +0 -1
- package/celestial/CelestialArc.android.js +0 -3
- package/celestial/CelestialArc.android.js.map +1 -1
- package/celestial/CelestialArc.d.ts +1 -3
- package/celestial/CelestialArc.ios.d.ts +0 -1
- package/celestial/CelestialArc.ios.js +0 -1
- package/celestial/CelestialArc.ios.js.map +1 -1
- package/celestial/CelestialObject.android.d.ts +0 -1
- package/celestial/CelestialObject.android.js +0 -1
- package/celestial/CelestialObject.android.js.map +1 -1
- package/celestial/CelestialObject.d.ts +0 -2
- package/celestial/CelestialObject.ios.d.ts +0 -1
- package/celestial/CelestialObject.ios.js +0 -1
- package/celestial/CelestialObject.ios.js.map +1 -1
- package/celestial/CelestialObjectVector.android.d.ts +0 -1
- package/celestial/CelestialObjectVector.android.js +0 -4
- package/celestial/CelestialObjectVector.android.js.map +1 -1
- package/celestial/CelestialObjectVector.d.ts +0 -2
- package/celestial/CelestialObjectVector.ios.d.ts +0 -1
- package/celestial/CelestialObjectVector.ios.js +0 -1
- package/celestial/CelestialObjectVector.ios.js.map +1 -1
- package/celestial/CelestialSprite.android.d.ts +0 -1
- package/celestial/CelestialSprite.android.js +0 -3
- package/celestial/CelestialSprite.android.js.map +1 -1
- package/celestial/CelestialSprite.d.ts +1 -3
- package/celestial/CelestialSprite.ios.d.ts +0 -1
- package/celestial/CelestialSprite.ios.js +0 -1
- package/celestial/CelestialSprite.ios.js.map +1 -1
- package/components/index.android.d.ts +9 -27
- package/components/index.android.js +3 -21
- package/components/index.android.js.map +1 -1
- package/components/index.d.ts +4 -26
- package/components/index.ios.d.ts +3 -21
- package/components/index.ios.js +3 -21
- package/components/index.ios.js.map +1 -1
- package/core/index.android.js +3 -3
- package/core/index.android.js.map +1 -1
- package/core/index.ios.js +3 -4
- package/core/index.ios.js.map +1 -1
- package/datasources/mbtiles.android.d.ts +2 -2
- package/index.android.d.ts +1 -6
- package/index.android.js +4 -8
- package/index.android.js.map +1 -1
- package/index.common.d.ts +3 -6
- package/index.common.js +3 -6
- package/index.common.js.map +1 -1
- package/index.d.ts +6 -0
- package/index.ios.d.ts +1 -6
- package/index.ios.js +1 -6
- package/index.ios.js.map +1 -1
- package/layers/CelestialLayer.android.d.ts +0 -1
- package/layers/CelestialLayer.android.js +0 -3
- package/layers/CelestialLayer.android.js.map +1 -1
- package/layers/CelestialLayer.d.ts +1 -4
- package/layers/CelestialLayer.ios.d.ts +0 -1
- package/layers/CelestialLayer.ios.js +1 -4
- package/layers/CelestialLayer.ios.js.map +1 -1
- package/layers/composite.android.d.ts +3 -5
- package/layers/composite.android.js +0 -6
- package/layers/composite.android.js.map +1 -1
- package/layers/composite.d.ts +6 -25
- package/layers/composite.ios.d.ts +2 -6
- package/layers/composite.ios.js +2 -10
- package/layers/composite.ios.js.map +1 -1
- package/layers/index.android.d.ts +3 -3
- package/layers/index.d.ts +4 -22
- package/layers/raster.android.d.ts +8 -8
- package/layers/raster.android.js +1 -1
- package/layers/raster.android.js.map +1 -1
- package/layers/raster.d.ts +2 -11
- package/layers/vector.android.d.ts +10 -10
- package/layers/vector.android.js +2 -2
- package/layers/vector.android.js.map +1 -1
- package/layers/vector.d.ts +15 -71
- package/nativeclass.common.d.ts +6 -31
- package/nativeclass.common.js +4 -21
- package/nativeclass.common.js.map +1 -1
- package/nativescript.config.ts +9 -6
- package/package.json +2 -2
- package/platforms/android/include-settings.gradle +18 -4
- package/platforms/android/include.gradle +10 -2
- package/platforms/android/java/com/nativescript/massifmaps/additions/CelestialEventListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/ClusterElementBuilder.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/HillshadeRasterTileLayer.java +4 -4
- package/platforms/android/java/com/nativescript/massifmaps/additions/RasterTileEventListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/RendererCaptureListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/SynchronousHandler.java +28 -0
- package/platforms/android/java/com/nativescript/massifmaps/additions/TileDownloadListener.java +4 -4
- package/platforms/android/java/com/nativescript/massifmaps/additions/VectorElementEventListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/VectorTileEventListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions2/FeatureCollectionSearchService.java +1 -2
- package/platforms/android/java/com/nativescript/massifmaps/additions2/VectorEditEventListener.java +21 -20
- package/platforms/android/java/com/nativescript/massifmaps/additions2/VectorTileSearchService.java +1 -2
- package/platforms/android/java/com/nativescript/massifmaps/api/EventListener.java +60 -0
- package/platforms/android/java/com/nativescript/massifmaps/geocoding/GeocodingServiceAdditions.java +5 -5
- package/platforms/android/java/com/nativescript/massifmaps/packagemanager/PackageManagerListener.java +11 -11
- package/platforms/android/java/com/nativescript/massifmaps/routing/RoutingServiceAdditions.java +19 -36
- package/platforms/android/native-api-usage.json +8 -0
- package/platforms/ios/build.xcconfig +4 -1
- package/platforms/ios/native-api-usage.json +1 -0
- package/platforms/ios/src/MassifMapsAdditions.h +1 -0
- package/platforms/ios/src/NSMSFApiEventListener.h +23 -0
- package/platforms/ios/src/NSMSFApiEventListener.mm +33 -0
- package/platforms/ios/src/NSMSFFeatureCollectionSearchService.swift +1 -1
- package/platforms/ios/src/NSMSFGeocodingServiceAdditions.swift +1 -1
- package/platforms/ios/src/NSMSFHillshadeRasterTileLayer.swift +1 -1
- package/platforms/ios/src/NSMSFMainThread.swift +21 -0
- package/platforms/ios/src/NSMSFRoutingServiceAdditions.swift +1 -1
- package/platforms/ios/src/NSMSFVectorTileSearchService.swift +1 -1
- package/projections/index.ios.js.map +1 -1
- package/renderers/index.d.ts +3 -10
- package/routing/index.android.d.ts +17 -17
- package/tsconfig.tsbuildinfo +1 -1
- package/typings/massifmaps.android.d.ts +1913 -410
- package/typings/massifmaps.ios.d.ts +21 -4
- package/typings/ns.massifmaps.android.d.ts +44 -175
- package/typings/ns.massifmaps.ios.d.ts +10 -63
- package/ui/index.android.d.ts +10 -14
- package/ui/index.android.js +6 -66
- package/ui/index.android.js.map +1 -1
- package/ui/index.common.d.ts +31 -0
- package/ui/index.common.js +130 -2
- package/ui/index.common.js.map +1 -1
- package/ui/index.d.ts +60 -21
- package/ui/index.ios.d.ts +4 -6
- package/ui/index.ios.js +5 -92
- package/ui/index.ios.js.map +1 -1
- package/utils/index.android.d.ts +9 -22
- package/utils/index.android.js +20 -129
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +9 -7
- package/utils/index.ios.d.ts +10 -18
- package/utils/index.ios.js +20 -109
- package/utils/index.ios.js.map +1 -1
- package/vectorelements/index.android.d.ts +6 -6
- package/vectorelements/line.android.d.ts +8 -11
- package/vectorelements/line.android.js +1 -4
- package/vectorelements/line.android.js.map +1 -1
- package/vectorelements/line.ios.d.ts +1 -4
- package/vectorelements/line.ios.js +1 -4
- package/vectorelements/line.ios.js.map +1 -1
- package/vectortiles/index.android.d.ts +0 -2
- package/vectortiles/index.android.js +0 -9
- package/vectortiles/index.android.js.map +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/AssetPackage.java +0 -59
- package/platforms/android/java/com/nativescript/massifmaps/additions/DirAssetPackage.java +0 -53
- package/platforms/android/java/com/nativescript/massifmaps/additions/MapEventListener.java +0 -17
- package/platforms/android/java/com/nativescript/massifmaps/additions/MapView.java +0 -167
- package/platforms/android/java/com/nativescript/massifmaps/additions/TextureMapView.java +0 -166
- package/platforms/ios/src/NSMSFMapEventListener.swift +0 -43
- package/platforms/ios/src/NSMSFMapView.swift +0 -106
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import { EventData, Observable } from '@nativescript/core';
|
|
2
|
+
import type { Bounds, ClassName, ClassOfSpec, EventName, Handle, Json, Kind, MethodArgs, MethodName, MethodResult, MethodResultClass, ClassAtPath, ObjectPath, PayloadClass, Position, PositionAt, PositionPath, Tile, ProjectionName, SpecArg, SpecType, ValueAt, WriteAt, ValuePath, WritablePath } from './massif-api';
|
|
3
|
+
export type * from './massif-api';
|
|
4
|
+
/**
|
|
5
|
+
* Typed layer over the SDK's string facade (create, destroy, set, get, call, on). Paths, spec keys,
|
|
6
|
+
* methods and events are generated from the table the C++ resolves against. Lives beside the object API.
|
|
7
|
+
*/
|
|
8
|
+
/** Mirrors `massif::api::Result`; anything unlisted arrives as its number. */
|
|
9
|
+
export declare const Result: {
|
|
10
|
+
readonly OK: 0;
|
|
11
|
+
readonly BAD_HANDLE: 1;
|
|
12
|
+
readonly UNKNOWN_CLASS: 2;
|
|
13
|
+
readonly UNKNOWN_PROPERTY: 3;
|
|
14
|
+
readonly READONLY: 4;
|
|
15
|
+
readonly UNSUPPORTED_TYPE: 5;
|
|
16
|
+
readonly NULL_OBJECT: 8;
|
|
17
|
+
};
|
|
18
|
+
export declare class MassifApiError extends Error {
|
|
19
|
+
readonly result?: number;
|
|
20
|
+
constructor(message: string, result?: number);
|
|
21
|
+
}
|
|
22
|
+
export declare function isAvailable(): boolean;
|
|
23
|
+
/** False on an SDK whose `MassifApi.on` lacks the consume flag: `consumed` is then accepted and ignored. */
|
|
24
|
+
export declare function canConsume(): boolean;
|
|
25
|
+
export interface SubscribeOptions {
|
|
26
|
+
/** Default projection for position reads, e.g. `'EPSG:3857'`; only during the call, a kept payload falls back to WGS84. */
|
|
27
|
+
projection?: ProjectionName;
|
|
28
|
+
/**
|
|
29
|
+
* Drop events within this many ms of the last one handled (`map.moved` fires 47-159/s in a drag).
|
|
30
|
+
* Never on a consumable event: a dropped click is one the SDK is still waiting on.
|
|
31
|
+
*/
|
|
32
|
+
throttle?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Deliver only the LAST event of a burst, this many ms after it stops. The payload is freed on emit,
|
|
35
|
+
* so the handler gets a frozen snapshot: `data.payload` is null, `data.get(path)` reads the snapshot.
|
|
36
|
+
* Never on a consumable event.
|
|
37
|
+
*/
|
|
38
|
+
debounce?: number;
|
|
39
|
+
}
|
|
40
|
+
type TopLevelPath<P> = P extends `${string}.${string}` ? never : P;
|
|
41
|
+
/** Payload properties readable off the event; names shadowing the event's own fields stay reachable via `get` only. */
|
|
42
|
+
export type PayloadFields<C extends ClassName, E extends EventName<C>> = Omit<{
|
|
43
|
+
readonly [K in TopLevelPath<ValuePath<PayloadClass<C, E>>>]: ValueAt<PayloadClass<C, E>, K>;
|
|
44
|
+
}, 'eventName' | 'object' | 'payload' | 'consumed' | 'consumable' | 'get' | 'getPos'>;
|
|
45
|
+
export type MassifEventData<C extends ClassName = any, E extends EventName<C> = EventName<C>> = EventData & PayloadFields<C, E> & {
|
|
46
|
+
eventName: string;
|
|
47
|
+
object: MassifObject<C>;
|
|
48
|
+
/** Valid ONLY while the handler runs (freed on the way out). Null for `map.idle`. */
|
|
49
|
+
payload: MassifObject<PayloadClass<C, E>> | null;
|
|
50
|
+
/**
|
|
51
|
+
* Set true to hide the event from later subscribers and the map. Only consumable events
|
|
52
|
+
* (`vectortile.clicked`, `vectorelement.clicked`, `celestial.clicked`, `sky.clicked`); elsewhere ignored, warned once.
|
|
53
|
+
*/
|
|
54
|
+
consumed: boolean;
|
|
55
|
+
readonly consumable: boolean;
|
|
56
|
+
/** Shorthand for `payload.get(path)`. Throws when the event carries no payload. */
|
|
57
|
+
get<P extends ValuePath<PayloadClass<C, E>>>(path: P): ValueAt<PayloadClass<C, E>, P>;
|
|
58
|
+
getPos<P extends PositionPath<PayloadClass<C, E>>>(path: P, projection?: ProjectionName): PositionAt<PayloadClass<C, E>, P> | null;
|
|
59
|
+
getPos(path: string & {}, projection?: ProjectionName): Position | Bounds | null;
|
|
60
|
+
};
|
|
61
|
+
/** `remove()` is idempotent: removing twice is an SDK error. */
|
|
62
|
+
export declare class Subscription {
|
|
63
|
+
readonly id: number;
|
|
64
|
+
private mRemoved;
|
|
65
|
+
/** Cancels a debounced delivery that has not fired yet, so `remove()` really means removed. */
|
|
66
|
+
private mCancelPending;
|
|
67
|
+
constructor(id: number);
|
|
68
|
+
get valid(): boolean;
|
|
69
|
+
remove(): boolean;
|
|
70
|
+
/** @internal */
|
|
71
|
+
onRemove(cancel: () => void): void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Cancelling cannot abort a call already running (SDK load paths take no cancellation token): it
|
|
75
|
+
* finishes and the result is dropped. Either way the promise rejects.
|
|
76
|
+
*/
|
|
77
|
+
export interface CancellablePromise<T> extends Promise<T> {
|
|
78
|
+
cancel(): boolean;
|
|
79
|
+
}
|
|
80
|
+
/** The view API's object position; its key names are app-configurable (setMapPosKeys), never hard-code them. */
|
|
81
|
+
export interface LatLon {
|
|
82
|
+
[key: string]: number | undefined;
|
|
83
|
+
}
|
|
84
|
+
export type AnyPosition = Position | LatLon;
|
|
85
|
+
/** Path-prefix scope, e.g. `map.group('fogOptions').set('rangeStart', 2.5)`, instead of 700+ named accessors. */
|
|
86
|
+
export declare class PropertyGroup<C extends ClassName = any> {
|
|
87
|
+
private readonly owner;
|
|
88
|
+
private readonly prefix;
|
|
89
|
+
readonly className: C;
|
|
90
|
+
constructor(owner: MassifObject<any>, prefix: string, className: C);
|
|
91
|
+
path(path: string): string;
|
|
92
|
+
get<P extends ValuePath<C>>(path: P): ValueAt<C, P>;
|
|
93
|
+
set<P extends WritablePath<C>>(path: P, value: WriteAt<C, P>): this;
|
|
94
|
+
apply(values: Partial<{
|
|
95
|
+
[P in WritablePath<C>]: WriteAt<C, P>;
|
|
96
|
+
}>): this;
|
|
97
|
+
getPos(path: string, projection?: ProjectionName): Bounds | Position;
|
|
98
|
+
group<P extends ObjectPath<C>>(path: P): PropertyGroup<ClassAtPath<C, P>>;
|
|
99
|
+
/** @see MassifObject.child */
|
|
100
|
+
child<P extends ObjectPath<C>>(path: P): MassifObject<ClassAtPath<C, P>> | null;
|
|
101
|
+
}
|
|
102
|
+
/** The table types an object result as `Handle`; here it arrives wrapped, for the caller to read and destroy. */
|
|
103
|
+
export type CallResult<C extends ClassName, M extends MethodName<C>> = [MethodResultClass<C, M>] extends [never] ? MethodResult<C, M> : MassifObject<MethodResultClass<C, M>>;
|
|
104
|
+
export type ResultClass<C extends ClassName, M extends MethodName<C>> = [MethodResultClass<C, M>] extends [never] ? any : MethodResultClass<C, M>;
|
|
105
|
+
/** A native subscription is taken on an event's first handler and dropped with its last. */
|
|
106
|
+
export declare class MassifObject<C extends ClassName = any> extends Observable {
|
|
107
|
+
readonly handle: Handle<C>;
|
|
108
|
+
readonly className: C;
|
|
109
|
+
/** The registry id, when the object has one. A call result does not. */
|
|
110
|
+
readonly id?: string;
|
|
111
|
+
private mSubscriptions;
|
|
112
|
+
private mDefaults;
|
|
113
|
+
private mDestroyed;
|
|
114
|
+
constructor(handle: Handle<C>, className: C,
|
|
115
|
+
/** The registry id, when the object has one. A call result does not. */
|
|
116
|
+
id?: string);
|
|
117
|
+
/** `instanceof` by class name, e.g. `layer.is('massif::RasterTileLayer')`. */
|
|
118
|
+
is(className: ClassName): boolean;
|
|
119
|
+
/** False after `destroy`, and after the id was dropped. */
|
|
120
|
+
get valid(): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* The path may walk objects (`fogOptions.rangeStart`), structs (`clickInfo.clickType`) and free-form
|
|
123
|
+
* data (`properties.name`). Enums come back as names, positions as `[lon, lat]`, structs as JSON.
|
|
124
|
+
*/
|
|
125
|
+
get<P extends ValuePath<C>>(path: P): ValueAt<C, P>;
|
|
126
|
+
private read;
|
|
127
|
+
/** An enum takes its constant name, a position an array. */
|
|
128
|
+
set<P extends WritablePath<C>>(path: P, value: WriteAt<C, P>): this;
|
|
129
|
+
/** The same without throwing, for a path that may legitimately not be there. */
|
|
130
|
+
trySet<P extends WritablePath<C>>(path: P, value: WriteAt<C, P>): number;
|
|
131
|
+
private write;
|
|
132
|
+
/**
|
|
133
|
+
* Plain `setObject` would collapse a spec to NULL_HANDLE, which CLEARS the property and returns OK.
|
|
134
|
+
* The built object gets an id derived from the target, so it lives with the property and a rewrite replaces it.
|
|
135
|
+
*/
|
|
136
|
+
private writeSpec;
|
|
137
|
+
private writeByType;
|
|
138
|
+
/**
|
|
139
|
+
* Several properties in ONE JNI/JSI crossing via `setAll`. Object values (handles, inline specs) cannot
|
|
140
|
+
* be JSON and go one by one, as does everything on an SDK without `setAll`.
|
|
141
|
+
*/
|
|
142
|
+
apply(values: Partial<{
|
|
143
|
+
[P in WritablePath<C>]: WriteAt<C, P>;
|
|
144
|
+
}>): this;
|
|
145
|
+
/**
|
|
146
|
+
* WGS84 `[lng, lat]` unless a projection is named here or on the subscription. An object whose source
|
|
147
|
+
* projection is unknown is left unconverted: a wrong guess is worse than an unconverted number.
|
|
148
|
+
*/
|
|
149
|
+
getPos<P extends PositionPath<C>>(path: P, projection?: ProjectionName): PositionAt<C, P> | null;
|
|
150
|
+
/** A path the tables do not carry - the concrete class is more derived than the declared one. */
|
|
151
|
+
getPos(path: string & {}, projection?: ProjectionName): Position | Bounds | null;
|
|
152
|
+
group<P extends ObjectPath<C>>(path: P): PropertyGroup<ClassAtPath<C, P>>;
|
|
153
|
+
/**
|
|
154
|
+
* The object behind an object property, OWNED by the caller (`destroy()` it); null when empty.
|
|
155
|
+
* Unlike `group` it hands the object over, e.g. to share a source between layers.
|
|
156
|
+
*/
|
|
157
|
+
child<P extends ObjectPath<C>>(path: P): MassifObject<ClassAtPath<C, P>> | null;
|
|
158
|
+
/**
|
|
159
|
+
* The path may traverse object properties (`layer.call('tileDecoder.setStyleParameter', ...)`).
|
|
160
|
+
* An object result is a `MassifObject` the CALLER OWNS - `destroy()` it, or it stays registered.
|
|
161
|
+
*/
|
|
162
|
+
call<M extends MethodName<C>>(method: M, ...args: MethodArgs<C, M>): CallResult<C, M>;
|
|
163
|
+
/** Untyped `call` for the named wrappers: they know the declaring class, `call`'s `C` does not. */
|
|
164
|
+
protected invoke(method: string, args: readonly unknown[]): unknown;
|
|
165
|
+
private readResult;
|
|
166
|
+
/**
|
|
167
|
+
* `call` on a worker. `extract` runs INSIDE the delivery, the only time an object result is alive,
|
|
168
|
+
* e.g. `(tile) => tile.getData('data')`. Scalars and flat arrays need no `extract`.
|
|
169
|
+
*/
|
|
170
|
+
callAsync<M extends MethodName<C>, R = CallResult<C, M>>(method: M, args: MethodArgs<C, M>, extract?: (result: MassifObject<ResultClass<C, M>>) => R): CancellablePromise<R>;
|
|
171
|
+
cancelCalls(): number;
|
|
172
|
+
/**
|
|
173
|
+
* Defaults cover a search result; a route's instructions are
|
|
174
|
+
* `collect(fn, { countPath: 'instructionCount', method: 'getInstruction' })`.
|
|
175
|
+
*/
|
|
176
|
+
collect<R>(map: (element: MassifObject<ResultClass<C, MethodName<C> & 'getFeature'>>, index: number) => R): R[];
|
|
177
|
+
collect<M extends MethodName<C>, R>(map: (element: MassifObject<ResultClass<C, M>>, index: number) => R, options: {
|
|
178
|
+
countPath: string;
|
|
179
|
+
method: M;
|
|
180
|
+
}): R[];
|
|
181
|
+
/** Escape hatch for paths the tables cannot type: free-form feature properties, a more derived class. */
|
|
182
|
+
json(path?: string): Json;
|
|
183
|
+
/** An empty path means the handle IS the blob. */
|
|
184
|
+
getData(path?: string): ArrayBuffer | null;
|
|
185
|
+
getDoubles(): number[];
|
|
186
|
+
/** Defaults for every later subscription on this object. */
|
|
187
|
+
eventOptions(options: SubscribeOptions): this;
|
|
188
|
+
get events(): string[];
|
|
189
|
+
/** For a handler needing its own projection or delivery; `on` covers most cases. */
|
|
190
|
+
subscribe<E extends EventName<C>>(event: E, handler: (data: MassifEventData<C, E>) => void, options?: SubscribeOptions): Subscription;
|
|
191
|
+
private consumes;
|
|
192
|
+
private subscribeRaw;
|
|
193
|
+
/** Hook for a subclass that has to install a native listener before the first subscription. */
|
|
194
|
+
protected beforeSubscribe(event: string): void;
|
|
195
|
+
private eventData;
|
|
196
|
+
/** Deliberately NOT widened to `string` so event-name typos fail; `addEventListener` takes any name. */
|
|
197
|
+
on<E extends EventName<C>>(event: E, callback: (data: MassifEventData<C, E>) => void, thisArg?: any): void;
|
|
198
|
+
once<E extends EventName<C>>(event: E, callback: (data: MassifEventData<C, E>) => void, thisArg?: any): void;
|
|
199
|
+
off<E extends EventName<C>>(event: E, callback?: any, thisArg?: any): void;
|
|
200
|
+
/** A facade event takes its native subscription here, on the first handler. */
|
|
201
|
+
addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any, ...rest: any[]): void;
|
|
202
|
+
removeEventListener(eventNames: string, callback?: any, thisArg?: any): void;
|
|
203
|
+
/** Subscriptions and pending async calls die with it, so no handler runs against a freed object. */
|
|
204
|
+
destroy(): boolean;
|
|
205
|
+
toString(): string;
|
|
206
|
+
}
|
|
207
|
+
/** Click events need a listener on the NATIVE layer, installed on first subscription (chaining any existing one). */
|
|
208
|
+
export declare class MassifLayer<C extends ClassName = any> extends MassifObject<C> {
|
|
209
|
+
private mBridged;
|
|
210
|
+
/** Set when built or adopted through a map; needed to reorder or detach it. */
|
|
211
|
+
map?: MassifMap;
|
|
212
|
+
protected beforeSubscribe(event: string): void;
|
|
213
|
+
get native(): any;
|
|
214
|
+
opacity(): number;
|
|
215
|
+
opacity(value: number): this;
|
|
216
|
+
visible(): boolean;
|
|
217
|
+
visible(value: boolean): this;
|
|
218
|
+
zoomRange(): [number, number];
|
|
219
|
+
zoomRange(range: [number, number]): this;
|
|
220
|
+
/** 0 is the bottom of the map's stack. */
|
|
221
|
+
moveTo(index: number): this;
|
|
222
|
+
/** The object stays registered until it is destroyed. */
|
|
223
|
+
detach(): this;
|
|
224
|
+
refresh(): this;
|
|
225
|
+
/** OWNED by the caller. Typed as a source so `.native` is there, to hand the tiles to native code. */
|
|
226
|
+
source(): MassifSource | null;
|
|
227
|
+
/** `all` includes the preloading caches, not just the visible set. */
|
|
228
|
+
clearTileCaches(all?: boolean): this;
|
|
229
|
+
/** Only a hillshade layer answers; anything else gives an empty array. */
|
|
230
|
+
elevations(positions: AnyPosition[]): number[];
|
|
231
|
+
onFeatureClick(handler: (data: MassifEventData<'massif::VectorTileLayer', 'vectortile.clicked'>) => void, options?: SubscribeOptions): Subscription;
|
|
232
|
+
onElementClick(handler: (data: MassifEventData<'massif::VectorLayer', 'vectorelement.clicked'>) => void, options?: SubscribeOptions): Subscription;
|
|
233
|
+
onCelestialClick(handler: (data: MassifEventData<'massif::CelestialLayer', 'celestial.clicked'>) => void, options?: SubscribeOptions): Subscription;
|
|
234
|
+
onSkyClick(handler: (data: MassifEventData<'massif::CelestialLayer', 'sky.clicked'>) => void, options?: SubscribeOptions): Subscription;
|
|
235
|
+
private requireMap;
|
|
236
|
+
}
|
|
237
|
+
export declare class MassifSource<C extends ClassName = any> extends MassifObject<C> {
|
|
238
|
+
get native(): any;
|
|
239
|
+
/** BLOCKING: an HTTP source fetches on the calling thread. Use `loadTileAsync` from the UI thread. */
|
|
240
|
+
loadTile(tile: Tile): ArrayBuffer | null;
|
|
241
|
+
/** For a `geojson` source; returns the layer index. */
|
|
242
|
+
createLayer(name: string): number;
|
|
243
|
+
/** A string is parsed here: args cross as JSON, so text would arrive as a string argument, not a document. */
|
|
244
|
+
setGeoJSON(layer: number, geojson: Json | string | object): this;
|
|
245
|
+
deleteLayer(layer: number): this;
|
|
246
|
+
/** Avoids re-tiling the whole document as `setGeoJSON` does. `update` matches on the feature's own `id`. */
|
|
247
|
+
addFeature(layer: number, feature: Json | string | object): this;
|
|
248
|
+
updateFeature(layer: number, feature: Json | string | object): this;
|
|
249
|
+
removeFeature(layer: number, id: string | number): this;
|
|
250
|
+
loadTileAsync(tile: Tile): CancellablePromise<ArrayBuffer | null>;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Spec keys are constructor params plus writable properties; nested `source`/`style`/`assets` are inline
|
|
254
|
+
* specs or registered ids. Re-creating an id with an IDENTICAL spec returns the same object; a different one is refused.
|
|
255
|
+
*/
|
|
256
|
+
export declare function create<K extends Kind, T extends SpecType<K>>(kind: K, id: string, spec: SpecArg<K, T>): MassifObject<ClassOfSpec<K, T>>;
|
|
257
|
+
/**
|
|
258
|
+
* For kinds with HAND-WRITTEN factories (`projection`, `data`, `geometry`, `search`/`routing`). `className`
|
|
259
|
+
* is REQUIRED, else this overload would accept a misspelt key in a kind the schema does describe.
|
|
260
|
+
*/
|
|
261
|
+
export declare function create<C extends ClassName>(kind: string, id: string, spec: {
|
|
262
|
+
type: string;
|
|
263
|
+
} & {
|
|
264
|
+
[key: string]: Json;
|
|
265
|
+
}, className: C): MassifObject<C>;
|
|
266
|
+
export declare function createLayer<T extends SpecType<'layer'>>(id: string, spec: SpecArg<'layer', T>): MassifLayer<ClassOfSpec<'layer', T>>;
|
|
267
|
+
export declare function createSource<T extends SpecType<'source'>>(id: string, spec: SpecArg<'source', T>): MassifSource<ClassOfSpec<'source', T>>;
|
|
268
|
+
/** The class cannot be read back off a handle; it is what the property paths resolve against. */
|
|
269
|
+
export declare function find<C extends ClassName>(kind: Kind | string, id: string, className: C): MassifObject<C> | null;
|
|
270
|
+
export declare function destroy(kind: Kind | string, id: string): boolean;
|
|
271
|
+
/** Nothing is checked; the class is what the paths resolve against. */
|
|
272
|
+
export declare function wrap<C extends ClassName>(handle: number, className: C, id?: string): MassifObject<C>;
|
|
273
|
+
/**
|
|
274
|
+
* For a layer unreachable by id, e.g. a CompositeVectorTileLayer's external child from `getExternalChildLayer`.
|
|
275
|
+
* Not in a map's stack, so `moveTo` / `detach` throw.
|
|
276
|
+
*/
|
|
277
|
+
export declare function wrapLayer<C extends ClassName>(handle: number, className: C, id?: string): MassifLayer<C>;
|
|
278
|
+
/**
|
|
279
|
+
* Gives an object built with the OBJECT api an id. The class is read off the native runtime class, so an
|
|
280
|
+
* adopted `VectorTileLayer` answers to its own properties, not only `Layer`'s.
|
|
281
|
+
*/
|
|
282
|
+
export declare function adoptLayer(id: string, nativeLayer: any, className?: ClassName): MassifLayer;
|
|
283
|
+
/** @copydoc adoptLayer */
|
|
284
|
+
export declare function adoptSource(id: string, nativeSource: any, className?: ClassName): MassifSource;
|
|
285
|
+
/**
|
|
286
|
+
* Also takes an app SUBCLASS, which a spec cannot express; specs then pass the id as `assets`. A Swig
|
|
287
|
+
* director has no class the registry knows, so it is adopted as `massif::AssetPackage`.
|
|
288
|
+
*/
|
|
289
|
+
export declare function adoptAssets(id: string, nativeAssets: any, className?: ClassName): MassifObject;
|
|
290
|
+
/** Markers and popups; elements and styles are specs. The layer and source are created on first use, released with the map. */
|
|
291
|
+
export declare class MassifElements {
|
|
292
|
+
private readonly map;
|
|
293
|
+
private readonly id;
|
|
294
|
+
/** Where the positions are read. lon/lat by default, matching the rest of this API. */
|
|
295
|
+
private readonly sourceSpec?;
|
|
296
|
+
private mSource?;
|
|
297
|
+
private mLayer?;
|
|
298
|
+
private mCounter;
|
|
299
|
+
constructor(map: MassifMap, id: string,
|
|
300
|
+
/** Where the positions are read. lon/lat by default, matching the rest of this API. */
|
|
301
|
+
sourceSpec?: SpecArg<'source', 'local'>);
|
|
302
|
+
/** The spec's `style` either names a registered style or carries it inline. */
|
|
303
|
+
add<T extends SpecType<'element'>>(spec: SpecArg<'element', T>): MassifObject<ClassOfSpec<'element', T>>;
|
|
304
|
+
/** Lets many elements share ONE style object, which matters once there are thousands. */
|
|
305
|
+
style<T extends SpecType<'elementstyle'>>(styleId: string, spec: SpecArg<'elementstyle', T>): MassifObject<ClassOfSpec<'elementstyle', T>> & {
|
|
306
|
+
readonly id: string;
|
|
307
|
+
};
|
|
308
|
+
/** The element stays registered until it is destroyed. */
|
|
309
|
+
remove(element: MassifObject | null): boolean;
|
|
310
|
+
clear(): this;
|
|
311
|
+
/** Set `e.consumed` to claim the tap, otherwise it also reaches the map. */
|
|
312
|
+
onClick(handler: (data: MassifEventData<'massif::VectorLayer', 'vectorelement.clicked'>) => void, options?: SubscribeOptions): Subscription;
|
|
313
|
+
layer(): MassifLayer<'massif::VectorLayer'>;
|
|
314
|
+
source(): MassifObject<'massif::LocalVectorDataSource'>;
|
|
315
|
+
private built;
|
|
316
|
+
}
|
|
317
|
+
/** Structural rather than the view class, so `api/` does not import `ui/`. The camera goes through the facade. */
|
|
318
|
+
export interface MapViewLike {
|
|
319
|
+
mapView: any;
|
|
320
|
+
getOptions(): {
|
|
321
|
+
getNative(): any;
|
|
322
|
+
} | null;
|
|
323
|
+
getMeasuredWidth?(): number;
|
|
324
|
+
getMeasuredHeight?(): number;
|
|
325
|
+
/** Platform code: there is no facade verb for a framebuffer read. */
|
|
326
|
+
captureRendering?(wait?: boolean): Promise<any>;
|
|
327
|
+
/** Platform code: the renderer is not in the property table. */
|
|
328
|
+
requestRedraw?(): void;
|
|
329
|
+
}
|
|
330
|
+
/** `Log` is static-only, so the context registers it as `static:Log`. */
|
|
331
|
+
export declare function log(): MassifObject<'massif::Log'>;
|
|
332
|
+
export declare function mapViewClass(): any;
|
|
333
|
+
/**
|
|
334
|
+
* Facade calls on the ADOPTED map view, so no position becomes a `MapPos` proxy (massif-maps/MassifMaps#159).
|
|
335
|
+
* Positions are WGS84 `[lng, lat]`.
|
|
336
|
+
*/
|
|
337
|
+
export declare class MapCamera {
|
|
338
|
+
private readonly view;
|
|
339
|
+
private readonly size;
|
|
340
|
+
/** Whether the linked SDK binary has BaseMapView::moveCameraTo; undefined until first tried. */
|
|
341
|
+
private static nativeCameraMove;
|
|
342
|
+
private mDuration;
|
|
343
|
+
/** @param size The view's pixel size: BaseMapView exposes none, so the map measures it. */
|
|
344
|
+
constructor(view: MassifObject<'massif::BaseMapView'>, size: () => {
|
|
345
|
+
width: number;
|
|
346
|
+
height: number;
|
|
347
|
+
});
|
|
348
|
+
/** Milliseconds the NEXT move animates over; reset once used. */
|
|
349
|
+
animate(ms: number): this;
|
|
350
|
+
/** Seconds, which is what the facade takes; the public API is milliseconds. */
|
|
351
|
+
private take;
|
|
352
|
+
position(): Position;
|
|
353
|
+
position(value: AnyPosition): this;
|
|
354
|
+
/** Where the camera IS, not what it looks at - kilometres apart at a low tilt. */
|
|
355
|
+
eyePosition(): Position;
|
|
356
|
+
eyePosition(value: AnyPosition): this;
|
|
357
|
+
/** Puts the EYE at a position, where `moveTo` puts the focus. */
|
|
358
|
+
moveEyeTo(position: AnyPosition, options?: {
|
|
359
|
+
zoom?: number;
|
|
360
|
+
rotation?: number;
|
|
361
|
+
tilt?: number;
|
|
362
|
+
climbHeight?: number;
|
|
363
|
+
duration?: number;
|
|
364
|
+
}): this;
|
|
365
|
+
/** Null, not a throw or NaN, for a view that has not had its first layout. */
|
|
366
|
+
private readPos;
|
|
367
|
+
zoom(): number;
|
|
368
|
+
zoom(value: number, target?: AnyPosition): this;
|
|
369
|
+
rotation(): number;
|
|
370
|
+
rotation(degrees: number): this;
|
|
371
|
+
tilt(): number;
|
|
372
|
+
tilt(degrees: number): this;
|
|
373
|
+
/**
|
|
374
|
+
* All in ONE move: separate setters animate independently and fight each other. With no duration it
|
|
375
|
+
* is immediate and works before the map has drawn.
|
|
376
|
+
*/
|
|
377
|
+
moveTo(position: AnyPosition, options?: {
|
|
378
|
+
zoom?: number;
|
|
379
|
+
rotation?: number;
|
|
380
|
+
tilt?: number;
|
|
381
|
+
climbHeight?: number;
|
|
382
|
+
duration?: number;
|
|
383
|
+
}): this;
|
|
384
|
+
/** `screen` defaults to the whole view. */
|
|
385
|
+
fitBounds(bounds: Bounds, options?: {
|
|
386
|
+
screen?: {
|
|
387
|
+
min: {
|
|
388
|
+
x: number;
|
|
389
|
+
y: number;
|
|
390
|
+
};
|
|
391
|
+
max: {
|
|
392
|
+
x: number;
|
|
393
|
+
y: number;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
integerZoom?: boolean;
|
|
397
|
+
resetRotation?: boolean;
|
|
398
|
+
resetTilt?: boolean;
|
|
399
|
+
duration?: number;
|
|
400
|
+
}): this;
|
|
401
|
+
isMoving(): boolean;
|
|
402
|
+
/** 0 to 1 through the current flight, or -1 when none is running. */
|
|
403
|
+
progress(): number;
|
|
404
|
+
stop(): this;
|
|
405
|
+
screenToMap(x: number, y: number): Position;
|
|
406
|
+
mapToScreen(position: AnyPosition): {
|
|
407
|
+
x: number;
|
|
408
|
+
y: number;
|
|
409
|
+
};
|
|
410
|
+
/** Axis-aligned box around the two unprojected screen corners: a tilted/rotated camera has no true bounds. */
|
|
411
|
+
bounds(): Bounds;
|
|
412
|
+
}
|
|
413
|
+
/** Drawn in list order, 0 at the bottom. Facade calls on the adopted `Layers` only. */
|
|
414
|
+
export declare class MapLayers extends MassifObject<'massif::Layers'> {
|
|
415
|
+
constructor(handle: Handle<'massif::Layers'>, id: string);
|
|
416
|
+
/** Includes layers the object API put there. */
|
|
417
|
+
count(): number;
|
|
418
|
+
/** Appends on top: 0 is the bottom. */
|
|
419
|
+
add(layer: MassifLayer | number): this;
|
|
420
|
+
insert(index: number, layer: MassifLayer | number): this;
|
|
421
|
+
/** Not `set`: a two-argument overload of the property writer would let `layers.set('count', …)` typos compile. */
|
|
422
|
+
replace(index: number, layer: MassifLayer | number): this;
|
|
423
|
+
/** A bare `Layer`: the list does not record the concrete class. */
|
|
424
|
+
at(index: number): MassifLayer<'massif::Layer'> | null;
|
|
425
|
+
remove(layer: MassifLayer | number): boolean;
|
|
426
|
+
clear(): this;
|
|
427
|
+
}
|
|
428
|
+
export interface AttachOptions extends SubscribeOptions {
|
|
429
|
+
/** The registry id the map's options take. Defaults to `map`. */
|
|
430
|
+
id?: string;
|
|
431
|
+
}
|
|
432
|
+
/** Addressed through its Options: fog, sky, light, terrain, camera limits... all hang off it. */
|
|
433
|
+
export declare class MassifMap extends MassifObject<'massif::Options'> {
|
|
434
|
+
readonly view: MapViewLike;
|
|
435
|
+
private mLayers?;
|
|
436
|
+
private mCamera?;
|
|
437
|
+
private mElements?;
|
|
438
|
+
private readonly mLayerById;
|
|
439
|
+
/** Ids this map built, released when it is destroyed. */
|
|
440
|
+
private readonly mOwned;
|
|
441
|
+
constructor(handle: Handle<'massif::Options'>, id: string, view: MapViewLike);
|
|
442
|
+
layers(): MapLayers;
|
|
443
|
+
addLayer<T extends SpecType<'layer'>>(id: string, spec: SpecArg<'layer', T>): MassifLayer<ClassOfSpec<'layer', T>>;
|
|
444
|
+
/** Owned by the map but not placed: for `add(layer, index)` or `layers().insert(...)`. */
|
|
445
|
+
buildLayer<T extends SpecType<'layer'>>(id: string, spec: SpecArg<'layer', T>): MassifLayer<ClassOfSpec<'layer', T>>;
|
|
446
|
+
add<L extends MassifLayer>(layer: L, index?: number): L;
|
|
447
|
+
/** The layer stays registered until it is destroyed. */
|
|
448
|
+
removeLayer(layer: MassifLayer | number): boolean;
|
|
449
|
+
/** A layer this map added or adopted, by the id it was given. */
|
|
450
|
+
layer(id: string): MassifLayer | null;
|
|
451
|
+
/** Includes layers the object API put there. */
|
|
452
|
+
layerCount(): number;
|
|
453
|
+
adopt(id: string, nativeLayer: any, className?: ClassName): MassifLayer;
|
|
454
|
+
/** OWNED by this map and released with it; module-level `create` is for something shared. */
|
|
455
|
+
object<K extends Kind, T extends SpecType<K>>(kind: K, id: string, spec: SpecArg<K, T>): MassifObject<ClassOfSpec<K, T>>;
|
|
456
|
+
/** @see create - `className` is required, for the same reason. */
|
|
457
|
+
object<C extends ClassName>(kind: string, id: string, spec: {
|
|
458
|
+
type: string;
|
|
459
|
+
} & {
|
|
460
|
+
[key: string]: Json;
|
|
461
|
+
}, className: C): MassifObject<C>;
|
|
462
|
+
source<T extends SpecType<'source'>>(id: string, spec: SpecArg<'source', T>): MassifSource<ClassOfSpec<'source', T>>;
|
|
463
|
+
/** Worth an id when the app talks to it later: a layer's style property cannot be read back as a handle. */
|
|
464
|
+
style<T extends SpecType<'style'>>(id: string, spec: SpecArg<'style', T>): MassifObject<ClassOfSpec<'style', T>>;
|
|
465
|
+
/** `sourceSpec` is for a map not in lon/lat; only the first call uses it. */
|
|
466
|
+
elements(sourceSpec?: SpecArg<'source', 'local'>): MassifElements;
|
|
467
|
+
addMarker(spec: SpecArg<'element', 'marker'>): MassifObject<"massif::Marker">;
|
|
468
|
+
addPopup(spec: SpecArg<'element', 'balloon'>): MassifObject<"massif::BalloonPopup">;
|
|
469
|
+
/** Releases every id the map built, not the view: the object API's map keeps working. */
|
|
470
|
+
destroy(): boolean;
|
|
471
|
+
size(): {
|
|
472
|
+
width: number;
|
|
473
|
+
height: number;
|
|
474
|
+
};
|
|
475
|
+
/** `wait` holds the capture until the tiles have settled. */
|
|
476
|
+
capture(wait?: boolean): Promise<any>;
|
|
477
|
+
/** Rarely needed: the SDK redraws on picture-changing writes. For off-UI-thread changes or a view hidden while moving. */
|
|
478
|
+
requestRedraw(): this;
|
|
479
|
+
camera(): MapCamera;
|
|
480
|
+
/** Shorthand for `eventOptions({ projection })`. */
|
|
481
|
+
eventProjection(name: ProjectionName): this;
|
|
482
|
+
onClick(handler: (data: MassifEventData<'massif::Options', 'map.clicked'>) => void, options?: SubscribeOptions): Subscription;
|
|
483
|
+
onMove(handler: (data: MassifEventData<'massif::Options', 'map.moved'>) => void, options?: SubscribeOptions): Subscription;
|
|
484
|
+
onIdle(handler: (data: MassifEventData<'massif::Options', 'map.idle'>) => void, options?: SubscribeOptions): Subscription;
|
|
485
|
+
onStable(handler: (data: MassifEventData<'massif::Options', 'map.stable'>) => void, options?: SubscribeOptions): Subscription;
|
|
486
|
+
onInteraction(handler: (data: MassifEventData<'massif::Options', 'map.interaction'>) => void, options?: SubscribeOptions): Subscription;
|
|
487
|
+
fog(spec?: SpecArg<'options', 'fog'>): PropertyGroup<"massif::FogOptions">;
|
|
488
|
+
sky(spec?: SpecArg<'options', 'sky'>): PropertyGroup<"massif::SkyOptions">;
|
|
489
|
+
light(spec?: SpecArg<'options', 'light'>): PropertyGroup<"massif::LightOptions">;
|
|
490
|
+
/** The elevation decoder comes from the source's own `encoding`. */
|
|
491
|
+
terrain(spec?: SpecArg<'options', 'terrain'>): PropertyGroup<"massif::TerrainOptions">;
|
|
492
|
+
private optionGroup;
|
|
493
|
+
}
|
|
494
|
+
/** For a loaded map view. Its event listener is CHAINED, not replaced, so existing handlers keep firing. */
|
|
495
|
+
export declare function attach(view: MapViewLike, options?: AttachOptions): MassifMap;
|