@mapsindoors/react-native-maps-indoors-mapbox 2.10.0 → 2.12.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.
Files changed (60) hide show
  1. package/Package.swift +87 -0
  2. package/README.md +127 -1
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +24 -0
  5. package/index.ts +4 -233
  6. package/ios/core/MPDisplayRuleBridge.m +9 -0
  7. package/ios/core/MPDisplayRuleModule.swift +18 -0
  8. package/ios/core/MapsIndoorsModule.swift +12 -0
  9. package/ios/spm-bridges/include/MapsIndoorsBridges.h +1 -0
  10. package/package.json +8 -3
  11. package/react-native-maps-indoors-mapbox.podspec +9 -12
  12. package/specs/NativeMPDisplayRuleModule.ts +2 -0
  13. package/src/core/MPBuilding.ts +3 -2
  14. package/src/core/MPCameraEvent.ts +1 -1
  15. package/src/core/MPCameraEventListener.ts +1 -1
  16. package/src/core/MPCategory.ts +1 -1
  17. package/src/core/MPDirectionsRenderer.ts +1 -1
  18. package/src/core/MPDirectionsRendererOptions.ts +1 -1
  19. package/src/core/MPDirectionsService.ts +1 -1
  20. package/src/core/MPDisplayRule.ts +26 -1
  21. package/src/core/MPEntity.ts +1 -1
  22. package/src/core/MPEntityInfo.ts +1 -1
  23. package/src/core/MPFilter.ts +1 -1
  24. package/src/core/MPFilterBehavior.ts +1 -1
  25. package/src/core/MPFloor.ts +26 -1
  26. package/src/core/MPFloorSelectorInterface.ts +1 -1
  27. package/src/core/MPHighlightBehavior.ts +1 -1
  28. package/src/core/MPLocation.ts +1 -1
  29. package/src/core/MPMapConfig.ts +1 -1
  30. package/src/core/MPMultiPolygon.ts +1 -1
  31. package/src/core/MPPolygon.ts +1 -1
  32. package/src/core/MPPositionProviderInterface.ts +1 -1
  33. package/src/core/MPPositionResultInterface.ts +1 -1
  34. package/src/core/MPPropertyData.ts +1 -1
  35. package/src/core/MPQuery.ts +1 -1
  36. package/src/core/MPRoute.ts +1 -1
  37. package/src/core/MPRouteCoordinate.ts +1 -1
  38. package/src/core/MPRouteLeg.ts +1 -1
  39. package/src/core/MPRouteStep.ts +1 -1
  40. package/src/core/MPSelectionBehavior.ts +1 -1
  41. package/src/core/MPSettings3D.ts +1 -1
  42. package/src/core/MPSolution.ts +1 -1
  43. package/src/core/MPSolutionConfig.ts +43 -1
  44. package/src/core/MPSolutionDisplayRule.ts +1 -1
  45. package/src/core/MPUserRoleCollection.ts +1 -1
  46. package/src/core/MPUtils.ts +1 -1
  47. package/src/core/MPVenue.ts +1 -1
  48. package/src/core/MapControl.ts +1 -1
  49. package/src/core/MapsIndoors.ts +13 -15
  50. package/src/core/OnBuildingFoundAtCameraTargetListener.ts +1 -1
  51. package/src/core/OnFloorSelectionChangedListener.ts +1 -1
  52. package/src/core/OnLegSelectedListener.ts +1 -1
  53. package/src/core/OnLocationSelectedListener.ts +1 -1
  54. package/src/core/OnMapClickListener.ts +1 -1
  55. package/src/core/OnMarkerClickListener.ts +1 -1
  56. package/src/core/OnMarkerInfoWindowClickListener.ts +1 -1
  57. package/src/core/OnPositionUpdateListener.ts +1 -1
  58. package/src/core/OnVenueFoundAtCameraTargetListener.ts +1 -1
  59. package/src/core/index.ts +237 -0
  60. package/ios/.swift-format +0 -79
