@mapsindoors/react-native-maps-indoors-mapbox 2.6.2-rc.1 → 2.7.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 (34) hide show
  1. package/README.md +10 -1
  2. package/android/build.gradle +17 -70
  3. package/android/src/main/java/com/mapsindoorsrn/MapsIndoorsPackage.java +69 -18
  4. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +5 -1
  5. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +5 -2
  6. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +5 -1
  7. package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +5 -1
  8. package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +4 -1
  9. package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +4 -1
  10. package/ios/core/DirectionsRendererBridge.m +5 -0
  11. package/ios/core/DirectionsRendererModule.swift +92 -72
  12. package/ios/core/DirectionsServiceBridge.m +1 -1
  13. package/ios/core/DirectionsServiceModule.swift +44 -51
  14. package/ios/core/IconStopUrl.swift +1 -1
  15. package/ios/core/MPDisplayRuleModule.swift +208 -210
  16. package/ios/core/MapControlModule.swift +284 -216
  17. package/ios/core/MapsIndoorsData.swift +48 -49
  18. package/ios/core/MapsIndoorsModule.swift +46 -52
  19. package/ios/core/RCMapView.swift +1 -1
  20. package/ios/core/ReactPositionProvider.swift +1 -2
  21. package/ios/core/RouteIcon.swift +6 -6
  22. package/ios/core/UtilsModule.swift +37 -42
  23. package/ios/core/helpers.swift +16 -11
  24. package/package.json +10 -1
  25. package/react-native-maps-indoors-mapbox.podspec +3 -3
  26. package/specs/MapsIndoorsViewNativeComponent.ts +10 -0
  27. package/specs/NativeDirectionsRendererModule.ts +23 -0
  28. package/specs/NativeDirectionsServiceModule.ts +22 -0
  29. package/specs/NativeMPDisplayRuleModule.ts +155 -0
  30. package/specs/NativeMapControlModule.ts +62 -0
  31. package/specs/NativeMapsIndoorsModule.ts +43 -0
  32. package/specs/NativeUtilsModule.ts +21 -0
  33. package/src/core/MPDirectionsRenderer.ts +15 -0
  34. package/src/core/MPDirectionsService.ts +1 -1
@@ -11,117 +11,112 @@ import MapsIndoorsCore
11
11
 
12
12
  @objc(UtilsModule)
