@mapsindoors/react-native-maps-indoors-mapbox 2.5.4 → 2.6.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 (130) hide show
  1. package/README.md +3 -3
  2. package/android/build.gradle +1 -1
  3. package/package.json +1 -1
  4. package/react-native-maps-indoors-mapbox.podspec +2 -2
  5. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +0 -322
  6. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +0 -166
  7. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +0 -1699
  8. package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +0 -761
  9. package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +0 -410
  10. package/android/src/main/java/com/mapsindoorsrn/core/RCMapView.java +0 -16
  11. package/android/src/main/java/com/mapsindoorsrn/core/README.md +0 -3
  12. package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +0 -227
  13. package/android/src/main/java/com/mapsindoorsrn/core/models/BitmapStopIconConfig.java +0 -22
  14. package/android/src/main/java/com/mapsindoorsrn/core/models/Bounds.java +0 -19
  15. package/android/src/main/java/com/mapsindoorsrn/core/models/Filter.java +0 -77
  16. package/android/src/main/java/com/mapsindoorsrn/core/models/Location.java +0 -17
  17. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraPosition.java +0 -34
  18. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraUpdate.java +0 -68
  19. package/android/src/main/java/com/mapsindoorsrn/core/models/MPError.java +0 -38
  20. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionProvider.java +0 -46
  21. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionResult.java +0 -117
  22. package/android/src/main/java/com/mapsindoorsrn/core/models/Query.java +0 -30
  23. package/android/src/main/java/com/mapsindoorsrn/core/models/RouteStopIconConfigModel.java +0 -35
  24. package/ios/core/CameraPosition.swift +0 -15
  25. package/ios/core/CameraUpdate.swift +0 -19
  26. package/ios/core/CameraUpdateError.swift +0 -11
  27. package/ios/core/DirectionsRendererBridge.m +0 -59
  28. package/ios/core/DirectionsRendererModule.swift +0 -359
  29. package/ios/core/DirectionsServiceBridge.m +0 -55
  30. package/ios/core/DirectionsServiceModule.swift +0 -186
  31. package/ios/core/IconStopUrl.swift +0 -17
  32. package/ios/core/LabelGraphic.swift +0 -15
  33. package/ios/core/MPDisplayRuleBridge.m +0 -696
  34. package/ios/core/MPDisplayRuleModule.swift +0 -1704
  35. package/ios/core/MapControlBridge.m +0 -213
  36. package/ios/core/MapControlModule.swift +0 -702
  37. package/ios/core/MapsIndoorsBridge.m +0 -128
  38. package/ios/core/MapsIndoorsData.swift +0 -288
  39. package/ios/core/MapsIndoorsModule.swift +0 -363
  40. package/ios/core/RCMapView.swift +0 -16
  41. package/ios/core/README.md +0 -3
  42. package/ios/core/ReactPositionProvider.swift +0 -27
  43. package/ios/core/RouteIcon.swift +0 -34
  44. package/ios/core/UtilsBridge.m +0 -73
  45. package/ios/core/UtilsModule.swift +0 -182
  46. package/ios/core/helpers.swift +0 -57
  47. package/src/core/EventNames.ts +0 -21
  48. package/src/core/MPBadgePosition.ts +0 -12
  49. package/src/core/MPBounds.ts +0 -155
  50. package/src/core/MPBuilding.ts +0 -333
  51. package/src/core/MPBuildingCollection.ts +0 -57
  52. package/src/core/MPBuildingInfo.ts +0 -63
  53. package/src/core/MPCameraEvent.ts +0 -17
  54. package/src/core/MPCameraEventListener.ts +0 -17
  55. package/src/core/MPCameraPosition.ts +0 -82
  56. package/src/core/MPCameraUpdate.ts +0 -174
  57. package/src/core/MPCameraViewFitMode.ts +0 -25
  58. package/src/core/MPCategory.ts +0 -76
  59. package/src/core/MPCategoryCollection.ts +0 -62
  60. package/src/core/MPCollection.ts +0 -59
  61. package/src/core/MPCollisionHandling.ts +0 -12
  62. package/src/core/MPDataField.ts +0 -69
  63. package/src/core/MPDirectionsRenderer.ts +0 -238
  64. package/src/core/MPDirectionsService.ts +0 -152
  65. package/src/core/MPDisplayRule.ts +0 -1823
  66. package/src/core/MPEntity.ts +0 -60
  67. package/src/core/MPEntityInfo.ts +0 -28
  68. package/src/core/MPError.ts +0 -122
  69. package/src/core/MPFeatureTypes.ts +0 -8
  70. package/src/core/MPFilter.ts +0 -168
  71. package/src/core/MPFilterBehavior.ts +0 -115
  72. package/src/core/MPFloor.ts +0 -170
  73. package/src/core/MPFloorSelectorInterface.ts +0 -63
  74. package/src/core/MPGeometry.ts +0 -91
  75. package/src/core/MPHighlightBehavior.ts +0 -115
  76. package/src/core/MPHighway.ts +0 -14
  77. package/src/core/MPIconPlacement.ts +0 -13
  78. package/src/core/MPIconSize.ts +0 -39
  79. package/src/core/MPLabelGraphic.ts +0 -24
  80. package/src/core/MPLabelPosition.ts +0 -12
  81. package/src/core/MPLabelType.ts +0 -11
  82. package/src/core/MPLocation.ts +0 -410
  83. package/src/core/MPLocationPropertyNames.ts +0 -30
  84. package/src/core/MPLocationSettings.ts +0 -40
  85. package/src/core/MPLocationType.ts +0 -16
  86. package/src/core/MPMapConfig.ts +0 -280
  87. package/src/core/MPMapStyle.ts +0 -57
  88. package/src/core/MPMultiPolygon.ts +0 -218
  89. package/src/core/MPPOIType.ts +0 -43
  90. package/src/core/MPPoint.ts +0 -169
  91. package/src/core/MPPolygon.ts +0 -219
  92. package/src/core/MPPositionProviderInterface.ts +0 -45
  93. package/src/core/MPPositionResultInterface.ts +0 -42
  94. package/src/core/MPPropertyData.ts +0 -224
  95. package/src/core/MPQuery.ts +0 -69
  96. package/src/core/MPRoute.ts +0 -105
  97. package/src/core/MPRouteCoordinate.ts +0 -95
  98. package/src/core/MPRouteLeg.ts +0 -158
  99. package/src/core/MPRouteProperty.ts +0 -83
  100. package/src/core/MPRouteStep.ts +0 -186
  101. package/src/core/MPRouteStopIconConfig.ts +0 -82
  102. package/src/core/MPSelectionBehavior.ts +0 -114
  103. package/src/core/MPSelectionMode.ts +0 -4
  104. package/src/core/MPSettings3D.ts +0 -107
  105. package/src/core/MPSize.ts +0 -21
  106. package/src/core/MPSolution.ts +0 -189
  107. package/src/core/MPSolutionConfig.ts +0 -188
  108. package/src/core/MPSolutionDisplayRule.ts +0 -15
  109. package/src/core/MPUserRole.ts +0 -60
  110. package/src/core/MPUserRoleCollection.ts +0 -37
  111. package/src/core/MPUtils.ts +0 -178
  112. package/src/core/MPVenue.ts +0 -294
  113. package/src/core/MPVenueCollection.ts +0 -58
  114. package/src/core/MPVenueInfo.ts +0 -62
  115. package/src/core/MapControl.ts +0 -961
  116. package/src/core/MapView.tsx +0 -34
  117. package/src/core/MapsIndoors.ts +0 -571
  118. package/src/core/OnBuildingFoundAtCameraTargetListener.ts +0 -17
  119. package/src/core/OnFloorSelectionChangedListener.ts +0 -17
  120. package/src/core/OnFloorUpdateListener.ts +0 -16
  121. package/src/core/OnLegSelectedListener.ts +0 -17
  122. package/src/core/OnLiveLocationUpdateListener.ts +0 -17
  123. package/src/core/OnLocationSelectedListener.ts +0 -17
  124. package/src/core/OnMapClickListener.ts +0 -20
  125. package/src/core/OnMarkerClickListener.ts +0 -17
  126. package/src/core/OnMarkerInfoWindowClickListener.ts +0 -17
  127. package/src/core/OnPositionUpdateListener.ts +0 -17
  128. package/src/core/OnVenueFoundAtCameraTargetListener.ts +0 -17
  129. package/src/core/README.md +0 -3
  130. package/src/core/RouteStopIconConfig.ts +0 -10