@@ -33,6 +33,8 @@ export interface Spec extends TurboModule {
33
33
  setIconSize(displayRuleId: string, size: string): Promise<null>;
34
34
  getIconScale(displayRuleId: string): Promise<number | null>;
35
35
  setIconScale(displayRuleId: string, scale: number): Promise<null>;
36
+ getIconZoomFactor(displayRuleId: string): Promise<number>;
37
+ setIconZoomFactor(displayRuleId: string, factor: number): Promise<null>;
36
38
  getIconPlacement(displayRuleId: string): Promise<number | null>;
37
39
  setIconPlacement(displayRuleId: string, placement: number): Promise<null>;
38
40
 
@@ -1,5 +1,5 @@
1
1
  import MPEntity from "./MPEntity";
2
- import { MPPoint, MPPolygon, MPFloor, MPBounds, MPDataField, MPPointParams, MPFloorParams } from "../../index";
2
+ import { MPPoint, MPPolygon, MPFloor, MPBounds, MPDataField, MPPointParams, MPFloorParams } from "./index";
3
3
  import MPBuildingInfo, { MPBuildingInfoParams } from "./MPBuildingInfo";
4
4
  import { Platform } from "react-native";
5
5
 
@@ -247,7 +247,8 @@ export default class MPBuilding extends MPEntity {
247
247
  "anchor": this.anchor.toJSON(),
248
248
  "buildingInfo": this.buildingInfo,
249
249
  "geometry": this.geometry,
250
- "floors": this._floors,
250
+ // JSON.stringify writes a Map as {}. Keys become strings, as the native SDKs send them.
251
+ "floors": Object.fromEntries(this._floors),
251
252
  "defaultFloor": this.defaultFloor,
252
253
  "address": this.address,
253
254
  "boundingBox": this.bounds.toJSON()
@@ -1,4 +1,4 @@
1
- import MPCameraEventListener from "../../index"
1
+ import MPCameraEventListener from "./index"
2
2
 
3
3
  /**
4
4
  * Possible events that a {@link MPCameraEventListener} can recieve.
@@ -1,4 +1,4 @@
1
- import { MPCameraEvent } from "../../index";
1
+ import { MPCameraEvent } from "./index";
2
2
 
3
3
  /**
4
4
  * Listens for camera events, eg. when the Camera starts or stops moving.
@@ -1,4 +1,4 @@
1
- import { MPDataField } from "../../index";
1
+ import { MPDataField } from "./index";
2
2
 
3
3
  /**
4
4
  * A category which contains a number of fields
@@ -1,5 +1,5 @@
1
1
  import { EmitterSubscription, NativeEventEmitter, NativeModules } from 'react-native';
2
- import { MPCameraViewFitMode, MPDirectionsRendererOptions, MPError, MPRoute, OnLegSelectedListener } from "../../index";
2
+ import { MPCameraViewFitMode, MPDirectionsRendererOptions, MPError, MPRoute, OnLegSelectedListener } from "./index";
3
3
  import { EventNames } from './EventNames';
4
4
  import { nativeRouteId } from './RouteHandles';
5
5
  import { RouteStopIconConfig } from './RouteStopIconConfig';
@@ -1,4 +1,4 @@
1
- import { MPLegBoundaryIcons, MPRouteAnimationType, MPRouteArrowStyle, MPRouteMarkerDisplayRule, MPRouteStampType, MPStrokeStyle } from "../../index";
1
+ import { MPLegBoundaryIcons, MPRouteAnimationType, MPRouteArrowStyle, MPRouteMarkerDisplayRule, MPRouteStampType, MPStrokeStyle } from "./index";
2
2
 
3
3
  /**
4
4
  * The styling and camera options for a route rendered by {@link MPDirectionsRenderer}.
@@ -1,5 +1,5 @@
1
1
  import { NativeModules } from 'react-native';
2
- import { MPError, MPPoint, MPRoute, MPHighway } from "../../index";
2
+ import { MPError, MPPoint, MPRoute, MPHighway } from "./index";
3
3
  import { attachNativeRoute } from './RouteHandles';
4
4
 
5
5
  const { DirectionsService } = NativeModules;
@@ -1,5 +1,5 @@
1
1
  import { NativeModules } from 'react-native';
2
- import { MPError, MPIconSize } from "../../index";
2
+ import { MPError, MPIconSize } from "./index";
3
3
  import { MPIconPlacement } from './MPIconPlacement';
4
4
  import { MPLabelType } from './MPLabelType';
5
5
  import { MPBadgePosition } from './MPBadgePosition';
@@ -1103,6 +1103,31 @@ export default class MPDisplayRule {
1103
1103
  });
1104
1104
  }
1105
1105
 
1106
+ /**
1107
+ * Get the factor the icon grows to across the solution's icon zoom range. Defaults to 1.
1108
+ * @returns Promise<number>
1109
+ */
1110
+ public async getIconZoomFactor(): Promise<number> {
1111
+ return DisplayRule.getIconZoomFactor(this.id).catch((err: Error) => {
1112
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1113
+ });
1114
+ }
1115
+
1116
+ /**
1117
+ * Set the factor the icon grows to across the solution's icon zoom range.
1118
+ * It must be finite and within 0 < factor <= 4; any other value is ignored with a warning.
1119
+ * @returns Promise<void>
1120
+ */
1121
+ public async setIconZoomFactor(factor: number): Promise<void> {
1122
+ if (!Number.isFinite(factor) || factor <= 0 || factor > 4) {
1123
+ console.warn(`MapsIndoors: ignoring iconZoomFactor ${factor}, must be finite and within 0 < factor <= 4`);
1124
+ return;
1125
+ }
1126
+ return DisplayRule.setIconZoomFactor(this.id, factor).catch((err: Error) => {
1127
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1128
+ });
1129
+ }
1130
+
1106
1131
  /**
1107
1132
  * Get the icon's anchor value.
1108
1133
  * @returns Promise<MPIconAnchor>
@@ -1,4 +1,4 @@
1
- import { MPPoint } from "../../index";
1
+ import { MPPoint } from "./index";
2
2
 
3
3
  /**
4
4
  * An interface describing trivial properties of a MapsIndoors geographical entities.
@@ -1,4 +1,4 @@
1
- import { MPDataField } from "../../index";
1
+ import { MPDataField } from "./index";
2
2
 
3
3
  /**
4
4
  * An interface describing base properties of entity info collections.
@@ -1,4 +1,4 @@
1
- import { MPBounds, MPLocation } from "../../index";
1
+ import { MPBounds, MPLocation } from "./index";
2
2
 
3
3
  /**
4
4
  * A filter that can be applied during search, this will limit the returned {@link MPEntity}s to those that
@@ -1,4 +1,4 @@
1
- import MapControl from "../../index";
1
+ import MapControl from "./index";
2
2
  import { Platform } from 'react-native';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import MPEntity from "./MPEntity";
2
- import { MPMultiPolygon, MPMultiPolygonParams, MPBounds, MPPoint, MPBuilding } from "../../index";
2
+ import { MPMultiPolygon, MPMultiPolygonParams, MPBounds, MPPoint, MPBuilding } from "./index";
3
3
  import { Platform } from "react-native";
4
4
 
5
5
  /**
@@ -119,6 +119,31 @@ export default class MPFloor extends MPEntity {
119
119
  return this.geometry!.bounds.center;
120
120
  }
121
121
 
122
+ /**
123
+ * Writes the floor in the shape the native SDKs send it.
124
+ *
125
+ * Omits `geometry` when it has no coordinates: iOS sends none for a floor whose backend geometry
126
+ * is a single Polygon (SPEX-1803), and decodes a present `geometry` strictly, so sending an empty
127
+ * one would fail the whole building. `entityBounds` carries the extent instead, as native sends it.
128
+ *
129
+ * @public
130
+ * @returns {object}
131
+ */
132
+ public toJSON(): object {
133
+ const bbox = this.geometry?.bbox;
134
+ const hasBounds = Array.isArray(bbox) && bbox.length === 4 && bbox.every(Number.isFinite);
135
+ return {
136
+ type: this.type,
137
+ id: this.id,
138
+ name: this.name,
139
+ ...(this.geometry?.coordinates ? { geometry: this.geometry } : {}),
140
+ aliases: this.aliases,
141
+ floorIndex: this.floorIndex,
142
+ buildingId: this.buildingId,
143
+ ...(hasBounds ? { entityBounds: this.geometry!.bounds.toJSON() } : {}),
144
+ };
145
+ }
146
+
122
147
  }
123
148
 
124
149
  /**
@@ -1,4 +1,4 @@
1
- import { MPFloor, OnFloorSelectionChangedListener } from "../../index";
1
+ import { MPFloor, OnFloorSelectionChangedListener } from "./index";
2
2
 
3
3
  /**
4
4
  * Interface used by MapsIndoors to communicate with floor selector UIs.
@@ -1,4 +1,4 @@
1
- import MapControl from "../../index";
1
+ import MapControl from "./index";
2
2
  import { Platform } from 'react-native';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { Platform } from "react-native";
2
- import { MPGeometry, MPPoint, MPPolygon, MPBuilding, MPVenue, MPMultiPolygon, MPBounds, MPLocationType, MPLocationPropertyNames } from "../../index";
2
+ import { MPGeometry, MPPoint, MPPolygon, MPBuilding, MPVenue, MPMultiPolygon, MPBounds, MPLocationType, MPLocationPropertyNames } from "./index";
3
3
  import MPEntity from "./MPEntity";
4
4
  import MPPropertyData from "./MPPropertyData";
5
5
  import MPLocationSettings from "./MPLocationSettings";
@@ -1,4 +1,4 @@
1
- import { MPFloorSelectorInterface, MapControl } from "../../index";
1
+ import { MPFloorSelectorInterface, MapControl } from "./index";
2
2
 
3
3
  /**
4
4
  * This configuration object is used when creating a new {@link MapControl} instance.
@@ -1,4 +1,4 @@
1
- import { MPPoint, MPGeometry, MPPolygon, MPBounds } from "../../index";
1
+ import { MPPoint, MPGeometry, MPPolygon, MPBounds } from "./index";
2
2
  import MPUtils from "./MPUtils";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { MPPoint, MPGeometry, MPBounds } from "../../index";
1
+ import { MPPoint, MPGeometry, MPBounds } from "./index";
2
2
  import MPUtils from "./MPUtils";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { OnPositionUpdateListener, MPPositionResultInterface } from "../../index";
1
+ import { OnPositionUpdateListener, MPPositionResultInterface } from "./index";
2
2
 
3
3
  /**
4
4
  * Interface for added a position provider to the SDK.
@@ -1,4 +1,4 @@
1
- import { MPPoint } from "../../index";
1
+ import { MPPoint } from "./index";
2
2
 
3
3
  /**
4
4
  * Interface to deliver a position result to the MapsIndoors SDK.
@@ -1,5 +1,5 @@
1
1
  import { Platform } from "react-native";
2
- import { MPPoint, MPDataField, MPPointParams } from "../../index";
2
+ import { MPPoint, MPDataField, MPPointParams } from "./index";
3
3
  import { MPEntityInfo } from "./MPEntityInfo";
4
4
  import MPLocationSettings from "./MPLocationSettings";
5
5
  import { MPAdditionalDetail } from "./MPAdditionalDetail";
@@ -1,4 +1,4 @@
1
- import { MPPoint, MPLocationPropertyNames } from "../../index";
1
+ import { MPPoint, MPLocationPropertyNames } from "./index";
2
2
 
3
3
  /**
4
4
  * A collection of query parameters used to query entities in MapsIndoors.
@@ -1,4 +1,4 @@
1
- import { MPBounds, MPRouteLeg, MPBoundsParams, MPRouteLegParams } from "../../index";
1
+ import { MPBounds, MPRouteLeg, MPBoundsParams, MPRouteLegParams } from "./index";
2
2
 
3
3
  /**
4
4
  * A route from a origin to a destination broken up into {@link legs}.
@@ -1,4 +1,4 @@
1
- import MPRouteStep from "../../index";
1
+ import MPRouteStep from "./index";
2
2
 
3
3
  /**
4
4
  * A coordinate used for routing, it is contained within a {@link MPRouteStep}.
@@ -1,4 +1,4 @@
1
- import { MPRouteStep, MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams, MPRoute } from "../../index";
1
+ import { MPRouteStep, MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams, MPRoute } from "./index";
2
2
 
3
3
  /**
4
4
  * A leg of a {@link MPRoute} is defined as all steps between any context shifts (entering/exiting buildings, changing floors).
@@ -1,5 +1,5 @@
1
1
  import { Platform } from "react-native";
2
- import { MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams } from "../../index";
2
+ import { MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams } from "./index";
3
3
 
4
4
  /**
5
5
  * Description placeholder.
@@ -1,4 +1,4 @@
1
- import MapControl from "../../index";
1
+ import MapControl from "./index";
2
2
  import { Platform } from 'react-native';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import MPUtils from "./MPUtils";
2
- import { MPSolutionConfig } from "../../index"
2
+ import { MPSolutionConfig } from "./index"
3
3
 
4
4
  /**
5
5
  * A configuration object that governs layer settings for 3D features.
@@ -1,4 +1,4 @@
1
- import { MPSolutionConfig } from "../../index";
1
+ import { MPSolutionConfig } from "./index";
2
2
  import { resolveLanguageTag } from "./MPLanguageTag";
3
3
  import MPPOIType from "./MPPOIType";
4
4
  import MPUtils from "./MPUtils";
@@ -1,4 +1,4 @@
1
- import { MPCollisionHandling, MPSettings3D } from "../../index";
1
+ import { MPCollisionHandling, MPSettings3D } from "./index";
2
2
  import MPLocationSettings from "./MPLocationSettings";
3
3
  import MPUtils from "./MPUtils";
4
4
 
@@ -26,6 +26,8 @@ export default class MPSolutionConfig {
26
26
  * @param {?MPCollisionHandling} [_mpCollisionHandling]
27
27
  * @param {?boolean} [_isNewSelection]
28
28
  * @param {?number} [_automatedZoomLimit]
29
+ * @param {?number} [_iconScaleZoomFrom]
30
+ * @param {?number} [_iconScaleZoomTo]
29
31
  */
30
32
  private constructor(
31
33
  public readonly id: string,
@@ -35,6 +37,8 @@ export default class MPSolutionConfig {
35
37
  private _mpCollisionHandling?: MPCollisionHandling,
36
38
  private _isNewSelection?: boolean,
37
39
  private _automatedZoomLimit?: number,
40
+ private _iconScaleZoomFrom?: number,
41
+ private _iconScaleZoomTo?: number,
38
42
  ) { }
39
43
 
40
44
 
@@ -55,6 +59,8 @@ export default class MPSolutionConfig {
55
59
  object?.collisionHandling,
56
60
  object?.isNewSelection,
57
61
  object?.automatedZoomLimit,
62
+ object?.iconScaleZoomFrom,
63
+ object?.iconScaleZoomTo,
58
64
  );
59
65
  }
60
66
 
@@ -131,6 +137,28 @@ export default class MPSolutionConfig {
131
137
  public set selectable(selectable: boolean | undefined) {
132
138
  this.locationSettings.selectable = selectable;
133
139
  }
140
+
141
+ /**
142
+ * Get the MapsIndoors zoom where icons start to grow towards their display rule's icon zoom
143
+ * factor, as the solution stores it. Undefined when not set.
144
+ *
145
+ * @public
146
+ * @type {number | undefined}
147
+ */
148
+ public get iconScaleZoomFrom(): number | undefined {
149
+ return this._iconScaleZoomFrom;
150
+ }
151
+
152
+ /**
153
+ * Get the MapsIndoors zoom where icons reach their display rule's icon zoom factor, as the
154
+ * solution stores it. Undefined when not set.
155
+ *
156
+ * @public
157
+ * @type {number | undefined}
158
+ */
159
+ public get iconScaleZoomTo(): number | undefined {
160
+ return this._iconScaleZoomTo;
161
+ }
134
162
  }
135
163
 
136
164
  /**
@@ -185,4 +213,18 @@ export interface MPSolutionConfigParams {
185
213
  * @type {number}
186
214
  */
187
215
  automatedZoomLimit?: number,
216
+
217
+ /**
218
+ * Start of the icon zoom range
219
+ *
220
+ * @type {?number}
221
+ */
222
+ iconScaleZoomFrom?: number,
223
+
224
+ /**
225
+ * End of the icon zoom range
226
+ *
227
+ * @type {?number}
228
+ */
229
+ iconScaleZoomTo?: number,
188
230
  }