13
13
  public class UtilsModule: NSObject {
14
+ @objc public static func requiresMainQueueSetup() -> Bool { return false }
14
15
 
15
- @objc public static func requiresMainQueueSetup() -> Bool {return false}
16
-
17
16
  @objc public func venueHasGraph(_ venueId: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
18
17
  Task {
19
18
  guard let venue = await MPMapsIndoors.shared.venueWith(id: venueId) else {
20
19
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
21
20
  }
22
-
21
+
23
22
  return resolve(venue.hasGraph)
24
23
  }
25
24
  }
26
-
25
+
27
26
  @objc public func pointAngleBetween(_ point1: String, point2: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
28
-
29
27
  guard let it = try? JSONDecoder().decode(MPPoint.self, from: Data(point1.utf8)) as MPPoint else {
30
28
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
31
29
  }
32
-
30
+
33
31
  guard let other = try? JSONDecoder().decode(MPPoint.self, from: Data(point2.utf8)) as MPPoint else {
34
32
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
35
33
  }
36
-
34
+
37
35
  return resolve(MPGeometryUtils.bearingBetweenPoints(from: it.coordinate, to: other.coordinate))
38
36
  }
39
-
37
+
40
38
  @objc public func pointDistanceTo(_ point1: String, point2: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
41
39
  guard let it = try? JSONDecoder().decode(MPPoint.self, from: Data(point1.utf8)) as MPPoint else {
42
40
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
43
41
  }
44
-
42
+
45
43
  guard let other = try? JSONDecoder().decode(MPPoint.self, from: Data(point2.utf8)) as MPPoint else {
46
44
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
47
45
  }
48
-
46
+
49
47
  return resolve(MPGeometryUtils.distance(from: MPGeoPoint(coordinate: it.coordinate), to: MPGeoPoint(coordinate: other.coordinate)))
50
48
  }
51
-
49
+
52
50
  @objc public func geometryIsInside(_ point: String, geometry: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
53
51
  guard let it = try? JSONDecoder().decode(MPPoint.self, from: Data(point.utf8)) as MPPoint else {
54
52
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
55
53
  }
56
-
54
+
57
55
  guard let geo = try? JSONDecoder().decode(MPGeometry.self, from: Data(geometry.utf8)) as MPGeometry else {
58
56
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
59
57
  }
60
-
61
- if (geo is MPPolygonGeometry) {
58
+
59
+ if geo is MPPolygonGeometry {
62
60
  let poly = geo.mp_polygon
63
61
  return resolve(poly?.containsCoordinate(it.coordinate))
64
- }else if (geo is MPMultiPolygonGeometry) {
62
+ } else if geo is MPMultiPolygonGeometry {
65
63
  let multiPoly = geo.mp_multiPolygon
66
64
  resolve(multiPoly?.containsCoordinate(it.coordinate))
67
- }else {
65
+ } else {
68
66
  resolve(false)
69
67
  }
70
68
  }
71
-
69
+
72
70
  @objc public func geometryArea(_ geometry: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
73
-
74
71
  guard let geo = try? JSONDecoder().decode(MPGeometry.self, from: Data(geometry.utf8)) as MPGeometry else {
75
72
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
76
73
  }
77
-
78
- if (geo is MPPolygonGeometry) {
74
+
75
+ if geo is MPPolygonGeometry {
79
76
  let poly = geo.mp_polygon
80
77
  return resolve(poly?.area)
81
- }else if (geo is MPMultiPolygonGeometry) {
78
+ } else if geo is MPMultiPolygonGeometry {
82
79
  let multiPoly = geo.mp_multiPolygon
83
80
  return resolve(multiPoly?.area)
84
- }else {
81
+ } else {
85
82
  return resolve(0)
86
83
  }
87
84
  }
88
-
85
+
89
86
  @objc public func polygonDistanceToClosestEdge(_ point: String, geometry: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
90
-
91
87
  guard let it = try? JSONDecoder().decode(MPPoint.self, from: Data(point.utf8)) as MPPoint else {
92
88
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
93
89
  }
94
-
90
+
95
91
  guard let geo = try? JSONDecoder().decode(MPGeometry.self, from: Data(geometry.utf8)) as MPGeometry else {
96
92
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
97
93
  }
98
-
99
- if(geo is MPPolygonGeometry){
100
-
101
- guard let outerRing = (geo.mp_polygon.coordinates.first?.map {CLLocationCoordinate2D(latitude: $0.latitude, longitude: $0.longitude)}) else {
94
+
95
+ if geo is MPPolygonGeometry {
96
+ guard let outerRing = (geo.mp_polygon.coordinates.first?.map { CLLocationCoordinate2D(latitude: $0.latitude, longitude: $0.longitude) }) else {
102
97
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
103
98
  }
104
-
99
+
105
100
  var shortestDistance = Double.greatestFiniteMagnitude
106
- for i in 1 ..< outerRing.count {
107
- let p1 = outerRing[i-1]
101
+ for i in 1..<outerRing.count {
102
+ let p1 = outerRing[i - 1]
108
103
  let p2 = outerRing[i]
109
-
104
+
110
105
  let distanceToLine = MPGeometryUtils.distancePointToLine(point: it.coordinate, lineStart: p1, lineEnd: p2)
111
- if( distanceToLine < shortestDistance) {
106
+ if distanceToLine < shortestDistance {
112
107
  shortestDistance = distanceToLine
113
108
  }
114
109
  }
115
-
110
+
116
111
  return resolve(shortestDistance)
117
112
  }
118
113
  return resolve(nil)
119
114
  }
120
-
115
+
121
116
  @objc public func parseMapClientUrl(_ venueId: String, locationId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
122
117
  return resolve(MPMapsIndoors.shared.solution?.getMapClientUrlFor(venueId: venueId, locationId: locationId))
123
118
  }
124
-
119
+
125
120
  @objc public func setCollisionHandling(_ collisionHandling: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
126
121
  guard let collision = MPCollisionHandling.init(rawValue: collisionHandling.intValue) else {
127
122
  return reject("Utils error", "Venue not found for current Solution", MPError.unknownError)
@@ -129,17 +124,17 @@ public class UtilsModule: NSObject {
129
124
  MPMapsIndoors.shared.solution?.config.collisionHandling = collision
130
125
  return resolve(nil)
131
126
  }
132
-
127
+
133
128
  @objc public func enableClustering(_ enableClustering: Bool, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
134
129
  MPMapsIndoors.shared.solution?.config.enableClustering = enableClustering
135
130
  return resolve(nil)
136
131
  }
137
-
132
+
138
133
  @objc public func setExtrusionOpacity(_ opacity: Double, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
139
134
  MPMapsIndoors.shared.solution?.config.settings3D.extrusionOpacity = opacity
140
135
  return resolve(nil)
141
136
  }
142
-
137
+
143
138
  @objc public func setWallOpacity(_ opacity: Double, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
144
139
  MPMapsIndoors.shared.solution?.config.settings3D.wallOpacity = opacity
145
140
  return resolve(nil)
@@ -151,7 +146,7 @@ public class UtilsModule: NSObject {
151
146
  }
152
147
 
153
148
  @objc public func setSelectable(_ settingsId: String, value: Bool, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
154
- if (settingsId == "solution") {
149
+ if settingsId == "solution" {
155
150
  MPMapsIndoors.shared.solution?.config.locationSettings.selectable = value
156
151
  } else {
157
152
  if let location = MPMapsIndoors.shared.locationWith(locationId: settingsId) {
@@ -160,7 +155,7 @@ public class UtilsModule: NSObject {
160
155
  }
161
156
  location.locationSettings?.selectable = value
162
157
  } else {
163
- if let type = MPMapsIndoors.shared.solution?.types.first(where: {$0.name == settingsId}) {
158
+ if let type = MPMapsIndoors.shared.solution?.types.first(where: { $0.name == settingsId }) {
164
159
  if type.locationSettings == nil {
165
160
  type.locationSettings = MPLocationSettings()
166
161
  }
@@ -7,14 +7,15 @@ struct ErrorObject: Codable {
7
7
  public func asJSON() -> String {
8
8
  toJSON(self)
9
9
  }
10
- }; extension ErrorObject { // Don't want to lose default initializer, so this must be in an extension
10
+ }
11
+ extension ErrorObject { // Don't want to lose default initializer, so this must be in an extension
11
12
  init(from mpError: MPError) {
12
13
  code = mpError
13
14
  message = String(describing: mpError)
14
15
  }
15
16
  }
16
17
 
17
- public func toJSON<T:Encodable>(_ object: T) -> String {
18
+ public func toJSON<T: Encodable>(_ object: T) -> String {
18
19
  let encoder = JSONEncoder()
19
20
  let jsonData = try! encoder.encode(object)
20
21
  let jsonStr = String(data: jsonData, encoding: .utf8)!
@@ -22,36 +23,40 @@ public func toJSON<T:Encodable>(_ object: T) -> String {
22
23
  }
23
24
 
24
25
  /// Provide 'type: YourType.self' if the type cannot be inferred from the type of the parameter or variable it will be used in
25
- public func fromJSON<T:Decodable>(_ jsonString: String, type _: T.Type = T.self) throws -> T {
26
+ public func fromJSON<T: Decodable>(_ jsonString: String, type _: T.Type = T.self) throws -> T {
26
27
  let decoder = JSONDecoder()
27
28
  let result = try decoder.decode(T.self, from: jsonString.data(using: .utf8)!)
28
29
  return result
29
30
  }
30
31
 
31
32
  private func fileToClassName(_ file: String) -> String {
32
- return file
33
+ return
34
+ file
33
35
  .split(separator: "/").last?
34
36
  .split(separator: ".").first
35
- .map{String($0)} ?? file
37
+ .map { String($0) } ?? file
36
38
  }
37
39
 
38
40
  private func parsePrefix(file: String, func _func: String, line: Int, col: Int) -> String {
39
41
  let className = fileToClassName(file)
40
- let funcName: String = _func.split(separator: "(").first.map{String($0)} ?? _func
42
+ let funcName: String = _func.split(separator: "(").first.map { String($0) } ?? _func
41
43
  return "\(className).\(funcName):\(line):\(col)"
42
44
  }
43
45
 
44
- public func doReject(_ reject: RCTPromiseRejectBlock, message: String,
45
- _file: String = #fileID, _func: String = #function, _line: Int = #line, _col: Int = #column) {
46
+ public func doReject(
47
+ _ reject: RCTPromiseRejectBlock, message: String,
48
+ _file: String = #fileID, _func: String = #function, _line: Int = #line, _col: Int = #column
49
+ ) {
46
50
  let prefix = parsePrefix(file: _file, func: _func, line: _line, col: _col)
47
51
  let err = ErrorObject(code: .unknownError, message: "[\(prefix)] \(message)")
48
52
  return reject("NativeError", toJSON(err), err.code)
49
53
  }
50
54
 
51
- public func doReject(_ reject: RCTPromiseRejectBlock, error: Error,
52
- _file: String = #fileID, _func: String = #function, _line: Int = #line, _col: Int = #column) {
55
+ public func doReject(
56
+ _ reject: RCTPromiseRejectBlock, error: Error,
57
+ _file: String = #fileID, _func: String = #function, _line: Int = #line, _col: Int = #column
58
+ ) {
53
59
  let prefix = parsePrefix(file: _file, func: _func, line: _line, col: _col)
54
60
  let err = ErrorObject(code: .unknownError, message: "[\(prefix)] \(error)")
55
61
  return reject("NativeError", toJSON(err), error)
56
62
  }
57
-
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@mapsindoors/react-native-maps-indoors-mapbox",
3
3
  "title": "React Native MapsIndoors Mapbox",
4
- "version": "2.6.2-rc.1",
4
+ "version": "2.7.0",
5
5
  "description": "React Native MapsIndoors component with mapbox",
6
6
  "react-native": "index.ts",
7
7
  "files": [
8
8
  "src/",
9
+ "specs/",
9
10
  "README.md",
10
11
  "android",
11
12
  "index.ts",
@@ -50,5 +51,13 @@
50
51
  },
51
52
  "bugs": {
52
53
  "url": "https://github.com/MapsPeople/react-native-mapsindoors-mapbox/issues"
54
+ },
55
+ "codegenConfig": {
56
+ "name": "MapsIndoorsMapboxSpec",
57
+ "type": "all",
58
+ "jsSrcsDir": "specs",
59
+ "android": {
60
+ "javaPackageName": "com.mapsindoorsrn"
61
+ }
53
62
  }
54
63
  }
@@ -23,7 +23,7 @@ Pod::Spec.new do |s|
23
23
  s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}"
24
24
  s.requires_arc = true
25
25
 
26
- s.dependency "React"
27
- s.dependency "MapsIndoorsMapbox11", "4.15.6"
28
- s.dependency "MapsIndoorsCodable", "4.15.6"
26
+ install_modules_dependencies(s)
27
+ s.dependency "MapsIndoorsMapbox11", "4.17.2"
28
+ s.dependency "MapsIndoorsCodable", "4.17.2"
29
29
  end
@@ -0,0 +1,10 @@
1
+ import type {HostComponent, ViewProps} from 'react-native';
2
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
3
+
4
+ // The MapsIndoors map view has no custom props — it is controlled entirely
5
+ // via commands sent through UIManager / the MapControlModule.
6
+ export interface NativeProps extends ViewProps {}
7
+
8
+ export default codegenNativeComponent<NativeProps>(
9
+ 'MapsIndoorsView',
10
+ ) as HostComponent<NativeProps>;
@@ -0,0 +1,23 @@
1
+ import type {TurboModule} from 'react-native';
2
+ import {TurboModuleRegistry} from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ addListener(eventName: string): void;
6
+ removeListeners(count: number): void;
7
+
8
+ clear(): Promise<null>;
9
+ getSelectedLegFloorIndex(): Promise<number>;
10
+ nextLeg(): Promise<null>;
11
+ previousLeg(): Promise<null>;
12
+ selectLegIndex(legIndex: number): Promise<null>;
13
+ setCameraViewFitMode(cameraFitMode: number): Promise<null>;
14
+ setCameraAnimationDuration(duration: number): Promise<null>;
15
+ setOnLegSelectedListener(): Promise<null>;
16
+ setRoute(routeString: string, stopIcons: string, legIndex: number): Promise<null>;
17
+ setAnimatedPolyline(animated: boolean, repeated: boolean, duration: number): Promise<null>;
18
+ setPolyLineColors(foregroundString: string, backgroundString: string): Promise<null>;
19
+ showRouteLegButtons(value: boolean): Promise<null>;
20
+ setDefaultRouteStopIcon(iconString: string): Promise<null>;
21
+ }
22
+
23
+ export default TurboModuleRegistry.getEnforcing<Spec>('DirectionsRenderer');
@@ -0,0 +1,22 @@
1
+ import type {TurboModule} from 'react-native';
2
+ import {TurboModuleRegistry} from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ createService(): Promise<string>;
6
+ addAvoidWayType(wayType: string, id: string): Promise<null>;
7
+ clearWayType(id: string): Promise<null>;
8
+ addExcludeWayType(wayType: string, id: string): Promise<null>;
9
+ clearExcludeWayType(id: string): Promise<null>;
10
+ setIsDeparture(isDeparture: boolean, id: string): Promise<null>;
11
+ getRoute(
12
+ originString: string,
13
+ destinationString: string,
14
+ stops: Array<string> | null,
15
+ optimized: boolean,
16
+ id: string,
17
+ ): Promise<Object>;
18
+ setTravelMode(travelMode: string, id: string): Promise<null>;
19
+ setTime(time: number, id: string): Promise<null>;
20
+ }
21
+
22
+ export default TurboModuleRegistry.getEnforcing<Spec>('DirectionsService');
@@ -0,0 +1,155 @@
1
+ import type {TurboModule} from 'react-native';
2
+ import {TurboModuleRegistry} from 'react-native';
3
+
4
+ // Boolean setters pass values as serialized strings (matching existing native implementation)
5
+ export interface Spec extends TurboModule {
6
+ isVisible(displayRuleId: string): Promise<boolean | null>;
7
+ setVisible(displayRuleId: string, value: string): Promise<null>;
8
+ isIconVisible(displayRuleId: string): Promise<boolean | null>;
9
+ setIconVisible(displayRuleId: string, value: string): Promise<null>;
10
+ isPolygonVisible(displayRuleId: string): Promise<boolean | null>;
11
+ setPolygonVisible(displayRuleId: string, value: string): Promise<null>;
12
+ isLabelVisible(displayRuleId: string): Promise<boolean | null>;
13
+ setLabelVisible(displayRuleId: string, value: string): Promise<null>;
14
+ isModel2DVisible(displayRuleId: string): Promise<boolean | null>;
15
+ setModel2DVisible(displayRuleId: string, value: string): Promise<null>;
16
+ isWallVisible(displayRuleId: string): Promise<boolean | null>;
17
+ setWallVisible(displayRuleId: string, value: string): Promise<null>;
18
+ isExtrusionVisible(displayRuleId: string): Promise<boolean | null>;
19
+ setExtrusionVisible(displayRuleId: string, value: string): Promise<null>;
20
+ isBadgeVisible(displayRuleId: string): Promise<boolean | null>;
21
+ setBadgeVisible(displayRuleId: string, value: string): Promise<null>;
22
+ isModel3DVisible(displayRuleId: string): Promise<boolean | null>;
23
+ setModel3DVisible(displayRuleId: string, value: string): Promise<null>;
24
+
25
+ getZoomFrom(displayRuleId: string): Promise<number | null>;
26
+ setZoomFrom(displayRuleId: string, value: number): Promise<null>;
27
+ getZoomTo(displayRuleId: string): Promise<number | null>;
28
+ setZoomTo(displayRuleId: string, value: number): Promise<null>;
29
+
30
+ getIconUrl(displayRuleId: string): Promise<string | null>;
31
+ setIcon(displayRuleId: string, url: string): Promise<null>;
32
+ getIconSize(displayRuleId: string): Promise<string | null>;
33
+ setIconSize(displayRuleId: string, size: string): Promise<null>;
34
+ getIconScale(displayRuleId: string): Promise<number | null>;
35
+ setIconScale(displayRuleId: string, scale: number): Promise<null>;
36
+ getIconPlacement(displayRuleId: string): Promise<number | null>;
37
+ setIconPlacement(displayRuleId: string, placement: number): Promise<null>;
38
+
39
+ getLabel(displayRuleId: string): Promise<string | null>;
40
+ setLabel(displayRuleId: string, label: string): Promise<null>;
41
+ getLabelZoomFrom(displayRuleId: string): Promise<number | null>;
42
+ setLabelZoomFrom(displayRuleId: string, value: number): Promise<null>;
43
+ getLabelZoomTo(displayRuleId: string): Promise<number | null>;
44
+ setLabelZoomTo(displayRuleId: string, value: number): Promise<null>;
45
+ getLabelMaxWidth(displayRuleId: string): Promise<number | null>;
46
+ setLabelMaxWidth(displayRuleId: string, value: number): Promise<null>;
47
+ getLabelType(displayRuleId: string): Promise<number | null>;
48
+ setLabelType(displayRuleId: string, value: number): Promise<null>;
49
+ getLabelStyleTextSize(displayRuleId: string): Promise<number | null>;
50
+ setLabelStyleTextSize(displayRuleId: string, value: number): Promise<null>;
51
+ getLabelStyleTextColor(displayRuleId: string): Promise<string | null>;
52
+ setLabelStyleTextColor(displayRuleId: string, value: string): Promise<null>;
53
+ getLabelStyleHaloColor(displayRuleId: string): Promise<string | null>;
54
+ setLabelStyleHaloColor(displayRuleId: string, value: string): Promise<null>;
55
+ getLabelStyleTextOpacity(displayRuleId: string): Promise<number | null>;
56
+ setLabelStyleTextOpacity(displayRuleId: string, value: number): Promise<null>;
57
+ getLabelStyleHaloWidth(displayRuleId: string): Promise<number | null>;
58
+ setLabelStyleHaloWidth(displayRuleId: string, value: number): Promise<null>;
59
+ getLabelStyleHaloBlur(displayRuleId: string): Promise<number | null>;
60
+ setLabelStyleHaloBlur(displayRuleId: string, value: number): Promise<null>;
61
+ getLabelStyleBearing(displayRuleId: string): Promise<number | null>;
62
+ setLabelStyleBearing(displayRuleId: string, value: number): Promise<null>;
63
+ getLabelStylePosition(displayRuleId: string): Promise<number | null>;
64
+ setLabelStylePosition(displayRuleId: string, value: number): Promise<null>;
65
+ getLabelStyleGraphic(displayRuleId: string): Promise<string | null>;
66
+ setLabelStyleGraphic(displayRuleId: string, value: string): Promise<null>;
67
+
68
+ getPolygonZoomFrom(displayRuleId: string): Promise<number | null>;
69
+ setPolygonZoomFrom(displayRuleId: string, value: number): Promise<null>;
70
+ getPolygonZoomTo(displayRuleId: string): Promise<number | null>;
71
+ setPolygonZoomTo(displayRuleId: string, value: number): Promise<null>;
72
+ getPolygonStrokeWidth(displayRuleId: string): Promise<number | null>;
73
+ setPolygonStrokeWidth(displayRuleId: string, value: number): Promise<null>;
74
+ getPolygonStrokeColor(displayRuleId: string): Promise<string | null>;
75
+ setPolygonStrokeColor(displayRuleId: string, value: string): Promise<null>;
76
+ getPolygonStrokeOpacity(displayRuleId: string): Promise<number | null>;
77
+ setPolygonStrokeOpacity(displayRuleId: string, value: number): Promise<null>;
78
+ getPolygonFillColor(displayRuleId: string): Promise<string | null>;
79
+ setPolygonFillColor(displayRuleId: string, value: string): Promise<null>;
80
+ getPolygonFillOpacity(displayRuleId: string): Promise<number | null>;
81
+ setPolygonFillOpacity(displayRuleId: string, value: number): Promise<null>;
82
+ getPolygonLightnessFactor(displayRuleId: string): Promise<number | null>;
83
+ setPolygonLightnessFactor(displayRuleId: string, value: number): Promise<null>;
84
+
85
+ getWallColor(displayRuleId: string): Promise<string | null>;
86
+ setWallColor(displayRuleId: string, value: string): Promise<null>;
87
+ getWallHeight(displayRuleId: string): Promise<number | null>;
88
+ setWallHeight(displayRuleId: string, value: number): Promise<null>;
89
+ getWallZoomFrom(displayRuleId: string): Promise<number | null>;
90
+ setWallZoomFrom(displayRuleId: string, value: number): Promise<null>;
91
+ getWallZoomTo(displayRuleId: string): Promise<number | null>;
92
+ setWallZoomTo(displayRuleId: string, value: number): Promise<null>;
93
+ getWallLightnessFactor(displayRuleId: string): Promise<number | null>;
94
+ setWallLightnessFactor(displayRuleId: string, value: number): Promise<null>;
95
+
96
+ getExtrusionColor(displayRuleId: string): Promise<string | null>;
97
+ setExtrusionColor(displayRuleId: string, value: string): Promise<null>;
98
+ getExtrusionHeight(displayRuleId: string): Promise<number | null>;
99
+ setExtrusionHeight(displayRuleId: string, value: number): Promise<null>;
100
+ getExtrusionZoomFrom(displayRuleId: string): Promise<number | null>;
101
+ setExtrusionZoomFrom(displayRuleId: string, value: number): Promise<null>;
102
+ getExtrusionZoomTo(displayRuleId: string): Promise<number | null>;
103
+ setExtrusionZoomTo(displayRuleId: string, value: number): Promise<null>;
104
+ getExtrusionLightnessFactor(displayRuleId: string): Promise<number | null>;
105
+ setExtrusionLightnessFactor(displayRuleId: string, value: number): Promise<null>;
106
+
107
+ getModel2DZoomFrom(displayRuleId: string): Promise<number | null>;
108
+ setModel2DZoomFrom(displayRuleId: string, value: number): Promise<null>;
109
+ getModel2DZoomTo(displayRuleId: string): Promise<number | null>;
110
+ setModel2DZoomTo(displayRuleId: string, value: number): Promise<null>;
111
+ getModel2DWidthMeters(displayRuleId: string): Promise<number | null>;
112
+ setModel2DWidthMeters(displayRuleId: string, value: number): Promise<null>;
113
+ getModel2DHeightMeters(displayRuleId: string): Promise<number | null>;
114
+ setModel2DHeightMeters(displayRuleId: string, value: number): Promise<null>;
115
+ getModel2DBearing(displayRuleId: string): Promise<number | null>;
116
+ setModel2DBearing(displayRuleId: string, value: number): Promise<null>;
117
+ getModel2DModel(displayRuleId: string): Promise<string | null>;
118
+ setModel2DModel(displayRuleId: string, value: string): Promise<null>;
119
+
120
+ getBadgeFillColor(displayRuleId: string): Promise<string | null>;
121
+ setBadgeFillColor(displayRuleId: string, value: string): Promise<null>;
122
+ getBadgeStrokeColor(displayRuleId: string): Promise<string | null>;
123
+ setBadgeStrokeColor(displayRuleId: string, value: string): Promise<null>;
124
+ getBadgeRadius(displayRuleId: string): Promise<number | null>;
125
+ setBadgeRadius(displayRuleId: string, value: number): Promise<null>;
126
+ getBadgeStrokeWidth(displayRuleId: string): Promise<number | null>;
127
+ setBadgeStrokeWidth(displayRuleId: string, value: number): Promise<null>;
128
+ getBadgePosition(displayRuleId: string): Promise<number | null>;
129
+ setBadgePosition(displayRuleId: string, value: number): Promise<null>;
130
+ getBadgeScale(displayRuleId: string): Promise<number | null>;
131
+ setBadgeScale(displayRuleId: string, value: number): Promise<null>;
132
+ getBadgeZoomFrom(displayRuleId: string): Promise<number | null>;
133
+ setBadgeZoomFrom(displayRuleId: string, value: number): Promise<null>;
134
+ getBadgeZoomTo(displayRuleId: string): Promise<number | null>;
135
+ setBadgeZoomTo(displayRuleId: string, value: number): Promise<null>;
136
+
137
+ getModel3DModel(displayRuleId: string): Promise<string | null>;
138
+ setModel3DModel(displayRuleId: string, value: string): Promise<null>;
139
+ getModel3DRotationX(displayRuleId: string): Promise<number | null>;
140
+ setModel3DRotationX(displayRuleId: string, value: number): Promise<null>;
141
+ getModel3DRotationY(displayRuleId: string): Promise<number | null>;
142
+ setModel3DRotationY(displayRuleId: string, value: number): Promise<null>;
143
+ getModel3DRotationZ(displayRuleId: string): Promise<number | null>;
144
+ setModel3DRotationZ(displayRuleId: string, value: number): Promise<null>;
145
+ getModel3DScale(displayRuleId: string): Promise<number | null>;
146
+ setModel3DScale(displayRuleId: string, value: number): Promise<null>;
147
+ getModel3DZoomFrom(displayRuleId: string): Promise<number | null>;
148
+ setModel3DZoomFrom(displayRuleId: string, value: number): Promise<null>;
149
+ getModel3DZoomTo(displayRuleId: string): Promise<number | null>;
150
+ setModel3DZoomTo(displayRuleId: string, value: number): Promise<null>;
151
+
152
+ reset(displayRuleId: string): Promise<null>;
153
+ }
154
+
155
+ export default TurboModuleRegistry.getEnforcing<Spec>('DisplayRule');
@@ -0,0 +1,62 @@
1
+ import type {TurboModule} from 'react-native';
2
+ import {TurboModuleRegistry} from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ addListener(eventName: string): void;
6
+ removeListeners(count: number): void;
7
+
8
+ initMapControl(config: Object): Promise<null>;
9
+ clearFilter(): Promise<null>;
10
+ setFilter(filterJSON: string, filterBehaviorJSON: string): Promise<boolean>;
11
+ setFilterWithLocations(locationIdsJSON: string, filterBehaviorJSON: string): Promise<boolean>;
12
+ setHighlight(locationIdsJSON: string, highlightBehaviorJSON: string): Promise<boolean>;
13
+ clearHighlight(): Promise<null>;
14
+ showUserPosition(show: boolean): Promise<null>;
15
+ isUserPositionShown(): Promise<boolean>;
16
+ goTo(entityJSON: string, entityType: string, maxZoom: number): Promise<null>;
17
+ getCurrentVenue(): Promise<string | null>;
18
+ getCurrentBuilding(): Promise<string | null>;
19
+ selectVenue(venueJSON: string, moveCamera: boolean): Promise<null>;
20
+ selectBuilding(buildingJSON: string, moveCamera: boolean): Promise<null>;
21
+ selectLocation(locationJSON: string, behaviorJSON: string): Promise<null>;
22
+ selectLocationWithId(locationId: string, behaviorJSON: string): Promise<null>;
23
+ setMapPadding(start: number, top: number, end: number, bottom: number): Promise<null>;
24
+ getMapViewPaddingStart(): Promise<number>;
25
+ getMapViewPaddingTop(): Promise<number>;
26
+ getMapViewPaddingEnd(): Promise<number>;
27
+ getMapViewPaddingBottom(): Promise<number>;
28
+ setMapStyle(mapStyleJSON: string): Promise<null>;
29
+ getMapStyle(): Promise<string | null>;
30
+ showInfoWindowOnClickedLocation(show: boolean): Promise<null>;
31
+ deSelectLocation(): Promise<null>;
32
+ getCurrentBuildingFloor(): Promise<string | null>;
33
+ getCurrentFloorIndex(): Promise<number>;
34
+ getCurrentMapsIndoorsZoom(): Promise<number>;
35
+ selectFloor(floorIndex: number): Promise<null>;
36
+ isFloorSelectorHidden(): Promise<boolean>;
37
+ hideFloorSelector(hide: boolean): Promise<null>;
38
+ enableLiveData(domainType: string, hasListener: boolean): Promise<null>;
39
+ disableLiveData(domainType: string): Promise<null>;
40
+ animateCamera(updateJSON: string, duration: number): Promise<null>;
41
+ moveCamera(updateJSON: string): Promise<null>;
42
+ getCurrentCameraPosition(): Promise<string>;
43
+ setFloorSelector(setup: boolean, isAutoFloorChangeEnabled: boolean): Promise<null>;
44
+ onFloorSelectionChanged(floorJSON: string): void;
45
+ setLabelOptions(textSize: number, color: string, showHalo: boolean): Promise<null>;
46
+ setOnMapClickListener(setup: boolean, consumeEvent: boolean): void;
47
+ setOnLocationSelectedListener(setup: boolean, consumeEvent: boolean): void;
48
+ setOnCurrentVenueChangedListener(setup: boolean): void;
49
+ setOnCurrentBuildingChangedListener(setup: boolean): void;
50
+ setOnMarkerClickListener(setup: boolean, consumeEvent: boolean): void;
51
+ setOnMarkerInfoWindowClickListener(setup: boolean): void;
52
+ setMPCameraEventListener(setup: boolean): void;
53
+ setOnFloorUpdateListener(setup: boolean): void;
54
+ setBuildingSelectionMode(selectionMode: number): Promise<null>;
55
+ getBuildingSelectionMode(): Promise<number>;
56
+ setFloorSelectionMode(selectionMode: number): Promise<null>;
57
+ getFloorSelectionMode(): Promise<number>;
58
+ setHiddenFeatures(featuresJSON: string): Promise<null>;
59
+ getHiddenFeatures(): Promise<string>;
60
+ }
61
+
62
+ export default TurboModuleRegistry.getEnforcing<Spec>('MapControlModule');
@@ -0,0 +1,43 @@
1
+ import type {TurboModule} from 'react-native';
2
+ import {TurboModuleRegistry} from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ loadMapsIndoors(apiKey: string, optionalStrings: Array<string> | null): Promise<null>;
6
+ getDefaultVenue(): Promise<string | null>;
7
+ getVenues(): Promise<string>;
8
+ getBuildings(): Promise<string>;
9
+ getCategories(): Promise<string>;
10
+ getLocations(): Promise<string>;
11
+ disableEventLogging(disable: boolean): Promise<null>;
12
+ getApiKey(): Promise<string>;
13
+ getAvailableLanguages(): Promise<Array<string>>;
14
+ getDefaultLanguage(): Promise<string>;
15
+ getLanguage(): Promise<string>;
16
+ getLocationById(id: string): Promise<string | null>;
17
+ getLocationsByExternalIds(ids: Array<string>): Promise<string>;
18
+ getMapStyles(): Promise<string>;
19
+ getSolution(): Promise<string | null>;
20
+ getLocationsAsync(query: string, filter: string): Promise<string>;
21
+ locationDisplayRuleExists(locationId: string): Promise<boolean>;
22
+ displayRuleNameExists(name: string): Promise<boolean>;
23
+ setPositionProvider(positionProviderName: string): Promise<null>;
24
+ removePositionProvider(): Promise<null>;
25
+ onPositionUpdate(position: string): void;
26
+ getUserRoles(): Promise<string>;
27
+ checkOfflineDataAvailability(): Promise<boolean>;
28
+ destroy(): Promise<null>;
29
+ isApiKeyValid(): Promise<boolean>;
30
+ isInitialized(): Promise<boolean>;
31
+ isReady(): Promise<boolean>;
32
+ setLanguage(lang: string): Promise<boolean>;
33
+ synchronizeContent(): Promise<null>;
34
+ applyUserRoles(userRolesString: string): Promise<null>;
35
+ getAppliedUserRoles(): Promise<string | null>;
36
+ reverseGeoCode(pointString: string): Promise<string>;
37
+ addVenuesToSync(venues: Array<string>): Promise<null>;
38
+ removeVenuesToSync(venues: Array<string>): Promise<null>;
39
+ getSyncedVenues(): Promise<Array<string> | null>;
40
+ cacheData(apiKey: string): Promise<boolean>;
41
+ }
42
+
43
+ export default TurboModuleRegistry.getEnforcing<Spec>('MapsIndoorsModule');
@@ -0,0 +1,21 @@
1
+ import type {TurboModule} from 'react-native';
2
+ import {TurboModuleRegistry} from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ venueHasGraph(venueId: string): Promise<boolean>;
6
+ pointAngleBetween(point1: string, point2: string): Promise<number>;
7
+ pointDistanceTo(point1: string, point2: string): Promise<number>;
8
+ geometryIsInside(point: string, geometry: string): Promise<boolean>;
9
+ geometryArea(geometry: string): Promise<number>;
10
+ polygonDistanceToClosestEdge(point: string, geometry: string): Promise<number>;
11
+ parseMapClientUrl(venueId: string, locationId: string): Promise<string>;
12
+ setCollisionHandling(collisionHandling: number): Promise<null>;
13
+ enableClustering(value: boolean): Promise<null>;
14
+ setExtrusionOpacity(opacity: number): Promise<null>;
15
+ setWallOpacity(opacity: number): Promise<null>;
16
+ setNewSelection(value: boolean): Promise<null>;
17
+ setSelectable(settingsId: string, value: boolean): Promise<null>;
18
+ setAutomatedZoomLimit(limit: number): Promise<null>;
19
+ }
20
+
21
+ export default TurboModuleRegistry.getEnforcing<Spec>('UtilsModule');