@mappedin/mappedin-js 5.10.2 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,7 @@ declare module '@mappedin/mappedin-js' {
26
26
  export type { BlueDot } from '@mappedin/mappedin-js/renderer/public/api/BlueDot';
27
27
  export type { Markers } from '@mappedin/mappedin-js/renderer/public/api/Markers';
28
28
  export type { Paths } from '@mappedin/mappedin-js/renderer/public/api/Paths';
29
+ export type { TOOLTIP_ANCHOR } from '@mappedin/mappedin-js/renderer/internal/Mappedin.SmartTooltip';
29
30
  export type TMappedinInitializeOutput = {
30
31
  mapView: MapView;
31
32
  venue: Mappedin;
@@ -118,16 +119,46 @@ declare module '@mappedin/mappedin-js/renderer/public/MapView' {
118
119
  import { Paths } from '@mappedin/mappedin-js/renderer/public/api/Paths';
119
120
  import { BlueDot } from '@mappedin/mappedin-js/renderer/public/api/BlueDot';
120
121
  import { Camera } from '@mappedin/mappedin-js/renderer/public/api/Camera';
122
+ /**
123
+ * Primary API class for controlling and interacting with a 3D map.
124
+ */
121
125
  export class MapView extends PubSub<E_SDK_EVENT_PAYLOAD, E_SDK_EVENT> {
122
126
  #private;
127
+ /**
128
+ * API for representing sets of directions on the map.
129
+ */
123
130
  Journey: Journey;
131
+ /**
132
+ * API for controlling the camera in the scene.
133
+ */
124
134
  Camera: Camera;
135
+ /**
136
+ * API for controlling flat labels.
137
+ */
125
138
  FlatLabels: IFlatLabels<void>;
139
+ /**
140
+ * API for controlling floating labels.
141
+ */
126
142
  FloatingLabels: IFloatingLabels<void>;
143
+ /**
144
+ * API for adding 2D markers.
145
+ */
127
146
  Markers: Markers;
147
+ /**
148
+ * API for drawing arbitrary paths.
149
+ */
128
150
  Paths: Paths;
151
+ /**
152
+ * API for handling a user's position on the map.
153
+ */
129
154
  BlueDot: BlueDot;
155
+ /**
156
+ * The options that the mapView was instantiated with.
157
+ */
130
158
  options: TMapViewOptions;
159
+ /**
160
+ * @hidden
161
+ */
131
162
  constructor(container: HTMLElement, venue: Mappedin, options?: TMapViewOptions & {
132
163
  onFirstMapLoaded: () => void;
133
164
  });
@@ -140,75 +171,184 @@ declare module '@mappedin/mappedin-js/renderer/public/MapView' {
140
171
  */
141
172
  labelAllLocations(options?: TLabelAllLocationFloatingLabelOptions | TLabelAllLocationFlatLabelOptions): never[];
142
173
  /**
143
- * Get Nearest Node to a screen coordinate x, y, map. Useful for doing directions from any place on the map
174
+ * Get the nearest {@link MappedinNode} on a map to an XY-coordinate on the screen.
175
+ * This can be useful for generating directions from an arbitrary point on the map.
176
+ *
177
+ * ```
178
+ * // Get the nearest node on map[0] to (100,100)
179
+ * const nearestNode = mapView.getNearestNodeByScreenCoordinates(100, 100, mapView.venue.maps[0]);
180
+ * const destination = mapView.venue.locations.find((l) => l.name === "Apple")!;
181
+ *
182
+ * // Find out how to get from that node to Apple
183
+ * const directions = nearestNode.directionsTo(destination);
184
+ * ```
144
185
  *
145
- * @param x
146
- * @param y
147
- * @param mapOrMapId Map of MapId
186
+ * @param x The x position of a coordinate on the screen.
187
+ * @param y The y position of a coordinate on the screen.
188
+ * @param mapOrMapId The {@link MappedinMap} the node should belong to.
148
189
  */
149
190
  getNearestNodeByScreenCoordinates(x: number, y: number, mapOrMapId?: MappedinMap | MappedinMap['id']): MappedinNode;
150
191
  /**
151
- * Unsubscribe from SDK events
192
+ * Subscribe a function to an {@link E_SDK_EVENT}.
193
+ *
194
+ * ```ts
195
+ * // Set a polygon to be red when it is clicked
196
+ * const mapClickHandler = ({ polygons }: E_SDK_EVENT_PAYLOAD["CLICK"]) => {
197
+ * if (polygons.length > 0) {
198
+ * mapView.setPolygonColor(polygons[0], 'red');
199
+ * }
200
+ * }
201
+ * mapView.on(E_SDK_EVENT.CLICK, mapClickHandler);
202
+ * ```
203
+ *
204
+ * @param eventName An {@link E_SDK_EVENT} which, when fired, will call the provided
205
+ * function.
206
+ * @param fn A callback that gets called when the corresponding event is fired. The
207
+ * callback will get passed an argument with a type that's one of {@link E_SDK_EVENT_PAYLOAD}.
208
+ */
209
+ on: PubSub<E_SDK_EVENT_PAYLOAD, E_SDK_EVENT>['on'];
210
+ /**
211
+ * Unsubscribe a function previously subscribed with {@link on} from
212
+ * and {@link E_SDK_EVENT}.
213
+ *
214
+ * ```ts
215
+ * mapView.on(E_SDK_EVENT.CLICK, mapClickHandler);
216
+ *
217
+ * ...
218
+ *
219
+ * // Something changed and I no longer want this event
220
+ * mapView.off(E_SDK_EVENT.CLICK, mapClickHandler);
221
+ * ```
222
+ *
223
+ * @param eventName An {@link E_SDK_EVENT} to which the provided function was previously
224
+ * subscribed.
225
+ * @param fn A function that was previously passed to {@link on}. The function must
226
+ * have the same reference as the function that was subscribed.
227
+ */
228
+ off: PubSub<E_SDK_EVENT_PAYLOAD, E_SDK_EVENT>['off'];
229
+ /**
230
+ * Set state of the mapView to one of {@link STATE}.
231
+ *
232
+ * @param state The {@link STATE} to set the SDK to.
152
233
  */
153
234
  setState(state: STATE): Promise<void>;
235
+ /**
236
+ * The current {@link STATE} on the mapView.
237
+ */
154
238
  get state(): STATE;
155
239
  /**
156
- * The Venue data this MapView is using.
157
- *
158
- * @property venue {MappedinVenue}
159
- * @final
240
+ * The {@link Mappedin} data this mapView is using.
160
241
  */
161
242
  get venue(): Mappedin;
162
243
  /**
163
- * The div MapView is using.
164
- *
165
- * @property container {Div}
166
- * @final
244
+ * The HTML element that the mapView is rendered into.
167
245
  */
168
246
  get container(): HTMLElement;
169
247
  /**
170
- * The current map being displayed
248
+ * The current {@link MappedinMap} being displayed.
171
249
  */
172
250
  get currentMap(): MappedinMap;
173
251
  /**
174
- * Remove all interactive polygons
252
+ * Prevent any polygons from showing a hover effect and being clicked on.
253
+ * See also {@link addInteractivePolygon} and {@link addInteractivePolygonsForAllLocations}.
254
+ *
255
+ * ```ts
256
+ * mapView.removeAllInteractivePolygons()
257
+ * ```
175
258
  */
176
259
  removeAllInteractivePolygons(): void;
177
260
  /**
178
- * Change the currently displayed Map to a new one.
261
+ * Change the currently displayed {@link MappedinMap} to a new one.
179
262
  *
180
- * @method setMap
181
- * @param mapOrMapId The Map ID or Map Object to change the Map to.
263
+ * ```ts
264
+ * await mapView.setMap(mapView.venue.maps[1]);
265
+ * ```
266
+ *
267
+ * @param mapOrMapId The {@link MappedinMap} to display.
268
+ * @returns A promise that resolves when the map is fully switched.
182
269
  */
183
270
  setMap(mapOrMapId: MappedinMap | string): Promise<null>;
184
271
  /**
185
- * Given a polygon, set it to a specific color.
272
+ * Given a {@link MappedinPolygon}, set it to a specific color.
273
+ *
274
+ * ```ts
275
+ * // Find the polygons of the Apple store and change them to blue
276
+ * const location = mapView.venue.locations.find((l) => l.name === "Apple")!;
277
+ * for (const polygon of location.polygons) {
278
+ * mapView.setPolygonColor(polygon, "#0000ff");
279
+ * }
280
+ * ```
186
281
  *
187
- * @param polygon The Polygon ({@link MappedinPolygon}) to change the color of.
188
- * @param color The color to use.
282
+ * @param polygon The {@link MappedinPolygon} to change the color of.
283
+ * @param color A hexidecimal color string to use as the new color.
189
284
  */
190
285
  setPolygonColor(polygon: MappedinPolygon, color: string): void;
191
286
  /**
192
- * Resets a Polygon back to it's original color.
193
- * If the user is hovering over a polygon, it will still have the hover effect.
287
+ * Resets a {@link MappedinPolygon} back to it's original color. See also {@link clearAllPolygonColors} and
288
+ * {@link setPolygonColor}. If the user is hovering over a polygon, it will still
289
+ * have the hover color set by {@link setHoverColor}.
290
+ *
291
+ * ```ts
292
+ * mapView.setPolygonColor(polygon, "#0000ff");
194
293
  *
195
- * @param polygonOrPolygonId The Polygon/Polygon ID to reset.
294
+ * ...
295
+ *
296
+ * // Reset the polygon color
297
+ * mapView.clearPolygonColor(polygon);
298
+ * ```
299
+ *
300
+ * @param polygonOrPolygonId The {@link MappedinPolygon} to reset the color of.
196
301
  */
197
302
  clearPolygonColor(polygonOrPolygonId: MappedinPolygon | string): void;
198
303
  /**
199
- * Resets ALL Polygons you have changed with {@link MapView.setPolygonColor} back to their original color.
200
- * The hover effect will still be present if the user is currently hovering over a Polygon.
304
+ * Resets all {@link MappedinPolygon} instances back to their original colors. See also {@link clearPolygonColor} and
305
+ * {@link setPolygonColor}. If the user is hovering over a polygon, it will still
306
+ * have the hover color set by {@link setHoverColor}.
307
+ *
308
+ * ```ts
309
+ * mapView.clearAllPolygonColors();
310
+ * ```
201
311
  */
202
312
  clearAllPolygonColors(): void;
203
313
  /**
204
- * Makes a single Polygon hoverable/clickable. Polygons you haven't called this on will be treated as non-interactive and not respond to any mouse events.
314
+ * Makes a {@link MappedinPolygon} interactive. This means it will receive a hover effect and
315
+ * respond to the `CLICK` {@link E_SDK_EVENT}. See also {@link on} and {@link addInteractivePolygonsForAllLocations}.
316
+ *
317
+ * ```ts
318
+ * // Make all washroom polygons clickable
319
+ * const washroom = mapView.venue.find((l) => l.name === "Washroom")!;
320
+ * for (const polygon of washroom.polygons) {
321
+ * mapView.addInteractivePolygon(polygon);
322
+ * }
323
+ *
324
+ * // Now they will be populated in click events
325
+ * mapView.on(E_SDK_EVENT.CLICK, ({ polygons }) -> {
326
+ * if (polygons.length > 0) {
327
+ * console.log("Clicked on a washroom!");
328
+ * }
329
+ * })
330
+ * ```
205
331
  *
332
+ * @param polygonOrPolygonId The {@link MappedinPolygon} to make interactive.
206
333
  */
207
334
  addInteractivePolygon(polygonOrPolygonId: MappedinPolygon | string): void;
208
335
  /**
209
- * Makes all polygons attached to a location hoverable/clickable. Polygons you haven't called this on will be treated as non-interactive
210
- * This is a convenience function for calling {@link MapView.addInteractivePolygon} on all the polygons attached to all locations. You may also make individual polygons interactive with the addInteractivePolygon method instead of, or in addition to this method.
336
+ * Makes all {@link MappedinPolygon} instances with an attached {@link MappedinLocation} interactive.
337
+ * This means they will receive a hover effect and respond to the `CLICK` {@link E_SDK_EVENT}. See also
338
+ * {@link on} and {@link addInteractivePolygon}.
211
339
  *
340
+ * ```ts
341
+ * mapView.addInteractivePolygonsForAllLocations();
342
+ *
343
+ * // Now all polygons with locations can be clicked
344
+ * mapView.on(E_SDK_EVENT.CLICK, ({ polygons }) => {
345
+ * if (polygons.length > 0) {
346
+ * for (const polygon of polygons) {
347
+ * console.log(`clicked on ${polygon.locations[0].name}`)
348
+ * }
349
+ * }
350
+ * });
351
+ * ```
212
352
  */
213
353
  addInteractivePolygonsForAllLocations(options?: {
214
354
  /**
@@ -221,28 +361,33 @@ declare module '@mappedin/mappedin-js/renderer/public/MapView' {
221
361
  locations?: MappedinLocation[];
222
362
  }): void;
223
363
  /**
224
- * Makes a polygon no longer hoverable/clickable.
364
+ * Makes a polygon no longer hoverable/clickable. See also {@link addInteractivePolygon} and
365
+ * {@link addInteractivePolygonsForAllLocations}.
225
366
  *
226
- * @param polygonOrPolygonId The previously interactive Polygon/Polygon ID to make non-interactive.
367
+ * @param polygonOrPolygonId The {@link MappedinPolygon} to make no longer interactive.
227
368
  */
228
369
  removeInteractivePolygon(polygonOrPolygonId: MappedinPolygon | string): void;
229
370
  /**
230
371
  * Attach any HTML to a {@link MappedinNode} or {@link MappedinCoordinate}, and have the marker interact and collide with smart labels and tooltips
231
- * @deprecated use `mapView.Markers.add` instead.
372
+ * @deprecated use {@link Markers.add} instead.
232
373
  */
233
374
  createMarker(nodeOrCoordinate: MappedinNode | MappedinCoordinate, contentHtml: string, options?: TCreateMarkerOptions): Marker;
234
375
  /**
235
376
  * Remove Marker
236
- * @deprecated use `mapView.Markers.remove` instead.
377
+ * @deprecated use {@link Markers.remove} instead.
237
378
  */
238
379
  removeMarker(markerOrMarkerId: Marker | Marker['id']): void;
239
380
  /**
240
381
  * Removes all Markers (from all Maps, not just the current one).
241
- * @deprecated use `mapView.Markers.removeAll` instead.
382
+ * @deprecated use {@link Markers.removeAll} instead.
242
383
  */
243
384
  removeAllMarkers(): void;
244
385
  /**
245
- * Remove all tooltips
386
+ * Remove all tooltips created with {@link createTooltip} or {@link createCustomTooltip}.
387
+ *
388
+ * ```ts
389
+ * mapView.removeAllTooltips();
390
+ * ```
246
391
  */
247
392
  removeAllTooltips(): void;
248
393
  /**
@@ -302,12 +447,12 @@ declare module '@mappedin/mappedin-js/renderer/public/MapView' {
302
447
  */
303
448
  removeTooltip(tooltipOrTooltipId: SmartTooltip | SmartTooltip['id']): void;
304
449
  /**
305
- * Let any image attached to a Polygon attached to a Location flip 180 degrees with the camera so it's always upright.
450
+ * Let any image attached to a Polygon attached to a Location flip 180 degrees with the camera
451
+ * so it's always upright. See also {@link enableImageFlippingForPolygon}.
306
452
  *
307
- * @method enableImageFlippingForAllLocations
308
- * @param options
309
- * @param [options.excludeTypes=[]] {[String]} A list of Location types to skip, if for some reason there are Locations that have logos that shouldn't flip.
310
- * @param [options.locations] {[MappedinLocation]|[String]} An array of Location objects, or Location IDs. If excludeTypes is not sufficient you can explicitly set the Locations you are marking to flip. You can also call {{#crossLink "MapView/enableImageFlippingForPolygon:method"}}{{/crossLink}} manually for every polygon you care about instead.
453
+ * ```ts
454
+ * mapView.enableImageFlippingForAllLocations();
455
+ * ```
311
456
  */
312
457
  enableImageFlippingForAllLocations(options?: {
313
458
  /**
@@ -320,13 +465,29 @@ declare module '@mappedin/mappedin-js/renderer/public/MapView' {
320
465
  locations?: MappedinLocation[] | string[];
321
466
  }): void;
322
467
  /**
323
- * Mark a specific Polygon so, if it has an image, it rotates with the camera.
468
+ * Mark a specific {@link MappedinPolygon} so, if it has an image, it rotates with the camera.
469
+ * See also {@link enableImageFlippingForAllLocations}.
470
+ *
471
+ * ```ts
472
+ * // Enable image flipping for locations with type "Anchor"
473
+ * const anchorStores = mapView.venue.locations.filter((l) => l.type === "Anchor");
474
+ * for(const store of anchorStores) {
475
+ * for(const polygon of anchorStores.polygons) {
476
+ * mapView.enableImageFlippingForPolygon(polygon);
477
+ * }
478
+ * }
479
+ * ```
324
480
  *
481
+ * @param polygon The {@link MappedinPolygon} to enable image flipping for.
325
482
  */
326
483
  enableImageFlippingForPolygon(polygon: MappedinPolygon): void;
484
+ /**
485
+ * Disable image flipping that was enabled with {@link enableImageFlippingForPolygon} or
486
+ * {@link enableImageFlippingForAllLocations}.
487
+ */
327
488
  disableImageFlippingForAllPolygons(): void;
328
489
  /**
329
- * @deprecated Use `mapView.Paths.add` instead.
490
+ * @deprecated Use {@link Paths.add} instead.
330
491
  *
331
492
  * Draws an entire path. It takes a list of Nodes and will break them into separate pathSegments on every map change, putting the resultant segment on the right Map.
332
493
  *
@@ -335,85 +496,125 @@ declare module '@mappedin/mappedin-js/renderer/public/MapView' {
335
496
  */
336
497
  drawPath(path: MappedinNode[], options?: TPathOptions): string;
337
498
  /**
338
- * @deprecated Use `mapView.Paths.remove` instead.
499
+ * @deprecated Use {@link Paths.remove} instead.
339
500
  *
340
501
  * Remove a path by id
341
502
  */
342
503
  removePath(pathId: string): void;
343
504
  /**
344
- * @deprecated Use `mapView.Paths.removeAll` instead.
505
+ * @deprecated Use {@link Paths.removeAll} instead.
345
506
  *
346
507
  * Removes all pathSegments from all Maps.
347
508
  */
348
509
  removeAllPaths(): void;
349
510
  /**
350
- * Sets the clear color of the Map something else, it you want it to fit it more with your website. Otherwise the div will be white where there is no Map visible.
511
+ * Sets the color of empty space in the scene. Useful for matching the aesthetics of the
512
+ * surrounding website of application. Otherwise the container element will be white where
513
+ * there is no map visible.
351
514
  *
352
- * @param color The color to use. Not an HTML color name.
353
- * @param alpha Opacity between 0 and 1.
515
+ * ```ts
516
+ * // Make the background a dark grey
517
+ * mapView.setBackgroundColor("#050505");
518
+ * ```
519
+ *
520
+ * @param color A hexidecimal color string to use.
521
+ * @param alpha A number between 0 and 1 representing opacity.
354
522
  */
355
523
  setBackgroundColor(color: string, alpha?: number): void;
356
524
  /**
357
- * Sets the color for hovering over polygons
525
+ * Sets a color that {@link MappedinPolygon} instances will receive when they are
526
+ * beneath a cursor. This only applies to interactive polygons set using {@link addInteractivePolygon}
527
+ * or {@link addInteractivePolygonsForAllLocations}.
528
+ *
529
+ * ```ts
530
+ * // Make all location polygons interactive and have a red hover color
531
+ * mapView.addInteractivePolygonsForAllLocations()
532
+ * mapView.setHoverColor("#ff0000");
533
+ * ```
358
534
  */
359
535
  setHoverColor(color: string): void;
360
536
  /**
361
- * The scene only renders when something has changed. This should be something a 3rd party developer doesn't need to worry about,
362
- * but if you are doing something weird, or have your own special tween for something, you will want to call this function.
363
- * You can call it as often as you want, it just sets a flag that we need to render again, and renders a few frames if we weren't already doing that.
364
- * Ignored in 2D.
365
- * @deprecated
537
+ * @deprecated This should no longer need to be called externally and is now a no-op.
366
538
  */
367
539
  tryRendering(_renderMode?: any): void;
368
540
  /**
369
- * Finds the main Location associated with a Polygon. This means a Location
370
- * attached to the Polygon that has no parents, or, if there are none of those,
371
- * a Location nearest the top of some hierarchy that does have the Polygon attached.
541
+ * Finds the main {@link MappedinLocation} associated with a {@link MappedinPolygon}.
542
+ * This means a location attached to the polygon that has no parents, or, if there
543
+ * are none of those, a location nearest the top of some hierarchy that does have the
544
+ * polygon attached.
372
545
  *
373
- * This means if there are multiple hierarchies of Locations attached to the Polygon,
546
+ * This means if there are multiple hierarchies of locations attached to the polygon,
374
547
  * the one that gets returned is not guaranteed to be what you want.
375
548
  *
376
- * @param polygon The Polygon you want the primary Location of.
549
+ * ```
550
+ * // Log the primary location of a clicked polygon
551
+ * mapView.on(E_SDK_EVENT.CLICK, ({ polygons }) => {
552
+ * if (polygons.length > 0) {
553
+ * for(const polygon of polygons) {
554
+ * console.log(mapView.getPrimaryLocationForPolygon(polygon));
555
+ * }
556
+ * }
557
+ * });
558
+ * ```
559
+ *
560
+ * @param polygon The {@link MappedinPolygon} you want the primary location of.
377
561
  */
378
562
  getPrimaryLocationForPolygon(polygon: MappedinPolygon): MappedinLocation;
379
563
  /**
380
- * Finds all polygons that contain the specified MappedinCoordinate. If multiple
381
- * polygons are stacked on top of each other, the array of polygons returned will be
564
+ * Finds all {@link MappedinPolygon} instances that contain the specified {@link MappedinCoordinate}.
565
+ * If multiple polygons are stacked on top of each other, the array of polygons returned will be
382
566
  * in the order of top to bottom.
383
567
  *
384
- * By default, this only considers interactive polygons.
568
+ * By default, this only considers interactive polygons set through {@link addInteractivePolygon} or
569
+ * {@link addInteractivePolygonsForAllLocations}. This behaviour can be changed by passing
570
+ * `options.includeNonInteractive`.
385
571
  *
386
- * @param coordinate The MappedinCoordinate to check
387
- * @param options {@link TGetPolygonsAtCoordinateOptions}
388
- * @returns MappedinPolygon[]
572
+ * ```ts
573
+ * const polygons = mapView.getPolygonsAtCoordinate(coordinate);
574
+ * ```
575
+ *
576
+ * @param coordinate The {@link MappedinCoordinate} to check.
577
+ * @param options
578
+ * @returns An array of {@link MappedinPolygon} instances intersecting the given coordinate.
389
579
  */
390
580
  getPolygonsAtCoordinate(coordinate: MappedinCoordinate, options?: TGetPolygonsAtCoordinateOptions): MappedinPolygon[];
391
581
  /**
392
- * Finds all the polygons on a screen coordinate x and y. If multiple
393
- * polygons are stacked on top of each other, the array of polygons returned will be
394
- * in the order of farthest to closest.
582
+ * Finds all {@link MappedinPolygon} instances that intersect the specified XY-coordinate on screen.
583
+ * If multiple polygons are stacked on top of each other, the array of polygons returned will be
584
+ * in the order of top to bottom.
395
585
  *
396
- * By default, this only considers interactive polygons.
586
+ * By default, this only considers interactive polygons set through {@link addInteractivePolygon} or
587
+ * {@link addInteractivePolygonsForAllLocations}. This behaviour can be changed by passing
588
+ * `options.includeNonInteractive`.
397
589
  *
398
- * @param x
399
- * @param y
400
- * @param options {@link TGetPolygonsAtCoordinateOptions}
401
- * @returns MappedinPolygon[]
590
+ * ```ts
591
+ * const polygons = mapView.getPolygonsAtScreenCoordinate(100, 100);
592
+ * ```
593
+ *
594
+ * @param x The x value of a screen coordinate
595
+ * @param y The y value of a screen coordinate
596
+ * @param options
597
+ * @returns An array of {@link MappedinPolygon} instances intersecting the given coordinate.
402
598
  */
403
599
  getPolygonsAtScreenCoordinate(x: number, y: number, options?: TGetPolygonsAtCoordinateOptions): MappedinPolygon[];
404
600
  /**
405
- * Destroy instance and reclaim memory. Note: this does not destroy the instance of {@link Mappedin}
406
- * that was passed in. For applications that require destroying and re-creating the mapView, it is
407
- * recommended to keep the {@link Mappedin} object around.
601
+ * Destroy the mapView instance and reclaim memory.
602
+ *
603
+ * NOTE: this does not destroy the instance of {@link Mappedin} that was passed in. For applications that
604
+ * require destroying and re-creating the mapView, it is recommended to keep the {@link Mappedin} object
605
+ * around.
606
+ *
607
+ * ```ts
608
+ * mapView.destroy();
609
+ * ```
408
610
  */
409
611
  destroy(): void;
410
612
  }
411
613
  }
412
614
 
413
615
  declare module '@mappedin/mappedin-js/get-venue' {
414
- import type { TGetVenueOptions } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
616
+ import type { TGetVenueOptions, TVenueMetadata } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
415
617
  import { Mappedin } from '@mappedin/mappedin-js/get-venue/Mappedin';
416
- export { E_SDK_LOG_LEVEL, setLoggerLevel } from '@mappedin/mappedin-js/--/common/Mappedin.Logger';
417
618
  /**
418
619
  * This is how we can avoid bundling in node-fetch (via isomorphic fetch),
419
620
  * which keeps popping up in security advisories
@@ -498,6 +699,7 @@ declare module '@mappedin/mappedin-js/get-venue' {
498
699
  * Get Venue Data for a Mappedin Venue
499
700
  */
500
701
  export function getVenue(userOptions: TGetVenueOptions): Promise<Mappedin>;
702
+ export function getVenueMetadata(userOptions: TGetVenueOptions): Promise<TVenueMetadata>;
501
703
  /**
502
704
  * @internal
503
705
  */
@@ -836,6 +1038,9 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
836
1038
  location?: MappedinLocation;
837
1039
  };
838
1040
  export type TMarkerTemplateFn = ({ icon, location }: TMarkerTemplateProps) => string;
1041
+ /**
1042
+ * Configure the behaviour of a {@link Journey}.
1043
+ */
839
1044
  export type TJourneyOptions = {
840
1045
  /**
841
1046
  * What color to highlight departure and destination polygons
@@ -1120,6 +1325,9 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1120
1325
  onWebGLContextRestored?: () => void;
1121
1326
  onWebGLRendererError?: () => void;
1122
1327
  };
1328
+ /**
1329
+ * Control how a flat label looks
1330
+ */
1123
1331
  export type TFlatLabelOptions = {
1124
1332
  text: string;
1125
1333
  /**
@@ -1148,6 +1356,9 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1148
1356
  align: 'left' | 'right' | 'center';
1149
1357
  };
1150
1358
  };
1359
+ /**
1360
+ * Control how a flat label looks
1361
+ */
1151
1362
  export type TFlatLabelAppearance = {
1152
1363
  /**
1153
1364
  * By default this is the upper bounds of the Polygon. If you don't have a Polygon, or want a custom height for some reason, you can set this.
@@ -1253,6 +1464,9 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1253
1464
  };
1254
1465
  /**
1255
1466
  * @deprecated
1467
+ *
1468
+ * Use {@link FlatLabels.add} or {@link FloatingLabels.add} to get more fine tuned control when labelling
1469
+ * all locations.
1256
1470
  */
1257
1471
  export type TLabelAllLocationFlatLabelOptions = TLabelAllLocationCommonOptions & {
1258
1472
  /**
@@ -1262,10 +1476,16 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1262
1476
  flatLabels: true;
1263
1477
  appearance?: TFlatLabelAppearance;
1264
1478
  };
1479
+ /**
1480
+ * Options for controlling bulk location labelling
1481
+ */
1265
1482
  export type TFloatingLabelAllLocationsOptions = TLabelAllLocationCommonOptions & {
1266
1483
  appearance?: TFloatingLabelAppearance;
1267
1484
  interactive?: boolean;
1268
1485
  };
1486
+ /**
1487
+ * Options for controlling bulk location labelling
1488
+ */
1269
1489
  export type TFlatLabelAllLocationsOptions = TLabelAllLocationCommonOptions & {
1270
1490
  appearance?: TFlatLabelAppearance;
1271
1491
  };
@@ -1309,6 +1529,9 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1309
1529
  */
1310
1530
  paths?: Path[];
1311
1531
  };
1532
+ /**
1533
+ * Arguments that get passed to listeners of an {@link E_SDK_EVENT}.
1534
+ */
1312
1535
  export type E_SDK_EVENT_PAYLOAD = {
1313
1536
  [E_SDK_EVENT.CLICK]: TMapClickEvent;
1314
1537
  [E_SDK_EVENT.STATE_CHANGE]: STATE;
@@ -1316,6 +1539,9 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1316
1539
  [E_SDK_EVENT.NOTHING_CLICKED]: undefined;
1317
1540
  [E_SDK_EVENT.MAP_CHANGED]: MappedinMap;
1318
1541
  };
1542
+ /**
1543
+ * Arguments that get passed to listeners of an {@link E_BLUEDOT_EVENT}.
1544
+ */
1319
1545
  export type E_BLUEDOT_EVENT_PAYLOAD = {
1320
1546
  /**
1321
1547
  * Emitted when the BlueDot position updates
@@ -1327,7 +1553,7 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1327
1553
  [E_BLUEDOT_EVENT.STATE_CHANGE]: TBlueDotStateChange;
1328
1554
  };
1329
1555
  /**
1330
- * @enum
1556
+ * Arguments that get passed to listeners of an {@link E_CAMERA_EVENT}.
1331
1557
  */
1332
1558
  export type CAMERA_EVENT_PAYLOAD = {
1333
1559
  [E_CAMERA_EVENT.USER_INTERACTION_START]: void;
@@ -1408,7 +1634,7 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.Marker' {
1408
1634
 
1409
1635
  declare module '@mappedin/mappedin-js/renderer/private/controllers/MarkersController' {
1410
1636
  import { MappedinCoordinate, MappedinNode } from '@mappedin/mappedin-js/get-venue';
1411
- import type { ICore, TCreateMarkerOptions, TAnimationOptions } from '@mappedin/mappedin-js/renderer/internal';
1637
+ import { ICore, TCreateMarkerOptions, TAnimationOptions } from '@mappedin/mappedin-js/renderer/internal';
1412
1638
  import { InternalMarker } from '@mappedin/mappedin-js/renderer/internal';
1413
1639
  import TWEEN from '@tweenjs/tween.js';
1414
1640
  /**
@@ -1614,34 +1840,93 @@ declare module '@mappedin/mappedin-js/renderer/public/api/FlatLabels' {
1614
1840
  import { MappedinPolygon } from '@mappedin/mappedin-js/get-venue';
1615
1841
  import FlatLabelsController from '@mappedin/mappedin-js/renderer/private/controllers/FlatLabelsController';
1616
1842
  import { TFlatLabelAllLocationsOptions, TAddFlatLabelOptions, TFlatLabelAppearance } from '@mappedin/mappedin-js/renderer/MapView.types';
1843
+ /**
1844
+ * API to add and remove flat labels on the map.
1845
+ */
1617
1846
  export interface IFlatLabels<T = void> {
1618
1847
  /**
1619
- * Adds a flat label to the polygons associated with all locations on the venue.
1848
+ * Add a flat label to the polygons associated with all locations on the venue.
1620
1849
  * The text is automatically determined based on location data.
1850
+ *
1851
+ * ```ts
1852
+ * // Draw red labels on all polygons with a location
1853
+ * mapView.FlatLabels.labelAllLocations({
1854
+ * appearance: {
1855
+ * color: 'red',
1856
+ * }
1857
+ * });
1858
+ * ```
1859
+ * @param options
1621
1860
  */
1622
1861
  labelAllLocations(options?: TFlatLabelAllLocationsOptions): T;
1623
1862
  /**
1624
- * Adds a flat label to a single polygon.
1863
+ * Add a flat label to a single polygon.
1864
+ *
1865
+ * ```ts
1866
+ * // Label the apple store with the label "Apple Store"
1867
+ * const location = mapView.venue.locations.find((l) => l.name === "Apple")!;
1868
+ * mapView.FlatLabels.add(location.polygons[0], "Apple Store");
1869
+ * ```
1870
+ *
1871
+ * @param polygon The {@link MappedinPolygon} to label.
1872
+ * @param text The text to display on the label.
1873
+ * @param options
1625
1874
  */
1626
1875
  add(polygon: MappedinPolygon, text: string, options?: TAddFlatLabelOptions): T;
1627
1876
  /**
1628
- * Removes a flat label from a single polygon.
1877
+ * Remove a flat label from a single polygon.
1878
+ *
1879
+ * ```ts
1880
+ * mapView.FlatLabels.add(polygon, "Label");
1881
+ *
1882
+ * ...
1883
+ *
1884
+ * // Remove the label currently on this polygon
1885
+ * mapView.FlatLabels.remove(polygon);
1886
+ * ```
1887
+ *
1888
+ * @param polygon The {@link MappedinPolygon} with a label to remove.
1629
1889
  */
1630
1890
  remove(polygon: MappedinPolygon): T;
1631
1891
  /**
1632
- * Removes all flat labels from the venue.
1892
+ * Remove all flat labels from the venue.
1893
+ *
1894
+ * ```ts
1895
+ * mapView.FlatLabels.add(polygon1, "Label 1");
1896
+ * mapView.FlatLabels.add(polygon2, "Label 2");
1897
+ *
1898
+ * ...
1899
+ *
1900
+ * // Remove all labels from all polygons
1901
+ * mapView.FlatLabels.removeAll();
1902
+ * ```
1633
1903
  */
1634
1904
  removeAll(): T;
1635
1905
  /**
1636
- * Updates the appearance attributes of an already-existing label. If the
1906
+ * Update the appearance attributes of an already-existing label. If the
1637
1907
  * provided polygon does not have a label already, this is a no-op.
1908
+ *
1909
+ * ```ts
1910
+ * mapView.FlatLabels.setAppearance(polygon, {
1911
+ * color: 'blue',
1912
+ * font: 'times',
1913
+ * });
1914
+ * ```
1915
+ *
1916
+ * @param polygon The {@link MappedinPolygon} with a label to update.
1917
+ * @param appearance The new {@link TFlatLabelAppearance} settings to apply to the polygon's label.
1638
1918
  */
1639
1919
  setAppearance(polygon: MappedinPolygon, appearance: TFlatLabelAppearance): T;
1640
1920
  /**
1641
- * Sets the hover text color for all Flat Labels.
1642
- * Expects color in hexadecimal string e.g. `#2e2e2e`
1921
+ * Set the hover text color for all Flat Labels. To set hover color for all polygons,
1922
+ * see {@link MapView.setHoverColor}.
1923
+ *
1924
+ * ```ts
1925
+ * // Make all flat labels turn red on hover
1926
+ * mapView.FlatLabels.setHoverColorForAll('#ff0000');
1927
+ * ```
1643
1928
  *
1644
- * To set hover color for all polygons, see {@link MapView.setHoverColor}.
1929
+ * @param color A hexidecimal string representing the hover color.
1645
1930
  */
1646
1931
  setHoverColorForAll(color: string): T;
1647
1932
  }
@@ -1664,37 +1949,117 @@ declare module '@mappedin/mappedin-js/renderer/public/api/FloatingLabels' {
1664
1949
  import { MappedinNode, MappedinPolygon } from '@mappedin/mappedin-js/get-venue';
1665
1950
  import { TAddFloatingLabelOptions, TFloatingLabelAllLocationsOptions, TFloatingLabelAppearance } from '@mappedin/mappedin-js/renderer/MapView.types';
1666
1951
  import FloatingLabelsController from '@mappedin/mappedin-js/renderer/private/controllers/FloatingLabelsController';
1952
+ /**
1953
+ * API to add and remove floating labels on the map.
1954
+ */
1667
1955
  export interface IFloatingLabels<T = void> {
1668
1956
  /**
1669
- * Adds a floating label to the polygons associated with all locations on the venue.
1670
- * The text is automatically determined based on location data.
1957
+ * Add a floating label to one entrance node of each polygons associated with all
1958
+ * locations on the venue. The text is automatically determined based on location data.
1959
+ *
1960
+ * ```ts
1961
+ * // Draw red labels with black outlines on an entrance node of all polygons with a location
1962
+ * mapView.FloatingLabels.labelAllLocations({
1963
+ * appearance: {
1964
+ * text: {
1965
+ * foregroundColor: 'red',
1966
+ * backgroundColor: 'black',
1967
+ * }
1968
+ * }
1969
+ * });
1970
+ * ```
1971
+ * @param options
1671
1972
  */
1672
1973
  labelAllLocations(options?: TFloatingLabelAllLocationsOptions): T;
1673
1974
  /**
1674
- * Adds a floating label to a single polygon or node.
1975
+ * Add a floating label to a single polygon or node. When labelling a polygon,
1976
+ * all entrance nodes of that polygon receive a label.
1977
+ *
1978
+ * ```ts
1979
+ * // Label the apple store with the label "Apple Store"
1980
+ * const location = mapView.venue.locations.find((l) => l.name === "Apple")!;
1981
+ * mapView.FloatingLabels.add(location.nodes[0], "Apple Store");
1982
+ * ```
1983
+ *
1984
+ * @param polygonOrNode The {@link MappedinPolygon} or {@link MappedinNode} to label.
1985
+ * @param text The text to display on the label.
1986
+ * @param options
1675
1987
  */
1676
1988
  add(polygonOrNode: MappedinPolygon | MappedinNode, text: string, options?: TAddFloatingLabelOptions): T;
1677
1989
  /**
1678
- * Updates the appearance of the label of a single polygon or node
1990
+ * Update the appearance attributes of an already-existing label. If the
1991
+ * provided polygon or node does not have a label already, this is a no-op.
1992
+ *
1993
+ * ```ts
1994
+ * mapView.FloatingLabels.setAppearance(node, {
1995
+ * text: {
1996
+ * size: 25,
1997
+ * }
1998
+ * });
1999
+ * ```
2000
+ *
2001
+ * @param polygonOrNode The {@link MappedinPolygon} or {@link MappedinNode} with a label to update.
2002
+ * @param appearance The new {@link TFlatLabelAppearance} settings to apply to the polygon's label.
1679
2003
  */
1680
2004
  setAppearance(polygonOrNode: MappedinPolygon | MappedinNode, appearance: TFloatingLabelAppearance): T;
1681
2005
  /**
1682
- * Removes a floating label from a single polygon or node.
2006
+ * Remove a floating label from a single polygon or node.
2007
+ *
2008
+ * ```ts
2009
+ * mapView.FloatingLabels.add(polygon, "Label");
2010
+ *
2011
+ * ...
2012
+ *
2013
+ * // Remove the label currently on this polygon's first entrance
2014
+ * mapView.FloatingLabels.remove(polygon.entrances[0]);
2015
+ * ```
2016
+ *
2017
+ * @param polygonOrNode The {@link MappedinPolygon} or {@link MappedinNode} with a label to remove.
1683
2018
  */
1684
2019
  remove(polygonOrNode: MappedinPolygon | MappedinNode): T;
1685
2020
  /**
1686
- * Removes all floating labels from the venue.
2021
+ * Remove all floating labels from the venue.
2022
+ *
2023
+ * ```ts
2024
+ * mapView.FloatingLabels.add(polygon, "Label 1");
2025
+ * mapView.FloatingLabels.add(node, "Label 2");
2026
+ *
2027
+ * ...
2028
+ *
2029
+ * // Remove all labels from all polygons
2030
+ * mapView.FloatingLabels.removeAll();
2031
+ * ```
1687
2032
  */
1688
2033
  removeAll(): T;
1689
2034
  /**
1690
2035
  * Updates the priority of an existing floating label (or labels, in the case
1691
2036
  * of a polygon). This controls whether it is preferred over other labels
1692
2037
  * during collisions.
2038
+ *
2039
+ * ```ts
2040
+ * // Polygon 1's label should always show above polygon 2's label
2041
+ * mapView.FloatingLabels.setPriority(polygon0, 0);
2042
+ * mapView.FloatingLabels.setPriority(polygon1, 1);
2043
+ * ```
2044
+ *
2045
+ * @param polygonOrNode The {@link MappedinPolygon} or {@link MappedinNode} with a label to update.
1693
2046
  */
1694
2047
  setPriority(polygonOrNode: MappedinPolygon | MappedinNode, priority: number): T;
1695
2048
  /**
1696
2049
  * Resets the priority of an existing floating label (or labels, in the case
1697
2050
  * of a polygon)
2051
+ *
2052
+ * ```ts
2053
+ * mapView.FloatingLabels.setPriority(polygon0, 0);
2054
+ * mapView.FloatingLabels.setPriority(polygon1, 1);
2055
+ *
2056
+ * ...
2057
+ *
2058
+ * // Labels should now behave as they did by default
2059
+ * mapView.FloatingLabels.resetPriority();
2060
+ * ```
2061
+ *
2062
+ * @param polygonOrNode The {@link MappedinPolygon} or {@link MappedinNode} with a label to update.
1698
2063
  */
1699
2064
  resetPriority(polygonOrNode: MappedinPolygon | MappedinNode): T;
1700
2065
  }
@@ -1717,6 +2082,9 @@ declare module '@mappedin/mappedin-js/renderer/public/api/FloatingLabels' {
1717
2082
  declare module '@mappedin/mappedin-js/renderer/public/api/Camera' {
1718
2083
  import { E_CAMERA_DIRECTION } from '@mappedin/mappedin-js/renderer/MapView.enums';
1719
2084
  import CameraController, { TCameraAnimationOptions, TCameraTargets, TCameraTransform, TFocusOnCameraOptions } from '@mappedin/mappedin-js/renderer/private/controllers/CameraController';
2085
+ /**
2086
+ * API to control and respond to the state of the camera within the scene.
2087
+ */
1720
2088
  export class Camera {
1721
2089
  #private;
1722
2090
  /**
@@ -1932,17 +2300,73 @@ declare module '@mappedin/mappedin-js/renderer/public/api/Camera' {
1932
2300
 
1933
2301
  declare module '@mappedin/mappedin-js/renderer/public/api/BlueDot' {
1934
2302
  import { BlueDotController, TEnableBlueDotOptions } from '@mappedin/mappedin-js/renderer/MapView.types';
2303
+ /**
2304
+ * API to enable and respond to user position updates.
2305
+ */
1935
2306
  export class BlueDot {
1936
2307
  #private;
2308
+ /**
2309
+ * @hidden
2310
+ */
1937
2311
  constructor(controller: BlueDotController);
2312
+ /**
2313
+ * Subscribe a function to be called when an {@link E_BLUEDOT_EVENT} is fired.
2314
+ *
2315
+ * ```ts
2316
+ * const blueDotChangeHandler = ({ map, nearestNode, position, bearing }) => {
2317
+ * // Do something with the new values
2318
+ * };
2319
+ * mapView.BlueDot.on(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);
2320
+ * ```
2321
+ *
2322
+ * @param eventName An {@link E_BLUEDOT_EVENT} that is fired when the blue dot changes.
2323
+ * @param fn A callback that gets called when the corresponding event is fired. The
2324
+ * callback will get passed an argument with a type that's one of {@link E_BLUEDOT_EVENT_PAYLOAD}.
2325
+ */
1938
2326
  on: BlueDotController['on'];
2327
+ /**
2328
+ * Unsubscribe a function that was previously subscribed with {@link on}.
2329
+ *
2330
+ * ```ts
2331
+ * mapView.BlueDot.on(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);
2332
+ *
2333
+ * ...
2334
+ *
2335
+ * // Something changed and I no longer want this event to fire
2336
+ * mapView.BlueDot.off(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);
2337
+ * ```
2338
+ *
2339
+ * @param eventName An {@link E_BLUEDOT_EVENT} that is fired when the blue dot changes.
2340
+ * @param fn A function that was previously passed to {@link on}. The function must
2341
+ * have the same reference as the function that was subscribed.
2342
+ */
1939
2343
  off: BlueDotController['off'];
1940
2344
  /**
1941
- * Enables Blue Dot. BlueDot then emits {@link TBlueDotStateChange} and {@link TBlueDotPositionUpdate} events via {@link E_BLUEDOT_EVENT}
2345
+ * Enables Blue Dot. A blue dot will appear on the map that responds to the device's geolocation
2346
+ * updates. It then emits {@link TBlueDotStateChange} and {@link TBlueDotPositionUpdate} events
2347
+ * via {@link E_BLUEDOT_EVENT}.
2348
+ *
2349
+ * ```ts
2350
+ * // Enable blue dot
2351
+ * mapView.BlueDot.enable();
2352
+ *
2353
+ * // Disable blue dot
2354
+ * mapView.BlueDot.disable();
2355
+ * ```
2356
+ *
2357
+ * @param options
1942
2358
  */
1943
2359
  enable(options?: TEnableBlueDotOptions): void;
1944
2360
  /**
1945
- * Disables Blue Dot and stops emitting events.
2361
+ * Disables Blue Dot that was enabled with {@link enable} and stops emitting events.
2362
+ *
2363
+ * ```ts
2364
+ * // Enable blue dot
2365
+ * mapView.BlueDot.enable();
2366
+ *
2367
+ * // Disable blue dot
2368
+ * mapView.BlueDot.disable();
2369
+ * ```
1946
2370
  */
1947
2371
  disable(): void;
1948
2372
  }
@@ -1953,38 +2377,95 @@ declare module '@mappedin/mappedin-js/renderer/public/api/Markers' {
1953
2377
  import { MappedinCoordinate, MappedinNode } from '@mappedin/mappedin-js/get-venue';
1954
2378
  import { TCreateMarkerOptions } from '@mappedin/mappedin-js/renderer/index.rn';
1955
2379
  import MarkersController, { Marker } from '@mappedin/mappedin-js/renderer/private/controllers/MarkersController';
2380
+ /**
2381
+ * API to control adding 2D markers to the scene.
2382
+ */
1956
2383
  export class Markers {
1957
2384
  #private;
2385
+ /**
2386
+ * @hidden
2387
+ */
1958
2388
  constructor(markersController: MarkersController);
2389
+ /**
2390
+ * An array of {@link Marker} instances that currently exist.
2391
+ */
1959
2392
  get markers(): Marker[];
1960
2393
  /**
1961
- * Create a new Marker, containing some HTML, at the specified position
1962
- * @param nodeOrCoordinate the position for the Marker
1963
- * @param contentHtml the content to show in the Marker
1964
- * @param options options for the display of the Marker
1965
- * @returns the Marker object that was created.
2394
+ * Create a new {@link Marker}, containing some HTML, at the specified position.
2395
+ *
2396
+ * ```ts
2397
+ * mapView.Markers.add(coordinate, `
2398
+ * <div
2399
+ * id="my-marker"
2400
+ * style="width:100px;height:40px;background:red;"
2401
+ * >
2402
+ * My Marker
2403
+ * </div>
2404
+ * `);
2405
+ * ```
2406
+ *
2407
+ * @param nodeOrCoordinate The {@link MappedinNode} or {@link MappedinCoordinate} to
2408
+ * which the marker is pinned.
2409
+ * @param contentHtml Stringified HTML content to render inside the Marker.
2410
+ * @param options
2411
+ * @returns The {@link Marker} object that was created.
1966
2412
  */
1967
2413
  add(nodeOrCoordinate: MappedinNode | MappedinCoordinate, contentHtml: string, options?: TCreateMarkerOptions): Marker;
1968
2414
  /**
1969
- * Moves a Marker to a new position instantaneously.
1970
- * @param markerOrMarkerId the Marker to move
1971
- * @param target the new position for this Marker
2415
+ * Moves an existing {@link Marker} to a new position instantaneously. See
2416
+ * also {@link animate}.
2417
+ *
2418
+ * ```ts
2419
+ * const marker = mapView.Markers.add(...);
2420
+ *
2421
+ * // Move the marker to a new coordinate
2422
+ * mapView.Markers.setPosition(marker, newCoordinate);
2423
+ * ```
2424
+ *
2425
+ * @param markerOrMarkerId The {@link Marker} to move.
2426
+ * @param target The {@link MappedinNode} or {@link MappedinCoordinate} to
2427
+ * which the marker should be moved.
1972
2428
  */
1973
2429
  setPosition(markerOrMarkerId: Marker | Marker['id'], target: MappedinNode | MappedinCoordinate): void;
1974
2430
  /**
1975
- * Moves a Marker to a new position over time.
1976
- * @param markerOrMarkerId the Marker to move
1977
- * @param target the new position for this Marker
1978
- * @param options the options for how this movement should be animated
2431
+ * Moves an existing {@link Marker} to a new position smoothly over time.
2432
+ *
2433
+ * ```ts
2434
+ * const marker = mapView.Markers.add(...);
2435
+ *
2436
+ * // Animate the marker to a new coordinate over 500ms
2437
+ * mapView.Markers.animate(marker, newCoordinate, {
2438
+ * duration: 500
2439
+ * });
2440
+ * ```
2441
+ *
2442
+ * @param markerOrMarkerId The {@link Marker} to move.
2443
+ * @param target The {@link MappedinNode} or {@link MappedinCoordinate} to
2444
+ * which the marker should be moved.
2445
+ * @param options
1979
2446
  */
1980
2447
  animate(markerOrMarkerId: Marker | Marker['id'], target: MappedinCoordinate | MappedinNode, options?: TAnimationOptions): Promise<void>;
1981
2448
  /**
1982
- * Removes a Marker.
1983
- * @param markerOrMarkerId the Marker to be removed
2449
+ * Removes an existing {@link Marker}.
2450
+ *
2451
+ * ```ts
2452
+ * const marker = mapView.Markers.add(...);
2453
+ *
2454
+ * ...
2455
+ *
2456
+ * // The marker is no longer needed
2457
+ * mapView.Markers.remove(marker);
2458
+ * ```
2459
+ *
2460
+ * @param markerOrMarkerId the {@link Marker} to be removed.
1984
2461
  */
1985
2462
  remove(markerOrMarkerId: Marker | Marker['id']): void;
1986
2463
  /**
1987
- * Remove all Markers from all maps.
2464
+ * Remove all {@link Marker} instances from all maps.
2465
+ *
2466
+ * ```ts
2467
+ * mapView.Markers.removeAll();
2468
+ * ```
1988
2469
  */
1989
2470
  removeAll(): void;
1990
2471
  }
@@ -1995,35 +2476,140 @@ declare module '@mappedin/mappedin-js/renderer/public/api/Paths' {
1995
2476
  import { TPathOptions } from '@mappedin/mappedin-js/renderer/index.rn';
1996
2477
  import PathsController, { Path } from '@mappedin/mappedin-js/renderer/private/controllers/PathsController';
1997
2478
  /**
1998
- * Add and remove paths from maps.
2479
+ * API to add and remove paths from maps. See also {@link Journey}.
1999
2480
  */
2000
2481
  export class Paths {
2001
2482
  #private;
2483
+ /**
2484
+ * @hidden
2485
+ */
2002
2486
  constructor(pathsController: PathsController);
2003
2487
  /**
2004
- * An array of all paths that are currently drawn.
2488
+ * An array of all {@link Path} instances that are currently drawn.
2005
2489
  */
2006
2490
  get paths(): Path[];
2007
2491
  /**
2008
- * Takes an array of nodes and draws path segments on each map for the nodes on that map.
2492
+ * Takes an array of {@link MappedinNode} instances and draws an {@link Path} with
2493
+ * path segments on each map corresponding to the nodes on that map.
2494
+ *
2495
+ * ```ts
2496
+ * const departure = mapView.venue.locations.find((l) => l.name === "Apple")!;
2497
+ * const destination = mapView.venue.locations.find((l) => l.name === "Cleo")!;
2498
+ * const directions = departure.directionsTo(destination);
2499
+ *
2500
+ * // Draw the above directions as a path on the map
2501
+ * mapView.Paths.add(directions.path);
2502
+ * ```
2009
2503
  *
2010
2504
  * @param nodes A {@link MappedinNode} array, probably from a {@link MappedinDirections} instance.
2011
- * @param options A optional {@link TPathOptions} object.
2505
+ * @param options
2012
2506
  */
2013
2507
  add(nodes: MappedinNode[], options?: TPathOptions): Path;
2014
2508
  /**
2015
- * Remove a path from all maps it exists on.
2509
+ * Remove a {@link Path} from all maps it exists on.
2510
+ *
2511
+ * ```ts
2512
+ * const path = mapView.Paths.add(nodes);
2513
+ *
2514
+ * ...
2515
+ *
2516
+ * // The path is no longer needed
2517
+ * mapView.Paths.remove(path);
2518
+ * ```
2016
2519
  *
2017
- * @param path A {@link Path} instance returned from {@link Paths.add}.
2520
+ * @param path The {@link Path} instance to be removed.
2018
2521
  */
2019
2522
  remove(path: Path): void;
2020
2523
  /**
2021
- * Remove all paths from all maps.
2524
+ * Remove all {@link Path} instances from all maps.
2022
2525
  */
2023
2526
  removeAll(): void;
2024
2527
  }
2025
2528
  }
2026
2529
 
2530
+ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.SmartTooltip' {
2531
+ import './Mappedin.SmartTooltip.scss';
2532
+ import { HTMLCollider, COLLISION_RANKING_TIERS } from '@mappedin/mappedin-js/renderer/internal';
2533
+ import type { IHTMLCollider, TColliderStrategy } from '@mappedin/mappedin-js/renderer/internal';
2534
+ import { Vector3 } from 'three';
2535
+ /**
2536
+ *
2537
+ * A Tooltip is an html element that attempts to orient itself around an anchor in 3D space. It will always maintain the same size on the screen, but will attempt to change its orientation based on other colliders in the scene.
2538
+ *
2539
+ * Make your own and add it directly to the map with {{#crossLink "MapView/createTooltip:method"}}{{/crossLink}}, or use the constructor and add it when you want.
2540
+ *
2541
+ * You will need to specify at least `options.position` and one of `options.html` and `options.selector` OR `options.contentHtml`.
2542
+ *
2543
+ *
2544
+ * @class Tooltip
2545
+ *
2546
+ * @constructor
2547
+ * @param options {Object} Passes on options (e.g. html, text, position, map, padding, defaultAnchorType, enabledAnchorTypes, collisionRank) to MapView.Tooltip's options argument.
2548
+ * @param [options.html] Pass in custom html for your marker, if using this method you must also pass in a selector for your content.
2549
+ * @param [options.selector] Used in conjuction with the html property to select the div for repositioning
2550
+ * @param [options.contentHtml] Use mappedin's default tooltip styling with custom inner html content
2551
+ * @param [options.text] Instead of passing html pass in plain text to be displayed in the tooltip
2552
+ * @param [options.position] should be something you got from {{#crossLink "MapView/getPositionPolygon:method"}}{{/crossLink}} or {{#crossLink "MapView/getPositionNode:method"}}{{/crossLink}}.
2553
+ * @param [options.map] The map ID where the tooltip should be displayed
2554
+ * @param [options.defaultAnchorType] The default orientation to place the tooltip.
2555
+ * @param [options.padding] The distance in pixel to offset the tooltip from the anchor point.
2556
+ * @param [options.enabledAnchorTypes] An object used to disable certain anchor positions from being used.
2557
+ * @param [options.collisionRank] The rank of the object used when comparing colliders to determine which should be shown.
2558
+ */
2559
+ export type TSmartTooltipOptions = {
2560
+ html?: string;
2561
+ contentHtml?: string;
2562
+ text?: string;
2563
+ position: Vector3;
2564
+ selector?: string;
2565
+ map: string;
2566
+ padding?: number;
2567
+ collisionRank?: COLLISION_RANKING_TIERS;
2568
+ defaultAnchorType?: string;
2569
+ enabledAnchorTypes?: {
2570
+ [type: string]: boolean;
2571
+ };
2572
+ };
2573
+ type TTooltipStyle = {
2574
+ top?: string;
2575
+ left?: string;
2576
+ };
2577
+ /**
2578
+ * An object that defines which anchors are enabled for a tooltip. An anchor is a direction, relative
2579
+ * to a position, where a tooltip may appear. For example, a tooltip with a `right` anchor will appear
2580
+ * to the right of its position.
2581
+ */
2582
+ export type TOOLTIP_ANCHOR = {
2583
+ top?: boolean;
2584
+ left?: boolean;
2585
+ topLeft?: boolean;
2586
+ right?: boolean;
2587
+ topRight?: boolean;
2588
+ bottom?: boolean;
2589
+ bottomLeft?: boolean;
2590
+ bottomRight?: boolean;
2591
+ };
2592
+ class SmartTooltip extends HTMLCollider implements IHTMLCollider {
2593
+ #private;
2594
+ className: string;
2595
+ _el: Element | null;
2596
+ style: TTooltipStyle;
2597
+ constructor(options: TSmartTooltipOptions);
2598
+ updateClassName: (className: any) => void;
2599
+ get strategies(): TColliderStrategy[];
2600
+ colliderDidMount(): void;
2601
+ /**
2602
+ * @internal
2603
+ */
2604
+ updateDimensionsImmediately(): void;
2605
+ setAction(action: any): void;
2606
+ colliderDidNotFindAHome(): void;
2607
+ colliderDidGoOffscreen(): void;
2608
+ colliderDidUpdateVisiblity(): void;
2609
+ }
2610
+ export default SmartTooltip;
2611
+ }
2612
+
2027
2613
  declare module '@mappedin/mappedin-js/renderer/MapView.enums' {
2028
2614
  export enum GEOLOCATION_STATUS {
2029
2615
  SUCCESS = 0
@@ -2107,6 +2693,9 @@ declare module '@mappedin/mappedin-js/renderer/MapView.enums' {
2107
2693
  */
2108
2694
  UNCERTAIN = 3
2109
2695
  }
2696
+ /**
2697
+ * @enum The state of the {@link MapView}.
2698
+ */
2110
2699
  export enum STATE {
2111
2700
  /**
2112
2701
  * The map is in exploration mode where the user controls the camera position.
@@ -2148,6 +2737,9 @@ declare module '@mappedin/mappedin-js/renderer/MapView.enums' {
2148
2737
  */
2149
2738
  MAP_CHANGED = "MAP_CHANGED"
2150
2739
  }
2740
+ /**
2741
+ * @enum
2742
+ */
2151
2743
  export enum E_BLUEDOT_EVENT {
2152
2744
  /**
2153
2745
  * Emitted when the BlueDot position changes
@@ -2477,84 +3069,6 @@ declare module '@mappedin/mappedin-js/renderer/bundle-asset-manager' {
2477
3069
  }
2478
3070
  }
2479
3071
 
2480
- declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.SmartTooltip' {
2481
- import './Mappedin.SmartTooltip.scss';
2482
- import { HTMLCollider, COLLISION_RANKING_TIERS } from '@mappedin/mappedin-js/renderer/internal';
2483
- import type { IHTMLCollider, TColliderStrategy } from '@mappedin/mappedin-js/renderer/internal';
2484
- import { Vector3 } from 'three';
2485
- /**
2486
- *
2487
- * A Tooltip is an html element that attempts to orient itself around an anchor in 3D space. It will always maintain the same size on the screen, but will attempt to change its orientation based on other colliders in the scene.
2488
- *
2489
- * Make your own and add it directly to the map with {{#crossLink "MapView/createTooltip:method"}}{{/crossLink}}, or use the constructor and add it when you want.
2490
- *
2491
- * You will need to specify at least `options.position` and one of `options.html` and `options.selector` OR `options.contentHtml`.
2492
- *
2493
- *
2494
- * @class Tooltip
2495
- *
2496
- * @constructor
2497
- * @param options {Object} Passes on options (e.g. html, text, position, map, padding, defaultAnchorType, enabledAnchorTypes, collisionRank) to MapView.Tooltip's options argument.
2498
- * @param [options.html] Pass in custom html for your marker, if using this method you must also pass in a selector for your content.
2499
- * @param [options.selector] Used in conjuction with the html property to select the div for repositioning
2500
- * @param [options.contentHtml] Use mappedin's default tooltip styling with custom inner html content
2501
- * @param [options.text] Instead of passing html pass in plain text to be displayed in the tooltip
2502
- * @param [options.position] should be something you got from {{#crossLink "MapView/getPositionPolygon:method"}}{{/crossLink}} or {{#crossLink "MapView/getPositionNode:method"}}{{/crossLink}}.
2503
- * @param [options.map] The map ID where the tooltip should be displayed
2504
- * @param [options.defaultAnchorType] The default orientation to place the tooltip.
2505
- * @param [options.padding] The distance in pixel to offset the tooltip from the anchor point.
2506
- * @param [options.enabledAnchorTypes] An object used to disable certain anchor positions from being used.
2507
- * @param [options.collisionRank] The rank of the object used when comparing colliders to determine which should be shown.
2508
- */
2509
- export type TSmartTooltipOptions = {
2510
- html?: string;
2511
- contentHtml?: string;
2512
- text?: string;
2513
- position: Vector3;
2514
- selector?: string;
2515
- map: string;
2516
- padding?: number;
2517
- collisionRank?: COLLISION_RANKING_TIERS;
2518
- defaultAnchorType?: string;
2519
- enabledAnchorTypes?: {
2520
- [type: string]: boolean;
2521
- };
2522
- };
2523
- type TTooltipStyle = {
2524
- top?: string;
2525
- left?: string;
2526
- };
2527
- export type TOOLTIP_ANCHOR = {
2528
- top?: boolean;
2529
- left?: boolean;
2530
- topLeft?: boolean;
2531
- right?: boolean;
2532
- topRight?: boolean;
2533
- bottom?: boolean;
2534
- bottomLeft?: boolean;
2535
- bottomRight?: boolean;
2536
- };
2537
- class SmartTooltip extends HTMLCollider implements IHTMLCollider {
2538
- #private;
2539
- className: string;
2540
- _el: Element | null;
2541
- style: TTooltipStyle;
2542
- constructor(options: TSmartTooltipOptions);
2543
- updateClassName: (className: any) => void;
2544
- get strategies(): TColliderStrategy[];
2545
- colliderDidMount(): void;
2546
- /**
2547
- * @internal
2548
- */
2549
- updateDimensionsImmediately(): void;
2550
- setAction(action: any): void;
2551
- colliderDidNotFindAHome(): void;
2552
- colliderDidGoOffscreen(): void;
2553
- colliderDidUpdateVisiblity(): void;
2554
- }
2555
- export default SmartTooltip;
2556
- }
2557
-
2558
3072
  declare module '@mappedin/mappedin-js/renderer/internal/pub-sub.typed' {
2559
3073
  export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD> {
2560
3074
  /**
@@ -2582,6 +3096,9 @@ declare module '@mappedin/mappedin-js/renderer/public/api/Journey' {
2582
3096
  import { JourneyController } from '@mappedin/mappedin-js/renderer/private/controllers/JourneyController';
2583
3097
  import { Path } from '@mappedin/mappedin-js/renderer/private/controllers/PathsController';
2584
3098
  import { ICore } from '@mappedin/mappedin-js/renderer/private/Core.interface';
3099
+ /**
3100
+ * API to control drawing a set of directions. See also {@link Paths}.
3101
+ */
2585
3102
  class Journey {
2586
3103
  #private;
2587
3104
  /**
@@ -2591,27 +3108,80 @@ declare module '@mappedin/mappedin-js/renderer/public/api/Journey' {
2591
3108
  /**
2592
3109
  * Draw a Journey based on directions. Example usage:
2593
3110
  *
2594
- * ```typescript
2595
- * const startLocation = venue.locations.find(location => location.name === "Cleo");
2596
- * const endLocation = venue.locations.find(location => location.name === "American Eagle");
3111
+ * ```ts
3112
+ * const startLocation = mapView.venue.locations.find(location => location.name === "Cleo");
3113
+ * const endLocation = mapView.venue.locations.find(location => location.name === "American Eagle");
2597
3114
  *
2598
3115
  * const directions = startLocation.directionsTo(endLocation);
2599
3116
  * mapView.Journey.draw(directions);
2600
3117
  * ```
2601
3118
  *
2602
- * Use options to set connection (such as elevators and escalators) HTML tooltip template, departure and destination marker templates, path style and polygon higlight color. If no options are set, sane defaults are used to draw markers, tooltips and polygon highlights.
3119
+ * Use options to set connection (such as elevators and escalators) HTML tooltip template,
3120
+ * departure and destination marker templates, path style and polygon higlight color. If
3121
+ * no options are set, sane defaults are used to draw markers, tooltips and polygon highlights.
3122
+ *
3123
+ * @param directions A single instance or an array of {@link MappedinDirections} used for the Journey.
3124
+ * @param options
2603
3125
  */
2604
3126
  draw(directions: MappedinDirections | MappedinDirections[], options?: TJourneyOptions): JourneyController;
2605
3127
  /**
2606
- * Set the step of a multipart Journey
3128
+ * Set the step of a multipart Journey. Requires {@link draw} to have been called with an array
3129
+ * of {@link MappedinDirections}. An active step receives different styling.
3130
+ *
3131
+ * ```ts
3132
+ * // A multi destination set of directions
3133
+ * const departure = mapView.venue.locations.find((l) => l.name === "Apple")!;
3134
+ * const destination1 = mapView.venue.locations.find((l) => l.name === "Cleo")!;
3135
+ * const destination2 = mapView.venue.locations.find((l) => l.name === "KFC")!;
3136
+ * const destinationSet = new MappedinDestinationSet([destination1, destination2]);
3137
+ * const directions = departure.directionsTo(destinationSet);
3138
+ *
3139
+ * // By default step 0 is active, meaning Apple to Cleo
3140
+ * mapView.Journey.draw(directions);
3141
+ *
3142
+ * // Activate the step of the Journey from Cleo to KFC
3143
+ * mapView.Journey.setStep(1);
3144
+ * ```
3145
+ *
3146
+ * @param step The step of the Journey to mark as active.
2607
3147
  */
2608
3148
  setStep(step: number): void;
2609
3149
  /**
2610
- * Set the step using a Path object
3150
+ * Set the step using a {@link Path} instance. Requires {@link draw} to have been called with an array
3151
+ * of {@link MappedinDirections}. An active step receives different styling. This is most commonly
3152
+ * used to activate a step when a path has been clicked.
3153
+ *
3154
+ * ```ts
3155
+ * // A multi destination set of directions
3156
+ * const departure = mapView.venue.locations.find((l) => l.name === "Apple")!;
3157
+ * const destination1 = mapView.venue.locations.find((l) => l.name === "Cleo")!;
3158
+ * const destination2 = mapView.venue.locations.find((l) => l.name === "KFC")!;
3159
+ * const destinationSet = new MappedinDestinationSet([destination1, destination2]);
3160
+ * const directions = departure.directionsTo(destinationSet);
3161
+ *
3162
+ * // Make sure that the paths are all interactive
3163
+ * mapView.Journey.draw(directions, {
3164
+ * pathOptions: { interactive: true },
3165
+ * inactivePathOptions: { interactive: true },
3166
+ * });
3167
+ *
3168
+ * // Listen for a path being clicked
3169
+ * mapView.on(E_SDK_EVENT.CLICK, ({ path }) => {
3170
+ * if (path != null) {
3171
+ * mapView.Journey.setStepByPath(path);
3172
+ * }
3173
+ * });
3174
+ * ```
3175
+ *
3176
+ * @param path A {@link Path} instance that corresponds to a step in the Journey.
2611
3177
  */
2612
3178
  setStepByPath(path: Path): void;
2613
3179
  /**
2614
- * Clear the current Journey
3180
+ * Clear the current Journey drawn by {@link draw}.
3181
+ *
3182
+ * ```ts
3183
+ * mapView.Journey.clear();
3184
+ * ```
2615
3185
  */
2616
3186
  clear(): void;
2617
3187
  }
@@ -2638,6 +3208,7 @@ declare module '@mappedin/mappedin-js/renderer' {
2638
3208
  export type { BlueDot } from '@mappedin/mappedin-js/renderer/public/api/BlueDot';
2639
3209
  export type { Markers } from '@mappedin/mappedin-js/renderer/public/api/Markers';
2640
3210
  export type { Paths } from '@mappedin/mappedin-js/renderer/public/api/Paths';
3211
+ export type { TOOLTIP_ANCHOR } from '@mappedin/mappedin-js/renderer/internal/Mappedin.SmartTooltip';
2641
3212
  export type TMappedinInitializeOutput = {
2642
3213
  mapView: MapView;
2643
3214
  venue: Mappedin;
@@ -2732,6 +3303,7 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
2732
3303
  useDraftData?: boolean;
2733
3304
  platformString?: string;
2734
3305
  emitAnalyticsEvents?: boolean;
3306
+ secure?: boolean;
2735
3307
  };
2736
3308
  export type TGetVenueOptionsInternal = {
2737
3309
  baseUrl?: string;
@@ -2743,6 +3315,13 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
2743
3315
  things?: any;
2744
3316
  headers?: any;
2745
3317
  };
3318
+ export type TVenueMetadata = {
3319
+ languages: {
3320
+ name: string;
3321
+ code: string;
3322
+ }[];
3323
+ hasSecureAssets: boolean;
3324
+ };
2746
3325
  export enum MAP_RENDER_MODE {
2747
3326
  /** Each polygon, its geometry and mesh are sent to the GPU every render frame.
2748
3327
  * This was the default rendering mode before 4.0.17
@@ -3631,6 +4210,11 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinVenue' {
3631
4210
  tzidOverride: string;
3632
4211
  utcOffset: string;
3633
4212
  website: string;
4213
+ secureContentStorage: boolean;
4214
+ languages: {
4215
+ name: string;
4216
+ code: string;
4217
+ }[];
3634
4218
  constructor(mappedin: Mappedin, data: any);
3635
4219
  get metadata(): any;
3636
4220
  set metadata(value: any);
@@ -4460,7 +5044,7 @@ declare module '@mappedin/mappedin-js/renderer/internal' {
4460
5044
  export { labelThemes } from '@mappedin/mappedin-js/renderer/MapView.types';
4461
5045
  export { GEOLOCATION_STATUS, COLLISION_RANKING_TIERS, E_BLUEDOT_STATE_REASON, E_BLUEDOT_STATE, E_BLUEDOT_MARKER_STATE, STATE, MARKER_ANCHOR, E_SDK_EVENT, E_BLUEDOT_EVENT, E_CAMERA_EVENT, E_CAMERA_DIRECTION, SAFE_AREA_INSET_TYPE, CAMERA_EASING_MODE, MAP_RENDER_MODE, ANIMATION_TWEENS, } from '@mappedin/mappedin-js/renderer/MapView.enums';
4462
5046
  export { default as RENDER } from '@mappedin/mappedin-js/renderer/internal/Mappedin.RenderTasks';
4463
- export { FrameUpdate, TaskScheduler } from '@mappedin/mappedin-js/get-venue/Mappedin.TaskScheduler';
5047
+ export { FrameUpdate, FrameTask, TaskScheduler } from '@mappedin/mappedin-js/get-venue/Mappedin.TaskScheduler';
4464
5048
  export { default as SceneManager } from '@mappedin/mappedin-js/renderer/MapView.SceneManager';
4465
5049
  export { PubSub } from '@mappedin/mappedin-js/renderer/internal/pub-sub.typed';
4466
5050
  export { default as MapObject } from '@mappedin/mappedin-js/renderer/internal/Mappedin.MapObject';
@@ -4475,8 +5059,8 @@ declare module '@mappedin/mappedin-js/renderer/internal' {
4475
5059
  RENDER = 2,
4476
5060
  RENDER_NOW = 3,
4477
5061
  UPDATE_FLIPPABLES = 4,
4478
- SET_MAP_START = 5,
4479
- SET_MAP = 6,
5062
+ SET_SCENE_START = 5,
5063
+ SET_SCENE = 6,
4480
5064
  CAMERA_MOVING = 7,
4481
5065
  SET_BLUE_DOT_SIZE_FROM_ZOOM = 8,
4482
5066
  PUBLISH_BLUE_DOT = 9,
@@ -4499,13 +5083,13 @@ declare module '@mappedin/mappedin-js/renderer/internal' {
4499
5083
  USER_HANDS_OFF = 26
4500
5084
  }
4501
5085
  export type INTERNAL_EVENT_PAYLOAD = {
4502
- [INTERNAL_EVENT.SET_MAP_START]: undefined;
5086
+ [INTERNAL_EVENT.SET_SCENE_START]: undefined;
4503
5087
  [INTERNAL_EVENT.ON_FIRST_MAP_LOADED]: undefined;
4504
5088
  [INTERNAL_EVENT.TEXTURE_LOADED]: Texture;
4505
5089
  [INTERNAL_EVENT.RENDER]: undefined;
4506
5090
  [INTERNAL_EVENT.RENDER_NOW]: undefined;
4507
5091
  [INTERNAL_EVENT.UPDATE_FLIPPABLES]: undefined | boolean;
4508
- [INTERNAL_EVENT.SET_MAP]: undefined;
5092
+ [INTERNAL_EVENT.SET_SCENE]: undefined;
4509
5093
  [INTERNAL_EVENT.CAMERA_MOVING]: any;
4510
5094
  [INTERNAL_EVENT.SET_BLUE_DOT_SIZE_FROM_ZOOM]: number;
4511
5095
  [INTERNAL_EVENT.PUBLISH_BLUE_DOT]: undefined;
@@ -4622,6 +5206,9 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.FloatingLabel'
4622
5206
  getCachedSymbol: (orientation: string, textAlign: TEXTALIGN, xCoordinate: number) => HTMLCanvasElement | OffscreenCanvas;
4623
5207
  draw: (context: CanvasRenderingContext2D) => void;
4624
5208
  }
5209
+ /**
5210
+ * Control how a floating label looks
5211
+ */
4625
5212
  export type TFloatingLabelAppearance = {
4626
5213
  /**
4627
5214
  * Margin around the label and marker. This will affect label density, with a mininum of 7px around
@@ -4967,7 +5554,7 @@ declare module '@mappedin/mappedin-js/navigator/Directive' {
4967
5554
  }
4968
5555
 
4969
5556
  declare module '@mappedin/mappedin-js/renderer/private/controllers/FlatLabelsController' {
4970
- import type { TAddFlatLabelOptions, TFlatLabelAllLocationsOptions, TFlatLabelAppearance, ICore } from '@mappedin/mappedin-js/renderer/internal';
5557
+ import { TAddFlatLabelOptions, TFlatLabelAllLocationsOptions, TFlatLabelAppearance, ICore } from '@mappedin/mappedin-js/renderer/internal';
4971
5558
  import { FlatLabel } from '@mappedin/mappedin-js/renderer/internal';
4972
5559
  import { MappedinPolygon } from '@mappedin/mappedin-js/get-venue';
4973
5560
  export type FlatLabelRenderObject = TAddFlatLabelOptions & {
@@ -5281,6 +5868,7 @@ declare module '@mappedin/mappedin-js/renderer/private/Core.interface' {
5281
5868
  cameraParameters: Vector2;
5282
5869
  resolution: Vector2;
5283
5870
  determineNewLabelSize: any;
5871
+ visibleMapsInCurrentScene: MappedinMap[];
5284
5872
  on<EVENT_NAME extends keyof INTERNAL_EVENT_PAYLOAD>(eventName: EVENT_NAME, fn: (payload: INTERNAL_EVENT_PAYLOAD[EVENT_NAME] extends {
5285
5873
  data: null;
5286
5874
  } ? INTERNAL_EVENT_PAYLOAD[EVENT_NAME]['data'] : INTERNAL_EVENT_PAYLOAD[EVENT_NAME]) => void): void;
@@ -5602,12 +6190,12 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.TaskScheduler' {
5602
6190
  * Arbitrary data that you can store along with this task.
5603
6191
  */
5604
6192
  constructor(options: {
5605
- userdata: Record<string, any>;
5606
- priority: number;
6193
+ userdata?: Record<string, any>;
6194
+ priority?: number;
5607
6195
  group?: FrameTaskGroup;
5608
- postponeOnAdd: number | boolean;
6196
+ postponeOnAdd?: number | boolean;
5609
6197
  name: string;
5610
- lastFrameTime: number;
6198
+ lastFrameTime?: number;
5611
6199
  callback: (...args: any[]) => any;
5612
6200
  });
5613
6201
  _postponed: number | boolean;
@@ -6115,6 +6703,7 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.MapObject' {
6115
6703
  _loaderPromise: null;
6116
6704
  _promiseResolve: null;
6117
6705
  hoverableMeshChildren: any[];
6706
+ visible: boolean;
6118
6707
  objectsDictionary: {};
6119
6708
  north: null;
6120
6709
  mapScale: null;
@@ -6185,7 +6774,6 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.MapObject' {
6185
6774
  getMapScale(): null;
6186
6775
  getNorth(): null;
6187
6776
  disableAllImageFlipping(): void;
6188
- get visible(): boolean;
6189
6777
  /**
6190
6778
  * Return true if this map has been loaded to the point where it can be
6191
6779
  * manipulated as a complete object. In synchronous mode, this requires all
@@ -7215,7 +7803,7 @@ declare module '@mappedin/mappedin-js/renderer/private/controllers/PolygonIntera
7215
7803
  }
7216
7804
 
7217
7805
  declare module '@mappedin/mappedin-js/renderer/private/controllers/TooltipsController' {
7218
- import type { ICore, TCreateTooltipCommonOptions, TCreateTooltipOptions } from '@mappedin/mappedin-js/renderer/internal';
7806
+ import { ICore, TCreateTooltipCommonOptions, TCreateTooltipOptions } from '@mappedin/mappedin-js/renderer/internal';
7219
7807
  import { MappedinNode, MappedinCoordinate } from '@mappedin/mappedin-js/get-venue';
7220
7808
  import { SmartTooltip } from '@mappedin/mappedin-js/renderer/internal';
7221
7809
  class TooltipsController {
@@ -7508,8 +8096,8 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.BinaryAssetMana
7508
8096
  declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.SmartCollisionEngine' {
7509
8097
  import './Mappedin.SmartCollisionEngine.scss';
7510
8098
  import { ICollider, TRange, TColliderPosition } from '@mappedin/mappedin-js/renderer/internal/Mappedin.SmartCollider';
7511
- import { MappedinMap } from '@mappedin/mappedin-js/renderer';
7512
- import { ICore } from '@mappedin/mappedin-js/renderer/private/Core.interface';
8099
+ import { MappedinMap } from '@mappedin/mappedin-js/get-venue';
8100
+ import type { ICore } from '@mappedin/mappedin-js/renderer/internal';
7513
8101
  import { Rectangle, QuadTree } from '@mappedin/mappedin-js/renderer/internal/quad-tree';
7514
8102
  export const COLLIDER_STRATEGY_LOW_PRIORITY = "LOW_PRIORITY";
7515
8103
  class SmartCollisionEngine {
@@ -10470,6 +11058,10 @@ declare module '@mappedin/mappedin-js/renderer/private/Core' {
10470
11058
  currentScale: number;
10471
11059
  rendererDomElement: HTMLCanvasElement;
10472
11060
  resolutionScale: number;
11061
+ /**
11062
+ * Get all maps that are "visible" in the scene.
11063
+ */
11064
+ get visibleMapsInCurrentScene(): any[];
10473
11065
  constructor(container: HTMLDivElement, venue: IMappedin, options: (TMapViewOptions & {
10474
11066
  onDataLoaded?: ((data: IMappedin) => void) | undefined;
10475
11067
  onFirstMapLoaded?: ((data: IMappedin) => void) | undefined;