three-geo-play 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -0
- package/dist/index.cjs +9445 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +457 -0
- package/dist/index.js +9428 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
|
|
3
|
+
// ─── Enums ────────────────────────────────────────────────────────────────────
|
|
4
|
+
|
|
5
|
+
/** Available tile loading patterns. */
|
|
6
|
+
export declare const TileLayout: {
|
|
7
|
+
readonly CIRCULAR: 'circular';
|
|
8
|
+
readonly GRID: 'grid';
|
|
9
|
+
};
|
|
10
|
+
export type TileLayout = typeof TileLayout[keyof typeof TileLayout];
|
|
11
|
+
|
|
12
|
+
/** Camera / map tracking modes. */
|
|
13
|
+
export declare const ViewMode: {
|
|
14
|
+
readonly FOLLOW_TARGET: 'follow_target';
|
|
15
|
+
readonly MANUAL: 'manual';
|
|
16
|
+
};
|
|
17
|
+
export type ViewMode = typeof ViewMode[keyof typeof ViewMode];
|
|
18
|
+
|
|
19
|
+
// ─── Utility types ────────────────────────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
export interface LatLon {
|
|
22
|
+
lat: number;
|
|
23
|
+
lon: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface WorldOffset {
|
|
27
|
+
x: number;
|
|
28
|
+
z: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ─── Layer sub-types ──────────────────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
/** A single land cover type (grass, wood, sand, …). */
|
|
34
|
+
export declare class LandCoverType {
|
|
35
|
+
/** Whether this type is rendered. */
|
|
36
|
+
isVisible: boolean;
|
|
37
|
+
/** Three.js material used for this land cover. */
|
|
38
|
+
material: THREE.Material;
|
|
39
|
+
/** Y-axis render order offset. */
|
|
40
|
+
YOrder: number;
|
|
41
|
+
setVisible(v: boolean): void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** A single land use type (residential, industrial, hospital, …). */
|
|
45
|
+
export declare class LandUseType {
|
|
46
|
+
isVisible: boolean;
|
|
47
|
+
material: THREE.Material;
|
|
48
|
+
YOrder: number;
|
|
49
|
+
setVisible(v: boolean): void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** A single water body type (river, lake, ocean, …). */
|
|
53
|
+
export declare class WaterType {
|
|
54
|
+
isVisible: boolean;
|
|
55
|
+
material: THREE.Material;
|
|
56
|
+
YOrder: number;
|
|
57
|
+
setVisible(v: boolean): void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** A single waterway type (river, canal, ditch, …). */
|
|
61
|
+
export declare class WaterwayType {
|
|
62
|
+
isVisible: boolean;
|
|
63
|
+
material: THREE.Material;
|
|
64
|
+
outlineMaterial: THREE.Material;
|
|
65
|
+
YOrder: number;
|
|
66
|
+
/** Half-width of the rendered line in world units. Must be ≥ 0. */
|
|
67
|
+
lineWidth: number;
|
|
68
|
+
/**
|
|
69
|
+
* Per-type outline width. Set to `null` to inherit from the layer default.
|
|
70
|
+
*/
|
|
71
|
+
outlineWidth: number | null;
|
|
72
|
+
setVisible(v: boolean): void;
|
|
73
|
+
/** Resets outlineWidth to null (falls back to layer default). */
|
|
74
|
+
resetOutlineWidth(): void;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** A single road / transport type (motorway, primary, rail, …). */
|
|
78
|
+
export declare class RoadType {
|
|
79
|
+
isVisible: boolean;
|
|
80
|
+
material: THREE.Material;
|
|
81
|
+
outlineMaterial: THREE.Material;
|
|
82
|
+
YOrder: number;
|
|
83
|
+
/** Half-width of the road geometry in world units. Must be ≥ 0. */
|
|
84
|
+
lineWidth: number;
|
|
85
|
+
/** Per-type outline width. `null` falls back to GeneralConfig.outlineWidth. */
|
|
86
|
+
outlineWidth: number | null;
|
|
87
|
+
setVisible(v: boolean): void;
|
|
88
|
+
resetOutlineWidth(): void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ─── Layers ───────────────────────────────────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
/** Background base-fill layer rendered beneath everything else. */
|
|
94
|
+
export declare class BackgroundLayer {
|
|
95
|
+
isVisible: boolean;
|
|
96
|
+
material: THREE.Material;
|
|
97
|
+
/** Y-axis render order (very negative — renders under all other layers). */
|
|
98
|
+
YOrder: number;
|
|
99
|
+
getTypeByName(name: string): this;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** 3D building extrusion layer. */
|
|
103
|
+
export declare class BuildingLayer {
|
|
104
|
+
isVisible: boolean;
|
|
105
|
+
/** Material applied to building faces. */
|
|
106
|
+
material: THREE.Material;
|
|
107
|
+
YOrder: number;
|
|
108
|
+
/** Base extrusion height multiplier for buildings without OSM height data. */
|
|
109
|
+
height: number;
|
|
110
|
+
/** Enable finer roof / detail shapes when available in tile data. */
|
|
111
|
+
allowDetails: boolean;
|
|
112
|
+
getTypeByName(name: string): this;
|
|
113
|
+
setMaterial(material: THREE.Material): this;
|
|
114
|
+
setYOrder(y: number): this;
|
|
115
|
+
setHeight(h: number): this;
|
|
116
|
+
setAllowDetails(val: boolean): this;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type LandCoverClassName = 'sand' | 'park' | 'grass' | 'wood' | 'wetland' | 'rock' | 'farmland';
|
|
120
|
+
|
|
121
|
+
/** Manages land cover types (grass, wood, sand, …). */
|
|
122
|
+
export declare class LandCoverLayer {
|
|
123
|
+
/** Master toggle — also propagates to all individual types. */
|
|
124
|
+
isVisible: boolean;
|
|
125
|
+
readonly sand: LandCoverType;
|
|
126
|
+
readonly park: LandCoverType;
|
|
127
|
+
readonly grass: LandCoverType;
|
|
128
|
+
readonly wood: LandCoverType;
|
|
129
|
+
readonly wetland: LandCoverType;
|
|
130
|
+
readonly rock: LandCoverType;
|
|
131
|
+
readonly farmland: LandCoverType;
|
|
132
|
+
getTypeByName(name: LandCoverClassName): LandCoverType | null;
|
|
133
|
+
setAllMaterials(material: THREE.Material): void;
|
|
134
|
+
setVisibleAll(isVisible: boolean): void;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type LandUseClassName =
|
|
138
|
+
| 'farmland' | 'suburb' | 'residential' | 'industrial' | 'pitch'
|
|
139
|
+
| 'university' | 'retail' | 'playground' | 'commercial' | 'military'
|
|
140
|
+
| 'school' | 'college' | 'bus_station' | 'kindergarten' | 'theme_park'
|
|
141
|
+
| 'hospital' | 'railway' | 'parking' | 'recreation_ground' | 'cemetery'
|
|
142
|
+
| 'library' | 'track' | 'stadium' | 'quarter' | 'zoo' | 'attraction'
|
|
143
|
+
| 'religious' | 'quarry' | 'nature_reserve' | 'protected_area';
|
|
144
|
+
|
|
145
|
+
/** Manages land use types (residential, industrial, parks, …). */
|
|
146
|
+
export declare class LandUseLayer {
|
|
147
|
+
isVisible: boolean;
|
|
148
|
+
readonly farmland: LandUseType;
|
|
149
|
+
readonly suburb: LandUseType;
|
|
150
|
+
readonly residential: LandUseType;
|
|
151
|
+
readonly industrial: LandUseType;
|
|
152
|
+
readonly pitch: LandUseType;
|
|
153
|
+
readonly university: LandUseType;
|
|
154
|
+
readonly retail: LandUseType;
|
|
155
|
+
readonly playground: LandUseType;
|
|
156
|
+
readonly commercial: LandUseType;
|
|
157
|
+
readonly military: LandUseType;
|
|
158
|
+
readonly school: LandUseType;
|
|
159
|
+
readonly college: LandUseType;
|
|
160
|
+
readonly bus_station: LandUseType;
|
|
161
|
+
readonly kindergarten: LandUseType;
|
|
162
|
+
readonly theme_park: LandUseType;
|
|
163
|
+
readonly hospital: LandUseType;
|
|
164
|
+
readonly railway: LandUseType;
|
|
165
|
+
readonly parking: LandUseType;
|
|
166
|
+
readonly recreation_ground: LandUseType;
|
|
167
|
+
readonly cemetery: LandUseType;
|
|
168
|
+
readonly library: LandUseType;
|
|
169
|
+
readonly track: LandUseType;
|
|
170
|
+
readonly stadium: LandUseType;
|
|
171
|
+
readonly quarter: LandUseType;
|
|
172
|
+
readonly zoo: LandUseType;
|
|
173
|
+
readonly attraction: LandUseType;
|
|
174
|
+
readonly religious: LandUseType;
|
|
175
|
+
readonly quarry: LandUseType;
|
|
176
|
+
readonly nature_reserve: LandUseType;
|
|
177
|
+
readonly protected_area: LandUseType;
|
|
178
|
+
getTypeByName(name: LandUseClassName): LandUseType | null;
|
|
179
|
+
setAllMaterials(material: THREE.Material): void;
|
|
180
|
+
setVisibleAll(v: boolean): void;
|
|
181
|
+
static readonly admittedClasses: Set<LandUseClassName>;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export type WaterClassName = 'swimming_pool' | 'river' | 'lake' | 'ocean' | 'pond';
|
|
185
|
+
|
|
186
|
+
/** Manages water body types (lakes, oceans, rivers as polygons). */
|
|
187
|
+
export declare class WaterLayer {
|
|
188
|
+
isVisible: boolean;
|
|
189
|
+
readonly swimming_pool: WaterType;
|
|
190
|
+
readonly river: WaterType;
|
|
191
|
+
readonly lake: WaterType;
|
|
192
|
+
readonly ocean: WaterType;
|
|
193
|
+
readonly pond: WaterType;
|
|
194
|
+
getTypeByName(name: WaterClassName): WaterType | null;
|
|
195
|
+
setAllMaterials(material: THREE.Material): void;
|
|
196
|
+
setVisibleAll(isVisible: boolean): void;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export type WaterwayClassName = 'river' | 'stream' | 'tidal_channel' | 'flowline' | 'canal' | 'drain' | 'ditch' | 'pressurised';
|
|
200
|
+
|
|
201
|
+
/** Manages waterway types (rivers, canals, ditches as lines). */
|
|
202
|
+
export declare class WaterwayLayer {
|
|
203
|
+
isVisible: boolean;
|
|
204
|
+
readonly river: WaterwayType;
|
|
205
|
+
readonly stream: WaterwayType;
|
|
206
|
+
readonly tidal_channel: WaterwayType;
|
|
207
|
+
readonly flowline: WaterwayType;
|
|
208
|
+
readonly canal: WaterwayType;
|
|
209
|
+
readonly drain: WaterwayType;
|
|
210
|
+
readonly ditch: WaterwayType;
|
|
211
|
+
readonly pressurised: WaterwayType;
|
|
212
|
+
getTypeByName(name: WaterwayClassName): WaterwayType | null;
|
|
213
|
+
setAllMaterials(material: THREE.Material, outlineMaterial?: THREE.Material): void;
|
|
214
|
+
setOutlineWidthAll(width: number): void;
|
|
215
|
+
resetOutlineWidthAll(): void;
|
|
216
|
+
setLineWidthAll(width: number): void;
|
|
217
|
+
setVisibleAll(isVisible: boolean): void;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Shared defaults applied to all road types unless individually overridden. */
|
|
221
|
+
export declare class GeneralConfig {
|
|
222
|
+
/** Segments used to round road joints. Minimum 6. */
|
|
223
|
+
jointSegments: number;
|
|
224
|
+
/** Default outline width in world units for all road types without their own override. */
|
|
225
|
+
outlineWidth: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export type TransportClassName =
|
|
229
|
+
| 'motorway' | 'trunk' | 'trunk_construction'
|
|
230
|
+
| 'primary' | 'primary_construction'
|
|
231
|
+
| 'secondary' | 'secondary_construction'
|
|
232
|
+
| 'tertiary' | 'minor' | 'minor_construction'
|
|
233
|
+
| 'service' | 'service_construction'
|
|
234
|
+
| 'rail' | 'transit' | 'pedestrian'
|
|
235
|
+
| 'path' | 'path_construction'
|
|
236
|
+
| 'track' | 'pier' | 'ferry';
|
|
237
|
+
|
|
238
|
+
/** Manages all road and transport types rendered on the map. */
|
|
239
|
+
export declare class TransportationLayer {
|
|
240
|
+
readonly isVisible: boolean;
|
|
241
|
+
/** Shared configuration defaults (joint segments, global outline width). */
|
|
242
|
+
readonly generalConfig: GeneralConfig;
|
|
243
|
+
readonly motorway: RoadType;
|
|
244
|
+
readonly trunk: RoadType;
|
|
245
|
+
readonly trunk_construction: RoadType;
|
|
246
|
+
readonly primary: RoadType;
|
|
247
|
+
readonly primary_construction: RoadType;
|
|
248
|
+
readonly secondary: RoadType;
|
|
249
|
+
readonly secondary_construction: RoadType;
|
|
250
|
+
readonly tertiary: RoadType;
|
|
251
|
+
readonly minor: RoadType;
|
|
252
|
+
readonly minor_construction: RoadType;
|
|
253
|
+
readonly service: RoadType;
|
|
254
|
+
readonly service_construction: RoadType;
|
|
255
|
+
readonly rail: RoadType;
|
|
256
|
+
readonly transit: RoadType;
|
|
257
|
+
readonly pedestrian: RoadType;
|
|
258
|
+
readonly path: RoadType;
|
|
259
|
+
readonly path_construction: RoadType;
|
|
260
|
+
readonly track: RoadType;
|
|
261
|
+
readonly pier: RoadType;
|
|
262
|
+
readonly ferry: RoadType;
|
|
263
|
+
/**
|
|
264
|
+
* Returns the effective outline width for a road type:
|
|
265
|
+
* the type's own value if set, otherwise `generalConfig.outlineWidth`.
|
|
266
|
+
*/
|
|
267
|
+
resolveOutlineWidth(roadType: RoadType): number;
|
|
268
|
+
setOutlineWidthAll(width: number): void;
|
|
269
|
+
resetOutlineWidthAll(): void;
|
|
270
|
+
setVisible(isVisible: boolean): void;
|
|
271
|
+
setAllMaterials(material: THREE.Material, outlineMaterial?: THREE.Material): void;
|
|
272
|
+
getTypeByName(name: TransportClassName): RoadType | null;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// ─── MapStyle ─────────────────────────────────────────────────────────────────
|
|
276
|
+
|
|
277
|
+
export type StyleLayerName = 'background' | 'waterway' | 'water' | 'landcover' | 'landuse' | 'building' | 'transportation';
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Top-level style container for a ThreeGeoPlay map.
|
|
281
|
+
* Holds one instance of every renderable layer.
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* const style = geoPlay.getMapConfig().mapStyle;
|
|
285
|
+
* style.buildingLayer.isVisible = true;
|
|
286
|
+
* style.transportationLayer.motorway.material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
|
|
287
|
+
*/
|
|
288
|
+
export declare class MapStyle {
|
|
289
|
+
buildingLayer: BuildingLayer;
|
|
290
|
+
waterLayer: WaterLayer;
|
|
291
|
+
waterwayLayer: WaterwayLayer;
|
|
292
|
+
landUseLayer: LandUseLayer;
|
|
293
|
+
landCoverLayer: LandCoverLayer;
|
|
294
|
+
transportationLayer: TransportationLayer;
|
|
295
|
+
backgroundLayer: BackgroundLayer;
|
|
296
|
+
getStyleLayerByName(layerName: 'background'): BackgroundLayer;
|
|
297
|
+
getStyleLayerByName(layerName: 'waterway'): WaterwayLayer;
|
|
298
|
+
getStyleLayerByName(layerName: 'water'): WaterLayer;
|
|
299
|
+
getStyleLayerByName(layerName: 'landcover'): LandCoverLayer;
|
|
300
|
+
getStyleLayerByName(layerName: 'landuse'): LandUseLayer;
|
|
301
|
+
getStyleLayerByName(layerName: 'building'): BuildingLayer;
|
|
302
|
+
getStyleLayerByName(layerName: 'transportation'): TransportationLayer;
|
|
303
|
+
getStyleLayerByName(layerName: string): BackgroundLayer | WaterwayLayer | WaterLayer | LandCoverLayer | LandUseLayer | BuildingLayer | TransportationLayer | null;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// ─── MapConfig ────────────────────────────────────────────────────────────────
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Configuration for a ThreeGeoPlay map instance.
|
|
310
|
+
* Modify properties directly — dirty tracking ensures only the minimum
|
|
311
|
+
* necessary update runs on the next `onFrameUpdate()` call.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* const config = geoPlay.getMapConfig();
|
|
315
|
+
* config.zoomLevel = 16;
|
|
316
|
+
* config.renderDistance = 6;
|
|
317
|
+
* config.tileLayout = TileLayout.GRID;
|
|
318
|
+
*/
|
|
319
|
+
export declare class MapConfig {
|
|
320
|
+
/**
|
|
321
|
+
* ZXY URL template for the PBF vector tile provider.
|
|
322
|
+
* Use `{z}`, `{x}`, `{y}` as placeholders.
|
|
323
|
+
* Changing this triggers a full tile rebuild.
|
|
324
|
+
*/
|
|
325
|
+
pbfTileProviderZXYurl: string;
|
|
326
|
+
/**
|
|
327
|
+
* OSM zoom level (typically 14–18). Higher = more detail.
|
|
328
|
+
* Changing this triggers a full tile rebuild.
|
|
329
|
+
*/
|
|
330
|
+
zoomLevel: number;
|
|
331
|
+
/**
|
|
332
|
+
* Number of tiles to load in each direction from the origin tile.
|
|
333
|
+
*/
|
|
334
|
+
renderDistance: number;
|
|
335
|
+
/**
|
|
336
|
+
* World-space size of one tile in Three.js units. Must be > 0.
|
|
337
|
+
*/
|
|
338
|
+
tileWorldSize: number;
|
|
339
|
+
/**
|
|
340
|
+
* Tile loading pattern. Use `TileLayout.CIRCULAR` or `TileLayout.GRID`.
|
|
341
|
+
* Changing this triggers a full tile rebuild.
|
|
342
|
+
*/
|
|
343
|
+
tileLayout: TileLayout;
|
|
344
|
+
/**
|
|
345
|
+
* Geographic coordinates of the map origin.
|
|
346
|
+
* Changing this triggers a full tile rebuild.
|
|
347
|
+
*/
|
|
348
|
+
originLatLon: LatLon;
|
|
349
|
+
/**
|
|
350
|
+
* Additional X/Z offset applied to the world origin in Three.js units.
|
|
351
|
+
* Changing this triggers a full tile rebuild.
|
|
352
|
+
*/
|
|
353
|
+
worldOriginOffset: WorldOffset;
|
|
354
|
+
/**
|
|
355
|
+
* Camera/map tracking mode. Use `ViewMode.FOLLOW_TARGET` or `ViewMode.MANUAL`.
|
|
356
|
+
*/
|
|
357
|
+
viewMode: ViewMode;
|
|
358
|
+
/**
|
|
359
|
+
* Active map style. Changing this triggers a material update on all tiles.
|
|
360
|
+
*/
|
|
361
|
+
mapStyle: MapStyle;
|
|
362
|
+
/** Draws a visible border around each tile — useful for debugging. */
|
|
363
|
+
showTileBorders: boolean;
|
|
364
|
+
/** Scale factor relative to zoom level 18. */
|
|
365
|
+
readonly zoomScaleFactor: number;
|
|
366
|
+
/** True if any property has changed since the last flush. */
|
|
367
|
+
readonly _isDirty: boolean;
|
|
368
|
+
readonly _dirtyFields: Set<string>;
|
|
369
|
+
readonly requiresRebuild: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Minimum interval in milliseconds between follow-target tile updates.
|
|
372
|
+
* `0` means update every frame.
|
|
373
|
+
*/
|
|
374
|
+
readonly FollowUpdateInterval: number;
|
|
375
|
+
/**
|
|
376
|
+
* Sets the minimum interval between follow-target updates.
|
|
377
|
+
* @param intervalMs Milliseconds. Must be ≥ 0.
|
|
378
|
+
*/
|
|
379
|
+
setFollowUpdateInterval(intervalMs: number): void;
|
|
380
|
+
flushDirtyState(): void;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// ─── ThreeGeoPlay ─────────────────────────────────────────────────────────────
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Main entry point for ThreeGeoPlay.
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* const geoPlay = new ThreeGeoPlay(scene, camera, renderer);
|
|
390
|
+
* geoPlay.start();
|
|
391
|
+
*
|
|
392
|
+
* function animate() {
|
|
393
|
+
* requestAnimationFrame(animate);
|
|
394
|
+
* geoPlay.onFrameUpdate();
|
|
395
|
+
* renderer.render(scene, camera);
|
|
396
|
+
* }
|
|
397
|
+
* animate();
|
|
398
|
+
*/
|
|
399
|
+
export declare class ThreeGeoPlay {
|
|
400
|
+
/**
|
|
401
|
+
* @param threeScene Three.js scene.
|
|
402
|
+
* @param threeCamera Three.js camera (also the default follow target).
|
|
403
|
+
* @param threeRenderer Three.js renderer.
|
|
404
|
+
*/
|
|
405
|
+
constructor(threeScene: THREE.Scene, threeCamera: THREE.Camera, threeRenderer: THREE.WebGLRenderer);
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Sets the object the map will follow in `FOLLOW_TARGET` mode.
|
|
409
|
+
* Automatically switches `viewMode` to `FOLLOW_TARGET` if needed.
|
|
410
|
+
* @param target Any Three.js Object3D (mesh, group, camera, …).
|
|
411
|
+
*/
|
|
412
|
+
setFollowTarget(target: THREE.Object3D): void;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Moves the map origin to geographic coordinates.
|
|
416
|
+
* Only effective in `MANUAL` mode.
|
|
417
|
+
* @param lat Latitude −90 … 90.
|
|
418
|
+
* @param lon Longitude −180 … 180.
|
|
419
|
+
*/
|
|
420
|
+
moveMapOriginToLatLon(lat: number, lon: number): void;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Moves the map origin to a Three.js world-space position.
|
|
424
|
+
* Automatically switches to `MANUAL` mode if needed.
|
|
425
|
+
*/
|
|
426
|
+
moveMapOriginToPosition(x: number, z: number): void;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Initialises the map and loads the first set of tiles.
|
|
430
|
+
* Call once after setting up `MapConfig` and `MapStyle`.
|
|
431
|
+
*/
|
|
432
|
+
start(): void;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Processes per-frame updates. **Must be called every frame in your animation loop.**
|
|
436
|
+
*/
|
|
437
|
+
onFrameUpdate(): void;
|
|
438
|
+
|
|
439
|
+
/** Returns the active `MapConfig`. Modify its properties to change map behaviour. */
|
|
440
|
+
getMapConfig(): MapConfig;
|
|
441
|
+
|
|
442
|
+
/** Replaces the entire map configuration. */
|
|
443
|
+
setMapConfig(mapConfig: MapConfig): void;
|
|
444
|
+
|
|
445
|
+
/** Returns the active `MapStyle`. */
|
|
446
|
+
getMapStyle(): MapStyle;
|
|
447
|
+
|
|
448
|
+
/** Replaces the active map style. */
|
|
449
|
+
setMapStyle(mapStyle: MapStyle): void;
|
|
450
|
+
|
|
451
|
+
getScene(): THREE.Scene;
|
|
452
|
+
getCamera(): THREE.Camera;
|
|
453
|
+
getRenderer(): THREE.WebGLRenderer;
|
|
454
|
+
|
|
455
|
+
/** Destroys the instance and releases all resources. */
|
|
456
|
+
destroy(): void;
|
|
457
|
+
}
|