@mapsindoors/react-native-maps-indoors-mapbox 2.6.1 → 2.6.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +322 -0
  2. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +166 -0
  3. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +1699 -0
  4. package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +761 -0
  5. package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +410 -0
  6. package/android/src/main/java/com/mapsindoorsrn/core/RCMapView.java +16 -0
  7. package/android/src/main/java/com/mapsindoorsrn/core/README.md +3 -0
  8. package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +227 -0
  9. package/android/src/main/java/com/mapsindoorsrn/core/models/BitmapStopIconConfig.java +22 -0
  10. package/android/src/main/java/com/mapsindoorsrn/core/models/Bounds.java +19 -0
  11. package/android/src/main/java/com/mapsindoorsrn/core/models/Filter.java +77 -0
  12. package/android/src/main/java/com/mapsindoorsrn/core/models/Location.java +17 -0
  13. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraPosition.java +34 -0
  14. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraUpdate.java +68 -0
  15. package/android/src/main/java/com/mapsindoorsrn/core/models/MPError.java +38 -0
  16. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionProvider.java +46 -0
  17. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionResult.java +117 -0
  18. package/android/src/main/java/com/mapsindoorsrn/core/models/Query.java +30 -0
  19. package/android/src/main/java/com/mapsindoorsrn/core/models/RouteStopIconConfigModel.java +35 -0
  20. package/ios/core/CameraPosition.swift +15 -0
  21. package/ios/core/CameraUpdate.swift +19 -0
  22. package/ios/core/CameraUpdateError.swift +11 -0
  23. package/ios/core/DirectionsRendererBridge.m +59 -0
  24. package/ios/core/DirectionsRendererModule.swift +359 -0
  25. package/ios/core/DirectionsServiceBridge.m +55 -0
  26. package/ios/core/DirectionsServiceModule.swift +186 -0
  27. package/ios/core/IconStopUrl.swift +17 -0
  28. package/ios/core/LabelGraphic.swift +15 -0
  29. package/ios/core/MPDisplayRuleBridge.m +696 -0
  30. package/ios/core/MPDisplayRuleModule.swift +1704 -0
  31. package/ios/core/MapControlBridge.m +213 -0
  32. package/ios/core/MapControlModule.swift +702 -0
  33. package/ios/core/MapsIndoorsBridge.m +128 -0
  34. package/ios/core/MapsIndoorsData.swift +288 -0
  35. package/ios/core/MapsIndoorsModule.swift +363 -0
  36. package/ios/core/RCMapView.swift +16 -0
  37. package/ios/core/README.md +3 -0
  38. package/ios/core/ReactPositionProvider.swift +27 -0
  39. package/ios/core/RouteIcon.swift +34 -0
  40. package/ios/core/UtilsBridge.m +73 -0
  41. package/ios/core/UtilsModule.swift +182 -0
  42. package/ios/core/helpers.swift +57 -0
  43. package/package.json +1 -1
  44. package/src/core/EventNames.ts +21 -0
  45. package/src/core/MPAdditionalDetail.ts +102 -0
  46. package/src/core/MPBadgePosition.ts +12 -0
  47. package/src/core/MPBounds.ts +155 -0
  48. package/src/core/MPBuilding.ts +333 -0
  49. package/src/core/MPBuildingCollection.ts +57 -0
  50. package/src/core/MPBuildingInfo.ts +63 -0
  51. package/src/core/MPCameraEvent.ts +17 -0
  52. package/src/core/MPCameraEventListener.ts +17 -0
  53. package/src/core/MPCameraPosition.ts +82 -0
  54. package/src/core/MPCameraUpdate.ts +174 -0
  55. package/src/core/MPCameraViewFitMode.ts +25 -0
  56. package/src/core/MPCategory.ts +85 -0
  57. package/src/core/MPCategoryCollection.ts +62 -0
  58. package/src/core/MPCollection.ts +59 -0
  59. package/src/core/MPCollisionHandling.ts +12 -0
  60. package/src/core/MPDailyOpeningHours.ts +67 -0
  61. package/src/core/MPDataField.ts +69 -0
  62. package/src/core/MPDetailType.ts +73 -0
  63. package/src/core/MPDirectionsRenderer.ts +238 -0
  64. package/src/core/MPDirectionsService.ts +152 -0
  65. package/src/core/MPDisplayRule.ts +1823 -0
  66. package/src/core/MPEntity.ts +60 -0
  67. package/src/core/MPEntityInfo.ts +28 -0
  68. package/src/core/MPError.ts +122 -0
  69. package/src/core/MPFeatureTypes.ts +8 -0
  70. package/src/core/MPFilter.ts +168 -0
  71. package/src/core/MPFilterBehavior.ts +115 -0
  72. package/src/core/MPFloor.ts +170 -0
  73. package/src/core/MPFloorSelectorInterface.ts +63 -0
  74. package/src/core/MPGeometry.ts +91 -0
  75. package/src/core/MPHighlightBehavior.ts +115 -0
  76. package/src/core/MPHighway.ts +14 -0
  77. package/src/core/MPIconPlacement.ts +13 -0
  78. package/src/core/MPIconSize.ts +39 -0
  79. package/src/core/MPLabelGraphic.ts +24 -0
  80. package/src/core/MPLabelPosition.ts +12 -0
  81. package/src/core/MPLabelType.ts +11 -0
  82. package/src/core/MPLocation.ts +440 -0
  83. package/src/core/MPLocationPropertyNames.ts +30 -0
  84. package/src/core/MPLocationSettings.ts +40 -0
  85. package/src/core/MPLocationType.ts +16 -0
  86. package/src/core/MPMapConfig.ts +280 -0
  87. package/src/core/MPMapStyle.ts +57 -0
  88. package/src/core/MPMultiPolygon.ts +218 -0
  89. package/src/core/MPOpeningHours.ts +48 -0
  90. package/src/core/MPPOIType.ts +43 -0
  91. package/src/core/MPPoint.ts +169 -0
  92. package/src/core/MPPolygon.ts +219 -0
  93. package/src/core/MPPositionProviderInterface.ts +45 -0
  94. package/src/core/MPPositionResultInterface.ts +42 -0
  95. package/src/core/MPPropertyData.ts +234 -0
  96. package/src/core/MPQuery.ts +69 -0
  97. package/src/core/MPRoute.ts +105 -0
  98. package/src/core/MPRouteCoordinate.ts +95 -0
  99. package/src/core/MPRouteLeg.ts +158 -0
  100. package/src/core/MPRouteProperty.ts +83 -0
  101. package/src/core/MPRouteStep.ts +186 -0
  102. package/src/core/MPRouteStopIconConfig.ts +82 -0
  103. package/src/core/MPSelectionBehavior.ts +114 -0
  104. package/src/core/MPSelectionMode.ts +4 -0
  105. package/src/core/MPSettings3D.ts +107 -0
  106. package/src/core/MPSize.ts +21 -0
  107. package/src/core/MPSolution.ts +189 -0
  108. package/src/core/MPSolutionConfig.ts +188 -0
  109. package/src/core/MPSolutionDisplayRule.ts +15 -0
  110. package/src/core/MPUserRole.ts +60 -0
  111. package/src/core/MPUserRoleCollection.ts +37 -0
  112. package/src/core/MPUtils.ts +178 -0
  113. package/src/core/MPVenue.ts +294 -0
  114. package/src/core/MPVenueCollection.ts +58 -0
  115. package/src/core/MPVenueInfo.ts +62 -0
  116. package/src/core/MPWeeklyOpeningHours.ts +129 -0
  117. package/src/core/MapControl.ts +961 -0
  118. package/src/core/MapView.tsx +34 -0
  119. package/src/core/MapsIndoors.ts +571 -0
  120. package/src/core/OnBuildingFoundAtCameraTargetListener.ts +17 -0
  121. package/src/core/OnFloorSelectionChangedListener.ts +17 -0
  122. package/src/core/OnFloorUpdateListener.ts +16 -0
  123. package/src/core/OnLegSelectedListener.ts +17 -0
  124. package/src/core/OnLiveLocationUpdateListener.ts +17 -0
  125. package/src/core/OnLocationSelectedListener.ts +17 -0
  126. package/src/core/OnMapClickListener.ts +20 -0
  127. package/src/core/OnMarkerClickListener.ts +17 -0
  128. package/src/core/OnMarkerInfoWindowClickListener.ts +17 -0
  129. package/src/core/OnPositionUpdateListener.ts +17 -0
  130. package/src/core/OnVenueFoundAtCameraTargetListener.ts +17 -0
  131. package/src/core/README.md +3 -0
  132. package/src/core/RouteStopIconConfig.ts +10 -0