@@ -1,15 +0,0 @@
1
- import { MPDisplayRule } from "../../index";
2
-
3
- /**
4
- * Special {@link MPDisplayRule}s that govern specific scenarios
5
- *
6
- * @export
7
- * @enum {number}
8
- */
9
- export enum MPSolutionDisplayRule {
10
- buildingOutline = "buildingOutline",
11
- selectionHighlight = "selectionHighlight",
12
- positionIndicator = "positionIndicator",
13
- selection = "selection",
14
- highlight = "highlight"
15
- }
@@ -1,60 +0,0 @@
1
- /**
2
- * A User Role that allows certain parts of the data to be viewed.
3
- *
4
- * @export
5
- * @class MPUserRole
6
- * @typedef {MPUserRole}
7
- */
8
- export default class MPUserRole {
9
-
10
-
11
- /**
12
- * Creates an instance of MPUserRole.
13
- *
14
- * @constructor
15
- * @private
16
- * @param {string} id The id of the user role.
17
- * @param {string} name The name of the user role.
18
- */
19
- private constructor(
20
- public readonly id: string,
21
- public readonly name: string,
22
- ) { }
23
-
24
- /**
25
- * Creator for MPUserRole, used to decode JSON from the MapsIndoors SDK.
26
- *
27
- * @public
28
- * @static
29
- * @param {MPUserRoleParams} object
30
- * @returns {MPUserRole}
31
- */
32
- public static create(object: MPUserRoleParams): MPUserRole {
33
- return new MPUserRole(
34
- object?.id,
35
- object?.name,
36
- );
37
- }
38
- }
39
-
40
- /**
41
- * Parameter interface for {@link MPUserRole}.
42
- *
43
- * @export
44
- * @interface MPUserRoleParams
45
- * @typedef {MPUserRoleParams}
46
- */
47
- export interface MPUserRoleParams {
48
- /**
49
- * The id of the user role.
50
- *
51
- * @type {string}
52
- */
53
- id: string,
54
- /**
55
- * The name of the user role.
56
- *
57
- * @type {string}
58
- */
59
- name: string,
60
- }
@@ -1,37 +0,0 @@
1
- import MPCollection from "./MPCollection";
2
- import MapsIndoors, {MPUserRole} from "../../index";
3
-
4
- /**
5
- * A collection of user role objects fetched from {@link MapsIndoors}. Uses {@link MPUserRole.id} as key.
6
- *
7
- * @export
8
- * @class MPUserRoleCollection
9
- * @typedef {MPUserRoleCollection}
10
- * @extends {MPCollection<MPUserRole>}
11
- */
12
- export default class MPUserRoleCollection extends MPCollection<MPUserRole> {
13
- /**
14
- * Creates an instance of MPUserRoleCollection.
15
- *
16
- * @constructor
17
- * @private
18
- * @param {MPUserRole[]} userroles A collection of user roles
19
- */
20
- private constructor(userroles: MPUserRole[]) {
21
- super();
22
- this.map = new Map(userroles.map((role) => [role.id, role]));
23
- }
24
-
25
- /**
26
- * Creator for MPUserRoleCollection, used to decode JSON from the MapsIndoors SDK.
27
- *
28
- * @public
29
- * @static
30
- * @param {?*} [object]
31
- * @returns {MPUserRoleCollection}
32
- */
33
- public static create(object?: any) : MPUserRoleCollection {
34
- let userroles: MPUserRole[] = object?.map((venue: any) => MPUserRole.create(venue));
35
- return new MPUserRoleCollection(userroles);
36
- }
37
- }
@@ -1,178 +0,0 @@
1
- import { NativeModules } from 'react-native';
2
- import { MPGeometry, MPPoint, MPCollisionHandling } from '../../index';
3
- const { UtilsModule } = NativeModules;
4
-
5
- /**
6
- * Internal - Documentation will follow.
7
- *
8
- * @export
9
- * @class MPUtils
10
- * @typedef {MPUtils}
11
- */
12
- export default class MPUtils {
13
- /**
14
- * Creates an instance of MPUtils.
15
- *
16
- * @constructor
17
- * @private
18
- */
19
- private constructor() { }
20
-
21
- /**
22
- * Internal - Documentation will follow.
23
- *
24
- * @static
25
- * @async
26
- * @param {string} venueId
27
- * @returns {Promise<boolean>}
28
- */
29
- static async venueHasGraph(venueId: string): Promise<boolean> {
30
- return UtilsModule.venueHasGraph(venueId);
31
- }
32
-
33
- /**
34
- * Internal - Documentation will follow.
35
- *
36
- * @static
37
- * @async
38
- * @param {MPPoint} it
39
- * @param {MPPoint} other
40
- * @returns {Promise<number>}
41
- */
42
- static async pointAngleBetween(it: MPPoint, other: MPPoint): Promise<number> {
43
- return UtilsModule.pointAngleBetween(JSON.stringify(it), JSON.stringify(other));
44
- }
45
-
46
- /**
47
- * Internal - Documentation will follow.
48
- *
49
- * @static
50
- * @async
51
- * @param {MPPoint} it
52
- * @param {MPPoint} other
53
- * @returns {Promise<number>}
54
- */
55
- static async pointDistanceTo(it: MPPoint, other: MPPoint): Promise<number> {
56
- return UtilsModule.pointDistanceTo(JSON.stringify(it), JSON.stringify(other));
57
- }
58
-
59
- /**
60
- * Internal - Documentation will follow.
61
- *
62
- * @static
63
- * @async
64
- * @param {MPPoint} point
65
- * @param {MPGeometry} geometry
66
- * @returns {Promise<boolean>}
67
- */
68
- static async geometryIsInside(point: MPPoint, geometry: MPGeometry): Promise<boolean> {
69
- return UtilsModule.geometryIsInside(JSON.stringify(point), JSON.stringify(geometry));
70
- }
71
-
72
- /**
73
- * Internal - Documentation will follow.
74
- *
75
- * @static
76
- * @async
77
- * @param {MPGeometry} geometry
78
- * @returns {Promise<number>}
79
- */
80
- static async geometryArea(geometry: MPGeometry): Promise<number> {
81
- return UtilsModule.geometryArea(JSON.stringify(geometry));
82
- }
83
-
84
- /**
85
- * Internal - Documentation will follow.
86
- *
87
- * @static
88
- * @async
89
- * @param {MPPoint} point
90
- * @param {MPGeometry} polygon
91
- * @returns {Promise<number>}
92
- */
93
- static async polygonDistanceToClosestEdge(point: MPPoint, polygon: MPGeometry): Promise<number> {
94
- return UtilsModule.polygonDistanceToClosestEdge(JSON.stringify(point), JSON.stringify(polygon));
95
- }
96
-
97
- /**
98
- * Internal - Documentation will follow.
99
- *
100
- * @static
101
- * @async
102
- * @param {string} venueId
103
- * @param {string} locationId
104
- * @returns {Promise<string>}
105
- */
106
- static async parseMapClientUrl(venueId: string, locationId: string): Promise<string> {
107
- return UtilsModule.parseMapClientUrl(venueId, locationId);
108
- }
109
-
110
- /**
111
- * Internal - Documentation will follow.
112
- *
113
- * @static
114
- * @async
115
- * @param {MPCollisionHandling} collisionHandling
116
- * @returns {Promise<void>}
117
- */
118
- static async setCollisionHandling(collisionHandling: MPCollisionHandling): Promise<void> {
119
- return UtilsModule.setCollisionHandling(collisionHandling.valueOf());
120
- }
121
-
122
- /**
123
- * Internal - Documentation will follow.
124
- *
125
- * @static
126
- * @async
127
- * @param {boolean} enableClustering
128
- * @returns {Promise<void>}
129
- */
130
- static async setEnableClustering(enableClustering: boolean): Promise<void> {
131
- return UtilsModule.enableClustering(enableClustering);
132
- }
133
-
134
- /**
135
- * Internal - Documentation will follow.
136
- *
137
- * @static
138
- * @async
139
- * @param {boolean} enableClustering
140
- * @returns {Promise<void>}
141
- */
142
- static async setNewSelection(isNewSelection: boolean): Promise<void> {
143
- return Promise.resolve(UtilsModule.setNewSelection(isNewSelection));
144
- }
145
-
146
- /**
147
- * Internal - Documentation will follow.
148
- *
149
- * @static
150
- * @async
151
- * @param {number} opacity
152
- * @returns {Promise<void>}
153
- */
154
- static async setExtrusionOpacity(opacity: number): Promise<void> {
155
- return UtilsModule.setExtrusionOpacity(opacity);
156
- }
157
-
158
- /**
159
- * Internal - Documentation will follow.
160
- *
161
- * @static
162
- * @async
163
- * @param {number} opacity
164
- * @returns {Promise<void>}
165
- */
166
- static async setWallOpacity(opacity: number): Promise<void> {
167
- return UtilsModule.setWallOpacity(opacity);
168
- }
169
-
170
- static async setSelectable(id: string, selectable: boolean): Promise<void> {
171
- return UtilsModule.setSelectable(id, selectable);
172
- }
173
-
174
- static async setAutomatedZoomLimit(automatedZoomLimit?: number): Promise<void> {
175
- return UtilsModule.setAutomatedZoomLimit(automatedZoomLimit);
176
- }
177
-
178
- }
@@ -1,294 +0,0 @@
1
- import { Platform } from "react-native";
2
- import { MPPoint, MPPointParams, MPBounds, MPMapStyle, MPPolygon, MPVenueInfo, MPDataField, MPBuilding, MPLocation } from '../../index';
3
- import MPEntity from "./MPEntity";
4
- import MPUtils from "./MPUtils";
5
-
6
- /**
7
- * A MapsIndoors geographical entity. A venue can exist anywhere,
8
- * and it can contain a number of {@link MPBuilding}s and {@link MPLocation}s.
9
- *
10
- * @export
11
- * @class MPVenue
12
- * @typedef {MPVenue}
13
- * @extends {MPEntity}
14
- */
15
- export default class MPVenue extends MPEntity {
16
-
17
- /**
18
- * Creates an instance of MPVenue.
19
- *
20
- * @constructor
21
- * @param {string} id The venue's ID.
22
- * @param {string} administrativeId The venue's readable ID.
23
- * @param {string} tilesUrl The URL that is used to fetch tiles for the venue.
24
- * @param {MPMapStyle[]} mapStyles An array of mapStyles that can be used on this venue.
25
- * @param {MPPolygon} geometry The geometry of the venue.
26
- * @param {number} defaultFloor The venue's defalt floor index.
27
- * @param {MPVenueInfo} venueInfo A collection of information about the venue.
28
- * @param {MPPoint} anchor The anchor point for the location.
29
- * @param {MPPoint[]} entryPoints Points of entry that are used to create routes between MapsIndoors and the underlying map.
30
- * @param {string} [externalId] An optional ID used to map the venue to a customer's ID.
31
- * @param {?string} [graphId] The ID of the graph used to route on this venue.
32
- */
33
- constructor(
34
- public readonly id: string,
35
- public readonly administrativeId: string,
36
- public readonly tilesUrl: string,
37
- public readonly mapStyles: MPMapStyle[],
38
- public readonly geometry: MPPolygon,
39
- public readonly defaultFloor: number,
40
- public readonly venueInfo: MPVenueInfo,
41
- public readonly anchor: MPPoint,
42
- public readonly entryPoints: MPPoint[],
43
- public readonly externalId: string,
44
- public readonly graphId?: string,
45
- ) {
46
- super("MPVenue");
47
- }
48
-
49
- /**
50
- * Creator for MPVenue, used to decode JSON from the MapsIndoors SDK.
51
- *
52
- * @public
53
- * @static
54
- * @param {MPVenueParams} object
55
- * @returns {MPVenue}
56
- */
57
- public static create(object: MPVenueParams): MPVenue {
58
- var polygon;
59
-
60
- if (Platform.OS === 'ios') {
61
- polygon = MPPolygon.create({coordinates: object?.geometry, bbox: [].concat(object?.bbox?.southwest, object?.bbox?.northeast)});
62
- }else {
63
- polygon = MPPolygon.create(object?.geometry);
64
- }
65
- return new MPVenue(
66
- object?.id,
67
- object?.name,
68
- object?.tilesUrl,
69
- object?.styles?.map((style: any) => MPMapStyle.create(style)),
70
- polygon,
71
- object?.defaultFloor,
72
- MPVenueInfo.create(object?.venueInfo),
73
- MPPoint.create(object?.anchor),
74
- object?.entryPoints?.map((entryPoint: any) => MPPoint.create(entryPoint)),
75
- object?.externalId,
76
- object?.graphId,
77
- );
78
- }
79
-
80
- /**
81
- * Get the venue's name.
82
- *
83
- * @public
84
- * @readonly
85
- * @type {string}
86
- */
87
- public get name(): string {
88
- return this.venueInfo?.name;
89
- }
90
-
91
- /**
92
- * Get the venue's bounds.
93
- *
94
- * @public
95
- * @readonly
96
- * @type {MPBounds}
97
- */
98
- public get bounds(): MPBounds {
99
- return this.geometry.bounds;
100
- }
101
-
102
- /**
103
- * Get the position of the venue, this will correspond to the venue's anchor point.
104
- *
105
- * @public
106
- * @readonly
107
- * @type {MPPoint}
108
- */
109
- public get position(): MPPoint {
110
- return this.anchor;
111
- }
112
-
113
- /**
114
- * Inherited from {@link MPEntity}, a venue's geometry is never a {@link MPPoint}.
115
- *
116
- * @public
117
- * @readonly
118
- * @type {boolean}
119
- */
120
- public get isPoint(): boolean {
121
- return false;
122
- }
123
-
124
- /**
125
- * Get the venue's default mapstyle.
126
- *
127
- * @public
128
- * @readonly
129
- * @type {MPMapStyle}
130
- */
131
- public get defaultMapStyle(): MPMapStyle {
132
- return this.mapStyles[0];
133
- }
134
-
135
- /**
136
- * Fetch a field from the venue's info member.
137
- *
138
- * @public
139
- * @param {?string} [key]
140
- * @returns {(MPDataField | undefined)}
141
- */
142
- public getField(key?: string): MPDataField | undefined {
143
- if (key !== undefined) {
144
- return this.venueInfo.fields?.get(key);
145
- }
146
- }
147
-
148
- /**
149
- * Check whether a given mapstyle is valid for the venue.
150
- *
151
- * @public
152
- * @param {?MPMapStyle} [style]
153
- * @returns {boolean}
154
- */
155
- public isMapStyleValid(style?: MPMapStyle) : boolean {
156
- if (style) {
157
- this.mapStyles.forEach((value: MPMapStyle) => {
158
- if (style == value) {
159
- return true;
160
- }
161
- });
162
- }
163
- return false;
164
- }
165
-
166
- /**
167
- * Check whether the venue has a valid routing graph.
168
- *
169
- * @public
170
- * @async
171
- * @returns {Promise<boolean>}
172
- */
173
- public async hasGraph(): Promise<boolean> {
174
- return MPUtils.venueHasGraph(this.id);
175
- }
176
-
177
- /**
178
- * Check whether the venue contains a point.
179
- *
180
- * @public
181
- * @async
182
- * @param {MPPoint} point
183
- * @returns {Promise<boolean>}
184
- */
185
- public async contains(point: MPPoint): Promise<boolean> {
186
- return this.geometry.contains(point);
187
- }
188
-
189
-
190
- /**
191
- * Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
192
- *
193
- * @public
194
- * @returns {MPVenueParams}
195
- */
196
- public toJSON(): MPVenueParams {
197
- return {
198
- id: this.id,
199
- graphId: this.graphId,
200
- name: this.administrativeId,
201
- tilesUrl: this.tilesUrl,
202
- styles: this.mapStyles,
203
- geometry: this.geometry,
204
- defaultFloor: this.defaultFloor,
205
- venueInfo: this.venueInfo,
206
- anchor: this.anchor.toJSON(),
207
- entryPoints: this.entryPoints,
208
- externalId: this.externalId,
209
- }
210
- }
211
- }
212
-
213
- /**
214
- * Parameter interface for {@link MPVenue}.
215
- *
216
- * @export
217
- * @interface MPVenueParams
218
- * @typedef {MPVenueParams}
219
- */
220
- export interface MPVenueParams {
221
- /**
222
- * The venue's ID.
223
- *
224
- * @type {string}
225
- */
226
- id: string,
227
- /**
228
- * The venue's readable ID.
229
- *
230
- * @type {string}
231
- */
232
- name: string,
233
- /**
234
- * An ID used to map the venue to a customer's ID.
235
- *
236
- * @type {?string}
237
- */
238
- externalId: string,
239
- /**
240
- * The URL that is used to fetch tiles for the venue.
241
- *
242
- * @type {string}
243
- */
244
- tilesUrl: string,
245
- /**
246
- * An array of mapStyles that can be used on this venue.
247
- *
248
- * @type {MPMapStyle[]}
249
- */
250
- styles: MPMapStyle[],
251
- /**
252
- * The geometry of the venue.
253
- *
254
- * @type {MPPolygon}
255
- */
256
- geometry: MPPolygon | any,
257
- /**
258
- * The venue's defalt floor index.
259
- *
260
- * @type {number}
261
- */
262
- defaultFloor: number,
263
- /**
264
- * A collection of information about the venue.
265
- *
266
- * @type {MPVenueInfo}
267
- */
268
- venueInfo: MPVenueInfo,
269
- /**
270
- * The anchor point for the venue.
271
- *
272
- * @type {MPPointParams}
273
- */
274
- anchor: MPPointParams,
275
- /**
276
- * Points of entry that are used to create routes between MapsIndoors and the underlying map.
277
- *
278
- * @type {MPPoint[]}
279
- */
280
- entryPoints: MPPoint[],
281
- /**
282
- * The ID of the graph used to route on this venue.
283
- *
284
- * @type {?string}
285
- */
286
- graphId?: string,
287
- /**
288
- * A object of two arrays representing coordinates
289
- * Northeast & Southwest
290
- *
291
- * @type {any}
292
- */
293
- bbox?: any
294
- }
@@ -1,58 +0,0 @@
1
- import MPCollection from "./MPCollection";
2
- import MPVenue from "./MPVenue";
3
-
4
- /**
5
- * Description placeholder.
6
- *
7
- * @export
8
- * @class MPVenueCollection
9
- * @typedef {MPVenueCollection}
10
- * @extends {MPCollection<MPVenue>}
11
- */
12
- export default class MPVenueCollection extends MPCollection<MPVenue> {
13
- /**
14
- * Internal.
15
- *
16
- * Map between administrative ID and venues.
17
- *
18
- * @private
19
- * @type {!Map<String, MPVenue>}
20
- */
21
- private adminIdMap!: Map<String, MPVenue>;
22
-
23
- /**
24
- * Creates an instance of MPVenueCollection.
25
- *
26
- * @constructor
27
- * @private
28
- * @param {MPVenue[]} venues A collection of venues used in MapsIndoors.
29
- */
30
- private constructor(venues: MPVenue[]) {
31
- super();
32
- this.map = new Map(venues.map((venue) => [venue.id, venue]));
33
- this.adminIdMap = new Map(venues.map((venue) => [venue.administrativeId.toLowerCase(), venue]));
34
- }
35
-
36
- /**
37
- * Fetch a venue by its administrative id.
38
- *
39
- * @public
40
- * @param {string} id
41
- * @returns {(MPVenue | undefined)}
42
- */
43
- public getVenueByAdminId(id: string) : MPVenue | undefined {
44
- return this.adminIdMap.get(id.toLowerCase());
45
- }
46
-
47
- /**
48
- * Creator for MPVenueCollection, used to decode JSON from the MapsIndoors SDK.
49
- *
50
- * @static
51
- * @param {?*} [object]
52
- * @returns {MPVenueCollection}
53
- */
54
- static create(object?: any) : MPVenueCollection {
55
- let venues: MPVenue[] = object?.map((venue: any) => MPVenue.create(venue));
56
- return new MPVenueCollection(venues);
57
- }
58
- }
@@ -1,62 +0,0 @@
1
- import MPDataField from "./MPDataField";
2
- import { MPEntityInfo } from "./MPEntityInfo";
3
-
4
- /**
5
- * Description placeholder.
6
- *
7
- * @export
8
- * @class MPVenueInfo
9
- * @typedef {MPVenueInfo}
10
- * @extends {MPEntityInfo}
11
- */
12
- export default class MPVenueInfo extends MPEntityInfo {
13
- /**
14
- * Creator for MPVenueInfo, used to decode JSON from the MapsIndoors SDK.
15
- *
16
- * @static
17
- * @param {MPVenueInfoParams} object
18
- * @returns {MPVenueInfo}
19
- */
20
- static create(object: MPVenueInfoParams): MPVenueInfo {
21
- return new MPVenueInfo(
22
- object?.name,
23
- object?.aliases,
24
- object?.fields,
25
- object?.language,
26
- );
27
- }
28
- }
29
-
30
- /**
31
- * Parameter interface for {@link MPVenueInfo}.
32
- *
33
- * @export
34
- * @interface MPVenueInfoParams
35
- * @typedef {MPVenueInfoParams}
36
- */
37
- export interface MPVenueInfoParams {
38
- /**
39
- * The name of the venue.
40
- *
41
- * @type {string}
42
- */
43
- name: string,
44
- /**
45
- * An array of aliases used by the venue.
46
- *
47
- * @type {?string[]}
48
- */
49
- aliases?: string[],
50
- /**
51
- * A number of data fields on the venue.
52
- *
53
- * @type {?Map<string, MPDataField>}
54
- */
55
- fields?: Map<string, MPDataField>,
56
- /**
57
- * The language the venue currently uses.
58
- *
59
- * @type {?string}
60
- */
61
- language?: string,
62
- }