@@ -1,4 +1,4 @@
1
- import { MPDisplayRule } from "../../index";
1
+ import { MPDisplayRule } from "./index";
2
2
 
3
3
  /**
4
4
  * Special {@link MPDisplayRule}s that govern specific scenarios
@@ -1,5 +1,5 @@
1
1
  import MPCollection from "./MPCollection";
2
- import MapsIndoors, {MPUserRole} from "../../index";
2
+ import MapsIndoors, {MPUserRole} from "./index";
3
3
 
4
4
  /**
5
5
  * A collection of user role objects fetched from {@link MapsIndoors}. Uses {@link MPUserRole.id} as key.
@@ -1,5 +1,5 @@
1
1
  import { NativeModules } from 'react-native';
2
- import { MPGeometry, MPPoint, MPCollisionHandling } from '../../index';
2
+ import { MPGeometry, MPPoint, MPCollisionHandling } from './index';
3
3
  const { UtilsModule } = NativeModules;
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Platform } from "react-native";
2
- import { MPPoint, MPPointParams, MPBounds, MPMapStyle, MPPolygon, MPVenueInfo, MPDataField, MPBuilding, MPLocation } from '../../index';
2
+ import { MPPoint, MPPointParams, MPBounds, MPMapStyle, MPPolygon, MPVenueInfo, MPDataField, MPBuilding, MPLocation } from './index';
3
3
  import MPEntity from "./MPEntity";
4
4
  import MPUtils from "./MPUtils";
5
5
 
@@ -7,7 +7,7 @@ import {
7
7
  OnVenueFoundAtCameraTargetListener, OnBuildingFoundAtCameraTargetListener,
8
8
  OnMarkerClickListener, OnMarkerInfoWindowClickListener,
9
9
  OnLiveLocationUpdateListener, MPCameraEvent, MPMapStyle, MPCameraUpdate, MPCameraPosition, MPEntity,
10
- } from "../../index"
10
+ } from "./index"
11
11
  import { EventNames } from './EventNames';
12
12
  import MPHighlightBehavior from './MPHighlightBehavior';
13
13
  import { MPSelectionMode } from './MPSelectionMode';
@@ -4,7 +4,7 @@ import {
4
4
  MPLocation, MPSolution, MPVenue, MPQuery, MPFilter,
5
5
  MPDisplayRule, MPSolutionDisplayRule, MPPositionProviderInterface,
6
6
  MPPositionResultInterface, MPUserRole, MPError, MPCategoryCollection, MPUserRoleCollection
7
- } from "../../index";
7
+ } from "./index";
8
8
  import MPBuildingCollection from './MPBuildingCollection';
9
9
  import MPVenueCollection from './MPVenueCollection';
10
10
  import { EventNames } from './EventNames';
@@ -14,21 +14,20 @@ import { OnBaseMapCacheProgressListener } from './OnBaseMapCacheProgressListener
14
14
  const { MapsIndoorsModule } = NativeModules;
15
15
 
16
16
  /**
17
- * The published version of the map package this file is bundled into, read from its own
18
- * package.json rather than kept as a constant so it cannot drift from the released version.
17
+ * The published version of the map package this core is bundled into. The map package sets it from
18
+ * its own package.json (see its index.ts): the core is shared, so it cannot know which package or
19
+ * version it ships in.
19
20
  *
20
21
  * It is sent on {@link MapsIndoors.load} so the native side can name this wrapper as the component
21
22
  * behind the MapsIndoors Insights session. The SDK snapshots the component when the session starts,
22
23
  * inside the native load, so the version has to travel on the load call itself.
23
24
  */