@@ -0,0 +1,63 @@
1
+ import { MPFloor, OnFloorSelectionChangedListener } from "../../index";
2
+
3
+ /**
4
+ * Interface used by MapsIndoors to communicate with floor selector UIs.
5
+ *
6
+ * @export
7
+ * @interface MPFloorSelectorInterface
8
+ * @typedef {MPFloorSelectorInterface}
9
+ */
10
+ export interface MPFloorSelectorInterface {
11
+ /**
12
+ * Update the floors shown in the selector.
13
+ *
14
+ * @param {(Array<MPFloor> | undefined)} floors
15
+ */
16
+ setFloors(floors: Array<MPFloor> | undefined): void;
17
+ /**
18
+ * NB: This is used internally in the SDK, overwriting the listener will result in functionality loss.
19
+ *
20
+ * Set a listener that listens for when a floor is selected in the floor selector.
21
+ *
22
+ * @param {OnFloorSelectionChangedListener} listener
23
+ */
24
+ setOnFloorSelectionChangedListener(listener: OnFloorSelectionChangedListener): void;
25
+ /**
26
+ * Show/Hide the floor selector, this is called when a building comes into/out of view.
27
+ *
28
+ * @param {boolean} show
29
+ * @param {boolean} animated
30
+ */
31
+ show(show: boolean, animated: boolean): void;
32
+ /**
33
+ * Invoked when a floor has been selected programmatically.
34
+ *
35
+ * @param {MPFloor} floor
36
+ */
37
+ setSelectedFloor(floor: MPFloor): void;
38
+ /**
39
+ * Invoked when a floor has been selected programmatically by index.
40
+ *
41
+ * @param {number} floorIndex
42
+ */
43
+ setSelectedFloorByFloorIndex(floorIndex: number): void;
44
+ /**
45
+ * Invoked when the zoom level changes.
46
+ *
47
+ * @param {number} newZoomLevel
48
+ */
49
+ zoomLevelChanged(newZoomLevel: number): void;
50
+ /**
51
+ * Whether to allow the floor to automatically change,
52
+ * eg. when panning to a new building that does not have the current floor.
53
+ *
54
+ * @returns {boolean}
55
+ */
56
+ isAutoFloorChangeEnabled(): boolean;
57
+ /**
58
+ * Invoked when user positioning changes floorIndex.
59
+ *
60
+ * @param {number} floorIndex
61
+ */
62
+ setUserPositionFloor(floorIndex: number): void;
63
+ }
@@ -0,0 +1,91 @@
1
+ import MPPoint from "./MPPoint";
2
+ import MPPolygon from "./MPPolygon";
3
+ import MPMultiPolygon from "./MPMultiPolygon";
4
+ import MPUtils from "./MPUtils";
5
+
6
+ /**
7
+ * Superclass of all MapsIndoors geometry classes.
8
+ *
9
+ * @export
10
+ * @abstract
11
+ * @class MPGeometry
12
+ * @typedef {MPGeometry}
13
+ */
14
+ export default abstract class MPGeometry {
15
+ /**
16
+ * Typename for {@link MPPoint}.
17
+ *
18
+ * @public
19
+ * @static
20
+ * @readonly
21
+ * @type {string}
22
+ */
23
+ public static readonly point: string = "Point";
24
+ /**
25
+ * Typename for {@link MPPolygon}.
26
+ *
27
+ * @public
28
+ * @static
29
+ * @readonly
30
+ * @type {string}
31
+ */
32
+ public static readonly polygon: string = "Polygon";
33
+ /**
34
+ * Typename for {@link MPMultiPolygon}.
35
+ *
36
+ * @public
37
+ * @static
38
+ * @readonly
39
+ * @type {string}
40
+ */
41
+ public static readonly multiPolygon: string = "MultiPolygon";
42
+ /**
43
+ * Position of geometry, used as anchor for markers.
44
+ *
45
+ * @public
46
+ * @abstract
47
+ * @readonly
48
+ * @type {MPPoint}
49
+ */
50
+ public abstract readonly position: MPPoint;
51
+ /**
52
+ * Type of geometry, see {@link point}.
53
+ *
54
+ * @public
55
+ * @abstract
56
+ * @readonly
57
+ * @type {string}
58
+ */
59
+ public abstract readonly type: string;
60
+
61
+ /**
62
+ * Computes the area of the geometry.
63
+ *
64
+ * @public
65
+ * @abstract
66
+ * @returns {Promise<number>}
67
+ */
68
+ public abstract getArea(): Promise<number>;
69
+
70
+ /**
71
+ * Checks whether a point is contained within the geometry.
72
+ *
73
+ * @public
74
+ * @async
75
+ * @param {MPPoint} point
76
+ * @returns {Promise<boolean>}
77
+ */
78
+ public async contains(point: MPPoint): Promise<boolean> {
79
+ return MPUtils.geometryIsInside(point, this);
80
+ }
81
+
82
+ /**
83
+ * Stringifies the geometry to JSON.
84
+ *
85
+ * @public
86
+ * @returns {string}
87
+ */
88
+ public toJson(): string {
89
+ return JSON.stringify(this);
90
+ }
91
+ }
@@ -0,0 +1,115 @@
1
+ import MapControl from "../../index";
2
+ import { Platform } from 'react-native';
3
+
4
+ /**
5
+ * Sets a behavior for the map when calling {@link MapControl#setHighlight}.
6
+ *
7
+ * Has a default behavior:
8
+ * * MoveCamera = false
9
+ * * ShowInfoWindow = false
10
+ * * AnimationDuration = 0
11
+ * * AllowFloorChange = false
12
+ * * ZoomToFit = true
13
+ *
14
+ * @export
15
+ * @class MPFilterBehavior
16
+ * @typedef {MPHighlightBehavior}
17
+ */
18
+ export default class MPHighlightBehavior {
19
+
20
+ /**
21
+ * Creates an instance of MPHighlightBehavior.
22
+ *
23
+ * @constructor
24
+ * @private
25
+ * @param {boolean} allowFloorChange Whether the highlighting is allowed to change the floor if no results are visible on the current floor.
26
+ * @param {boolean} moveCamera Whether the highlighting should move the camera to encompass the results.
27
+ * @param {number} animationDuration How long the camera movement should be animated for, set to 0 disables animation.
28
+ * @param {boolean} showInfoWindow Whether to open the info window if a single result is returned.
29
+ * @param {boolean} zoomToFit Whether the highlighting is allowed to zoom in/out the camera.
30
+ * @param {number} maxZoom The maximum zoom level to zoom to when zoomToFit is enabled.
31
+ */
32
+ private constructor(
33
+ public allowFloorChange: boolean,
34
+ public moveCamera: boolean,
35
+ public animationDuration: number,
36
+ public showInfoWindow: boolean,
37
+ public zoomToFit: boolean,
38
+ public maxZoom?: number
39
+ ) { }
40
+
41
+ /**
42
+ * Creator for MPHighlightBehavior, invoke with 0 parameters to use default behavior.
43
+ *
44
+ * @public
45
+ * @static
46
+ * @param {MPFilterBehaviorParams} object
47
+ * @returns {MPFilterBehavior}
48
+ */
49
+ public static create(object?: MPHighlightBehaviorParams): MPHighlightBehavior {
50
+ if(Platform.OS === 'ios') {
51
+ return new MPHighlightBehavior(
52
+ object?.allowFloorChange ?? false,
53
+ object?.moveCamera ?? false,
54
+ object?.animationDuration ?? 0,
55
+ object?.showInfoWindow ?? false,
56
+ object?.zoomToFit ?? true,
57
+ object?.maxZoom ?? 999
58
+ );
59
+ }
60
+ return new MPHighlightBehavior(
61
+ object?.allowFloorChange ?? false,
62
+ object?.moveCamera ?? false,
63
+ object?.animationDuration ?? 0,
64
+ object?.showInfoWindow ?? false,
65
+ object?.zoomToFit ?? true,
66
+ object?.maxZoom
67
+ );
68
+ };
69
+ }
70
+
71
+ /**
72
+ * Parameter interface for {@link MPHighlightBehavior}.
73
+ *
74
+ * @export
75
+ * @interface MPHighlightBehaviorParams
76
+ * @typedef {MPHighlightBehaviorParams}
77
+ */
78
+ export interface MPHighlightBehaviorParams {
79
+ /**
80
+ * Whether the highlight is allowed to change the floor if no results are visible on the current floor.
81
+ *
82
+ * @type {?boolean}
83
+ */
84
+ allowFloorChange?: boolean,
85
+ /**
86
+ * Whether the Highlight should move the camera to encompass the results.
87
+ *
88
+ * @type {?boolean}
89
+ */
90
+ moveCamera?: boolean,
91
+ /**
92
+ * How long the camera movement should be animated for, set to 0 disables animation.
93
+ *
94
+ * @type {?number}
95
+ */
96
+ animationDuration?: number,
97
+ /**
98
+ * Whether to open the info window if a single result is returned.
99
+ *
100
+ * @type {?boolean}
101
+ */
102
+ showInfoWindow?: boolean,
103
+ /**
104
+ * Whether the Highlight is allowed to zoom in/out the camera.
105
+ *
106
+ * @type {?boolean}
107
+ */
108
+ zoomToFit?: boolean,
109
+ /**
110
+ * The maximum zoom level to zoom to when zoomToFit is enabled.
111
+ *
112
+ * @type {?number}
113
+ */
114
+ maxZoom?: number
115
+ }
@@ -0,0 +1,14 @@
1
+ export enum MPHighway {
2
+ unclassified = "unclassified",
3
+ footway = "footway",
4
+ residential = "residential",
5
+ service = "service",
6
+ ramp = "ramp",
7
+ steps = "steps",
8
+ escalator = "escalator",
9
+ travelator = "travelator",
10
+ elevator = "elevator",
11
+ wheelChairRamp = "wheelchairramp",
12
+ wheelChairLift = "wheelchairlift",
13
+ ladder = "ladder",
14
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The possible position of Icons based on the location Anchor.
3
+ *
4
+ * @export
5
+ * @enum {number}
6
+ */
7
+ export enum MPIconPlacement {
8
+ center,
9
+ above,
10
+ below,
11
+ left,
12
+ right
13
+ }
@@ -0,0 +1,39 @@
1
+ import MPSize from "./MPSize";
2
+
3
+ /**
4
+ * Class to hold height and width information for an icon.
5
+ *
6
+ * @export
7
+ * @class MPIconSize
8
+ * @typedef {MPIconSize}
9
+ * @implements {MPSize}
10
+ */
11
+ export default class MPIconSize implements MPSize {
12
+ /**
13
+ * Creates an instance of MPIconSize.
14
+ *
15
+ * @constructor
16
+ * @private
17
+ * @param {number} height The height measure.
18
+ * @param {number} width The width measure.
19
+ */
20
+ private constructor(
21
+ public readonly height: number,
22
+ public readonly width: number
23
+ ) { }
24
+
25
+ /**
26
+ * Creator for MPIconSize, used to decode JSON from the MapsIndoors SDK.
27
+ *
28
+ * @public
29
+ * @static
30
+ * @param {MPSize} object
31
+ * @returns {MPIconSize}
32
+ */
33
+ public static create(object: MPSize): MPIconSize {
34
+ return new MPIconSize(
35
+ object?.height,
36
+ object?.width,
37
+ );
38
+ }
39
+ }
@@ -0,0 +1,24 @@
1
+ export default class MPLabelGraphic {
2
+ private constructor(
3
+ public readonly backgroundImage: string,
4
+ public readonly stretchX: number[][],
5
+ public readonly stretchY: number[][],
6
+ public readonly content: number[]
7
+ ) { }
8
+
9
+ public static create(object: MPLabelGraphicParams): MPLabelGraphic {
10
+ return new MPLabelGraphic(
11
+ object.backgroundImage,
12
+ object.stretchX,
13
+ object.stretchY,
14
+ object.content,
15
+ );
16
+ }
17
+ }
18
+
19
+ export interface MPLabelGraphicParams {
20
+ backgroundImage: string;
21
+ stretchX: number[][];
22
+ stretchY: number[][];
23
+ content: number[];
24
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The possible position of the label, anchored on the icon.
3
+ *
4
+ * @export
5
+ * @enum {number}
6
+ */
7
+ export enum MPLabelPosition {
8
+ left,
9
+ top,
10
+ bottom,
11
+ right
12
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The type of label
3
+ *
4
+ * @export
5
+ * @enum {number}
6
+ */
7
+ export enum MPLabelType {
8
+ flat,
9
+ floating,
10
+ graphic
11
+ }