24
- const sdkVersion: string = (() => {
25
- try {
26
- // Resolved relative to this file inside the installed package: <package root>/package.json.
27
- return require('../../package.json').version ?? 'unknown';
28
- } catch (e) {
29
- return 'unknown';
30
- }
31
- })();
25
+ let sdkVersion = 'unknown';
26
+
27
+ /** @internal Called once by the map package's index.ts. */
28
+ export function setSdkVersion(version: string | undefined): void {
29
+ sdkVersion = version ?? 'unknown';
30
+ }
32
31
 
33
32
  /**
34
33
  * Main class for accessing data in the MapsIndoors SDK.
@@ -700,10 +699,9 @@ export default class MapsIndoors {
700
699
  * This runs independently of {@link synchronizeContent} and {@link cacheData}, which cache the
701
700
  * MapsIndoors content itself. Both are needed for a fully offline map.
702
701
  *
703
- * On iOS, a {@link MapView} has to have been mounted at least once first: the iOS SDK registers
704
- * its base-map cache when it builds the map provider, and until then this rejects with
705
- * {@link MPError.baseMapCachingNotSupported} even on Mapbox. Android has no such ordering
706
- * requirement.
702
+ * Works before any {@link MapView} exists, so tiles can be cached ahead of the first map. On
703
+ * iOS, until `MapControl.create` has run this caches the MapsIndoors Mapbox style, so an app
704
+ * rendering its own style should call `MapControl.create` before syncing.
707
705
  *
708
706
  * Run one call at a time. Progress arrives on a single channel carrying only the fraction, with
709
707
  * nothing identifying the call, so two overlapping calls interleave their progress - including
@@ -1,4 +1,4 @@
1
- import { MPBuilding } from '../../index';
1
+ import { MPBuilding } from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when focus changes to a new building within the camera bounds.
@@ -1,4 +1,4 @@
1
- import { MPFloor } from '../../index';
1
+ import { MPFloor } from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when the active floor is changed.
@@ -1,4 +1,4 @@
1
- import {MPRouteLeg} from '../../index';
1
+ import {MPRouteLeg} from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked during directions when a {@link MPRouteLeg} is selected.
@@ -1,4 +1,4 @@
1
- import { MPLocation } from '../../index';
1
+ import { MPLocation } from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when a {@link MPLocation} is selected.
@@ -1,4 +1,4 @@
1
- import { MPPoint, MPLocation } from '../../index';
1
+ import { MPPoint, MPLocation } from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when the map is clicked.
@@ -1,4 +1,4 @@
1
- import { MPLocation } from '../../index';
1
+ import { MPLocation } from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when a {@link MPLocation} marker is clicked on the map.
@@ -1,4 +1,4 @@
1
- import { MPLocation } from '../../index';
1
+ import { MPLocation } from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when a markers infowindow is clicked.
@@ -1,4 +1,4 @@
1
- import { MPPositionResultInterface } from '../../index';
1
+ import { MPPositionResultInterface } from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when user positioning is updated.
@@ -1,4 +1,4 @@
1
- import { MPVenue } from '../../index';
1
+ import { MPVenue } from './index';
2
2
 
3
3
  /**
4
4
  * Listener that is invoked when focus changes to a new venue within the camera bounds.