react-native-pointr 9.1.0 → 9.3.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.
- package/API_REFERENCE.md +887 -0
- package/CHANGELOG.md +35 -0
- package/EXTENDING.md +419 -0
- package/README.md +221 -117
- package/WAYFINDING_EVENTS.md +243 -0
- package/android/build.gradle +3 -16
- package/android/src/main/java/com/pointr/PTRCoreExtensions.kt +126 -0
- package/android/src/main/java/com/pointr/PTRMapWidgetCommandType.kt +3 -1
- package/android/src/main/java/com/pointr/PTRMapWidgetManager.kt +160 -11
- package/android/src/main/java/com/pointr/PointrModule.kt +106 -3
- package/example/pointr_rn_demo/.bundle/config +2 -0
- package/example/pointr_rn_demo/.eslintrc.js +4 -0
- package/example/pointr_rn_demo/.prettierrc.js +5 -0
- package/example/pointr_rn_demo/.watchmanconfig +1 -0
- package/example/pointr_rn_demo/App.tsx +323 -0
- package/example/pointr_rn_demo/Gemfile +16 -0
- package/example/pointr_rn_demo/Gemfile.lock +111 -0
- package/example/pointr_rn_demo/README.md +188 -0
- package/example/pointr_rn_demo/__tests__/App.test.tsx +13 -0
- package/example/pointr_rn_demo/android/app/build.gradle +119 -0
- package/example/pointr_rn_demo/android/app/debug.keystore +0 -0
- package/example/pointr_rn_demo/android/app/proguard-rules.pro +10 -0
- package/example/pointr_rn_demo/android/app/src/main/AndroidManifest.xml +27 -0
- package/example/pointr_rn_demo/android/app/src/main/java/com/pointr_rn_demo/MainActivity.kt +22 -0
- package/example/pointr_rn_demo/android/app/src/main/java/com/pointr_rn_demo/MainApplication.kt +27 -0
- package/example/pointr_rn_demo/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/pointr_rn_demo/android/app/src/main/res/values/strings.xml +3 -0
- package/example/pointr_rn_demo/android/app/src/main/res/values/styles.xml +9 -0
- package/example/pointr_rn_demo/android/build.gradle +32 -0
- package/example/pointr_rn_demo/android/gradle.properties +44 -0
- package/example/pointr_rn_demo/android/settings.gradle +6 -0
- package/example/pointr_rn_demo/app.json +4 -0
- package/example/pointr_rn_demo/babel.config.js +3 -0
- package/example/pointr_rn_demo/index.js +16 -0
- package/example/pointr_rn_demo/ios/.xcode.env +11 -0
- package/example/pointr_rn_demo/ios/Podfile +40 -0
- package/example/pointr_rn_demo/ios/Podfile.lock +2767 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo/AppDelegate.swift +48 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo/Images.xcassets/Contents.json +6 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo/Info.plist +63 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo/LaunchScreen.storyboard +47 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo/PrivacyInfo.xcprivacy +37 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo.xcodeproj/project.pbxproj +496 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo.xcodeproj/xcshareddata/xcschemes/pointr_rn_demo.xcscheme +88 -0
- package/example/pointr_rn_demo/ios/pointr_rn_demo.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/pointr_rn_demo/jest.config.js +3 -0
- package/example/pointr_rn_demo/metro.config.js +22 -0
- package/example/pointr_rn_demo/package-lock.json +11747 -0
- package/example/pointr_rn_demo/package.json +46 -0
- package/example/pointr_rn_demo/prepare-demo-distribution.sh +103 -0
- package/example/pointr_rn_demo/tsconfig.json +5 -0
- package/ios/PTRMapWidgetContainerView.swift +59 -7
- package/ios/PTRMapWidgetManager-Bridging.m +65 -1
- package/ios/PTRMapWidgetManager.swift +185 -144
- package/ios/PTRNativeLibrary-Bridging.m +4 -0
- package/ios/PTRNativeLibrary.swift +244 -18
- package/package.json +16 -2
- package/prepare-distribution.sh +84 -0
- package/react-native-pointr.podspec +1 -1
- package/src/PTRCommand.ts +34 -1
- package/src/PTRMapWidgetUtils.ts +105 -5
- package/src/PTRPoiManager.ts +20 -0
- package/src/index.tsx +40 -1
- package/src/types/PTRGeometry.ts +70 -0
- package/src/types/PTRPoi.ts +49 -0
- package/src/types/PTRPosition.ts +22 -0
- package/src/types/PTRWayfindingEvent.ts +18 -0
|
@@ -17,146 +17,130 @@ public class PTRMapWidgetManager: RCTViewManager {
|
|
|
17
17
|
return "PTRMapWidget"
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
@objc func site(_ reactTag: NSNumber, siteExternalIdentifier: String) {
|
|
20
|
+
private func focus(_ reactTag: NSNumber, location: PTRMapWidgetLocation, commandParameters: [String: Any]) {
|
|
22
21
|
self.bridge.uiManager.addUIBlock { (uiManager, viewRegistry) in
|
|
23
22
|
guard let ptrMapWidgetContainerView = uiManager?.view(forReactTag: reactTag) as? PTRMapWidgetContainerView else {
|
|
24
23
|
print("Cannot find PTRMapWidgetContainerView with tag #\(reactTag)")
|
|
25
24
|
return
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
39
|
-
}
|
|
40
|
-
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
41
|
-
print("calling show site method of mapWidget")
|
|
42
|
-
ptrMapWidgetContainerView.present(mapWidget)
|
|
43
|
-
}
|
|
27
|
+
let action = PTRMapWidgetMapFocusAction(location: location, completion: { error in
|
|
28
|
+
var ptrCommand = commandParameters
|
|
29
|
+
ptrCommand["error"] = error?.errorCode ?? ""
|
|
30
|
+
print("calling ptrMapWidgetDidEndLoading with parameters: \(ptrCommand)")
|
|
31
|
+
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
35
|
+
print("calling show \(commandParameters["command"] ?? "unknown") method of mapWidget")
|
|
36
|
+
ptrMapWidgetContainerView.present(mapWidget)
|
|
44
37
|
}
|
|
45
38
|
}
|
|
46
39
|
|
|
40
|
+
@objc func site(_ reactTag: NSNumber, siteExternalIdentifier: String) {
|
|
41
|
+
let siteLocation = PTRMapWidgetSiteLocation(siteIdentifier: siteExternalIdentifier, isExternalIdentifiers: true)
|
|
42
|
+
let commandParameters: [String: Any] = [
|
|
43
|
+
"command": "site",
|
|
44
|
+
"siteExternalIdentifier": siteExternalIdentifier
|
|
45
|
+
]
|
|
46
|
+
focus(reactTag, location: siteLocation, commandParameters: commandParameters)
|
|
47
|
+
}
|
|
48
|
+
|
|
47
49
|
@objc func building(_ reactTag: NSNumber, siteExternalIdentifier: String, buildingExternalIdentifier: String) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
let action = PTRMapWidgetMapFocusAction(location: PTRMapWidgetBuildingLocation(siteIdentifier: siteExternalIdentifier, buildingIdentifier: buildingExternalIdentifier, isExternalIdentifiers: true))
|
|
56
|
-
action.completion = { error in
|
|
57
|
-
let ptrCommand: [String: Any] = [
|
|
58
|
-
"command": "building",
|
|
59
|
-
"siteExternalIdentifier": siteExternalIdentifier,
|
|
60
|
-
"buildingExternalIdentifier": buildingExternalIdentifier,
|
|
61
|
-
"error": error?.errorCode ?? ""
|
|
62
|
-
]
|
|
63
|
-
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
64
|
-
}
|
|
65
|
-
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
66
|
-
print("calling show building method of mapWidget")
|
|
67
|
-
ptrMapWidgetContainerView.present(mapWidget)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
50
|
+
let buildingLocation = PTRMapWidgetBuildingLocation(siteIdentifier: siteExternalIdentifier, buildingIdentifier: buildingExternalIdentifier, isExternalIdentifiers: true)
|
|
51
|
+
let commandParameters: [String: Any] = [
|
|
52
|
+
"command": "building",
|
|
53
|
+
"siteExternalIdentifier": siteExternalIdentifier,
|
|
54
|
+
"buildingExternalIdentifier": buildingExternalIdentifier
|
|
55
|
+
]
|
|
56
|
+
focus(reactTag, location: buildingLocation, commandParameters: commandParameters)
|
|
70
57
|
}
|
|
71
58
|
|
|
72
59
|
@objc func level(_ reactTag: NSNumber, siteExternalIdentifier: String, buildingExternalIdentifier: String, levelIndex: Int) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
action.completion = { error in
|
|
82
|
-
let ptrCommand: [String: Any] = [
|
|
83
|
-
"command": "level",
|
|
84
|
-
"siteExternalIdentifier": siteExternalIdentifier,
|
|
85
|
-
"buildingExternalIdentifier": buildingExternalIdentifier,
|
|
86
|
-
"levelIndex": levelIndex,
|
|
87
|
-
"error": error?.errorCode ?? ""
|
|
88
|
-
]
|
|
89
|
-
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
90
|
-
}
|
|
91
|
-
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
92
|
-
print("calling show level method of mapWidget")
|
|
93
|
-
ptrMapWidgetContainerView.present(mapWidget)
|
|
94
|
-
}
|
|
95
|
-
}
|
|
60
|
+
let levelLocation = PTRMapWidgetLevelLocation(siteIdentifier: siteExternalIdentifier, buildingIdentifier: buildingExternalIdentifier, levelIndex: levelIndex, isExternalIdentifiers: true)
|
|
61
|
+
let commandParameters: [String: Any] = [
|
|
62
|
+
"command": "level",
|
|
63
|
+
"siteExternalIdentifier": siteExternalIdentifier,
|
|
64
|
+
"buildingExternalIdentifier": buildingExternalIdentifier,
|
|
65
|
+
"levelIndex": levelIndex
|
|
66
|
+
]
|
|
67
|
+
focus(reactTag, location: levelLocation, commandParameters: commandParameters)
|
|
96
68
|
}
|
|
97
69
|
|
|
98
70
|
@objc func poi(_ reactTag: NSNumber, siteExternalIdentifier: String, poiExternalIdentifier: String) {
|
|
71
|
+
let poiLocation = PTRMapWidgetPoiLocation(siteIdentifier: siteExternalIdentifier, poiIdentifier: poiExternalIdentifier, isExternalIdentifiers: true)
|
|
72
|
+
let commandParameters: [String: Any] = [
|
|
73
|
+
"command": "poi",
|
|
74
|
+
"siteExternalIdentifier": siteExternalIdentifier,
|
|
75
|
+
"poiExternalIdentifier": poiExternalIdentifier
|
|
76
|
+
]
|
|
77
|
+
focus(reactTag, location: poiLocation, commandParameters: commandParameters)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@objc func path(_ reactTag: NSNumber, siteExternalIdentifier: String, toPoiExternalIdentifier: String) {
|
|
99
81
|
self.bridge.uiManager.addUIBlock { (uiManager, viewRegistry) in
|
|
100
82
|
guard let ptrMapWidgetContainerView = uiManager?.view(forReactTag: reactTag) as? PTRMapWidgetContainerView else {
|
|
101
83
|
print("Cannot find PTRMapWidgetContainerView with tag #\(reactTag)")
|
|
102
84
|
return
|
|
103
85
|
}
|
|
104
86
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
117
|
-
print("calling show poi method of mapWidget")
|
|
118
|
-
ptrMapWidgetContainerView.present(mapWidget)
|
|
87
|
+
|
|
88
|
+
let action = PTRMapWidgetWayfindingAction(poiDestination: PTRMapWidgetPoiLocation(siteIdentifier: siteExternalIdentifier, poiIdentifier: toPoiExternalIdentifier, isExternalIdentifiers: true))
|
|
89
|
+
action.completion = { error in
|
|
90
|
+
let ptrCommand: [String: Any] = [
|
|
91
|
+
"command": "path",
|
|
92
|
+
"siteExternalIdentifier": siteExternalIdentifier,
|
|
93
|
+
"poiExternalIdentifier": toPoiExternalIdentifier,
|
|
94
|
+
"error": error?.errorCode ?? ""
|
|
95
|
+
]
|
|
96
|
+
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
119
97
|
}
|
|
98
|
+
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
99
|
+
print("calling show path method of mapWidget")
|
|
100
|
+
ptrMapWidgetContainerView.present(mapWidget)
|
|
120
101
|
}
|
|
121
102
|
}
|
|
122
103
|
|
|
123
|
-
@objc func
|
|
104
|
+
@objc func staticPath(_ reactTag: NSNumber, siteExternalIdentifier: String, fromPoiExternalIdentifier: String, toPoiExternalIdentifier: String) {
|
|
124
105
|
self.bridge.uiManager.addUIBlock { (uiManager, viewRegistry) in
|
|
125
106
|
guard let ptrMapWidgetContainerView = uiManager?.view(forReactTag: reactTag) as? PTRMapWidgetContainerView else {
|
|
126
107
|
print("Cannot find PTRMapWidgetContainerView with tag #\(reactTag)")
|
|
127
108
|
return
|
|
128
109
|
}
|
|
129
110
|
|
|
130
|
-
DispatchQueue.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"command": "path",
|
|
135
|
-
"siteExternalIdentifier": siteExternalIdentifier,
|
|
136
|
-
"poiExternalIdentifier": toPoiExternalIdentifier,
|
|
137
|
-
"error": error?.errorCode ?? ""
|
|
138
|
-
]
|
|
139
|
-
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
140
|
-
}
|
|
141
|
-
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
142
|
-
print("calling show path method of mapWidget")
|
|
143
|
-
ptrMapWidgetContainerView.present(mapWidget)
|
|
111
|
+
DispatchQueue.global(qos: .default).async {
|
|
112
|
+
ptrMapWidgetContainerView.showStaticPath(siteExternalIdentifier,
|
|
113
|
+
fromPoiExternalIdentifier: fromPoiExternalIdentifier,
|
|
114
|
+
toPoiExternalIdentifier: toPoiExternalIdentifier)
|
|
144
115
|
}
|
|
145
116
|
}
|
|
146
117
|
}
|
|
147
118
|
|
|
148
|
-
@objc func
|
|
119
|
+
@objc func staticWayfinding(_ reactTag: NSNumber, siteExternalIdentifier: String, sourcePoiExternalIdentifier: String, destinationPoiExternalIdentifier: String) {
|
|
149
120
|
self.bridge.uiManager.addUIBlock { (uiManager, viewRegistry) in
|
|
150
121
|
guard let ptrMapWidgetContainerView = uiManager?.view(forReactTag: reactTag) as? PTRMapWidgetContainerView else {
|
|
151
122
|
print("Cannot find PTRMapWidgetContainerView with tag #\(reactTag)")
|
|
152
123
|
return
|
|
153
124
|
}
|
|
154
125
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
126
|
+
let sourcePoiLocation = PTRMapWidgetPoiLocation(siteIdentifier: siteExternalIdentifier, poiIdentifier: sourcePoiExternalIdentifier, isExternalIdentifiers: true)
|
|
127
|
+
let destinationPoiLocation = PTRMapWidgetPoiLocation(siteIdentifier: siteExternalIdentifier, poiIdentifier: destinationPoiExternalIdentifier, isExternalIdentifiers: true)
|
|
128
|
+
|
|
129
|
+
let action = PTRMapWidgetStaticWayfindingAction(poiSource: sourcePoiLocation, poiDestination: destinationPoiLocation)
|
|
130
|
+
action.completion = { error in
|
|
131
|
+
let ptrCommand: [String: Any] = [
|
|
132
|
+
"command": "staticWayfinding",
|
|
133
|
+
"siteExternalIdentifier": siteExternalIdentifier,
|
|
134
|
+
"sourcePoiExternalIdentifier": sourcePoiExternalIdentifier,
|
|
135
|
+
"destinationPoiExternalIdentifier": destinationPoiExternalIdentifier,
|
|
136
|
+
"error": error?.localizedDescription ?? ""
|
|
137
|
+
]
|
|
138
|
+
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
159
139
|
}
|
|
140
|
+
|
|
141
|
+
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
142
|
+
print("calling show static wayfinding method of mapWidget")
|
|
143
|
+
ptrMapWidgetContainerView.present(mapWidget)
|
|
160
144
|
}
|
|
161
145
|
}
|
|
162
146
|
|
|
@@ -167,24 +151,22 @@ public class PTRMapWidgetManager: RCTViewManager {
|
|
|
167
151
|
return
|
|
168
152
|
}
|
|
169
153
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
183
|
-
}
|
|
184
|
-
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
185
|
-
print("calling show mark my car method of mapWidget")
|
|
186
|
-
ptrMapWidgetContainerView.present(mapWidget)
|
|
154
|
+
let action = PTRMapWidgetMarkMyCarAction(levelLocation: PTRMapWidgetLevelLocation(siteIdentifier: siteExternalIdentifier, buildingIdentifier: buildingExternalIdentifier, levelIndex: levelIndex, isExternalIdentifiers: true), shouldShowPopup: shouldShowPopup)
|
|
155
|
+
action.completion = { error in
|
|
156
|
+
let ptrCommand: [String: Any] = [
|
|
157
|
+
"command": "markMyCarForLevel",
|
|
158
|
+
"siteExternalIdentifier": siteExternalIdentifier,
|
|
159
|
+
"buildingExternalIdentifier": buildingExternalIdentifier,
|
|
160
|
+
"levelIndex": levelIndex,
|
|
161
|
+
"shouldShowPopup": shouldShowPopup,
|
|
162
|
+
"animationType": animationType,
|
|
163
|
+
"error": error?.errorCode ?? ""
|
|
164
|
+
]
|
|
165
|
+
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
187
166
|
}
|
|
167
|
+
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
168
|
+
print("calling show mark my car method of mapWidget")
|
|
169
|
+
ptrMapWidgetContainerView.present(mapWidget)
|
|
188
170
|
}
|
|
189
171
|
}
|
|
190
172
|
|
|
@@ -195,22 +177,20 @@ public class PTRMapWidgetManager: RCTViewManager {
|
|
|
195
177
|
return
|
|
196
178
|
}
|
|
197
179
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
209
|
-
}
|
|
210
|
-
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
211
|
-
print("calling show mark my car method of mapWidget")
|
|
212
|
-
ptrMapWidgetContainerView.present(mapWidget)
|
|
180
|
+
let action = PTRMapWidgetMarkMyCarAction(siteLocation: PTRMapWidgetSiteLocation(siteIdentifier: siteExternalIdentifier, isExternalIdentifiers: true), shouldShowPopup: shouldShowPopup)
|
|
181
|
+
action.completion = { error in
|
|
182
|
+
let ptrCommand: [String: Any] = [
|
|
183
|
+
"command": "markMyCarForSite",
|
|
184
|
+
"siteExternalIdentifier": siteExternalIdentifier,
|
|
185
|
+
"shouldShowPopup": shouldShowPopup,
|
|
186
|
+
"animationType": animationType,
|
|
187
|
+
"error": error?.errorCode ?? ""
|
|
188
|
+
]
|
|
189
|
+
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
213
190
|
}
|
|
191
|
+
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
192
|
+
print("calling show mark my car method of mapWidget")
|
|
193
|
+
ptrMapWidgetContainerView.present(mapWidget)
|
|
214
194
|
}
|
|
215
195
|
}
|
|
216
196
|
|
|
@@ -221,22 +201,83 @@ public class PTRMapWidgetManager: RCTViewManager {
|
|
|
221
201
|
return
|
|
222
202
|
}
|
|
223
203
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
204
|
+
let action = PTRMapWidgetShowMyCarAction(location: PTRMapWidgetSiteLocation(siteIdentifier: siteExternalIdentifier, isExternalIdentifiers: true))
|
|
205
|
+
action.completion = { error in
|
|
206
|
+
let ptrCommand: [String: Any] = [
|
|
207
|
+
"command": "myCarForSite",
|
|
208
|
+
"siteExternalIdentifier": siteExternalIdentifier,
|
|
209
|
+
"animationType": animationType,
|
|
210
|
+
"error": error?.errorCode ?? ""
|
|
211
|
+
]
|
|
212
|
+
ptrMapWidgetContainerView.ptrMapWidgetDidEndLoading(withParameters: ptrCommand)
|
|
213
|
+
}
|
|
214
|
+
let mapWidget = ptrMapWidgetContainerView.getMapWidget(action)
|
|
215
|
+
print("calling show mark my car method of mapWidget")
|
|
216
|
+
ptrMapWidgetContainerView.present(mapWidget)
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
@objc func startAndFocus(_ reactTag: NSNumber, clientId: String, licenseKey: String, baseUrl: String, focusType: String, siteExternalIdentifier: String) {
|
|
220
|
+
startAndFocus(reactTag, clientId: clientId, licenseKey: licenseKey, baseUrl: baseUrl, logLevel: 4, focusType: focusType, siteExternalIdentifier: siteExternalIdentifier, param1: "", levelIndex: 0)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@objc func startAndFocus(_ reactTag: NSNumber, clientId: String, licenseKey: String, baseUrl: String, focusType: String, siteExternalIdentifier: String, param1: String) {
|
|
224
|
+
startAndFocus(reactTag, clientId: clientId, licenseKey: licenseKey, baseUrl: baseUrl, logLevel: 4, focusType: focusType, siteExternalIdentifier: siteExternalIdentifier, param1: param1, levelIndex: 0)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@objc func startAndFocus(_ reactTag: NSNumber, clientId: String, licenseKey: String, baseUrl: String, focusType: String, siteExternalIdentifier: String, param1: String, levelIndex: Int) {
|
|
228
|
+
startAndFocus(reactTag, clientId: clientId, licenseKey: licenseKey, baseUrl: baseUrl, logLevel: 4, focusType: focusType, siteExternalIdentifier: siteExternalIdentifier, param1: param1, levelIndex: levelIndex)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@objc func startAndFocus(_ reactTag: NSNumber, clientId: String, licenseKey: String, baseUrl: String, logLevel: Int, focusType: String, siteExternalIdentifier: String) {
|
|
232
|
+
startAndFocus(reactTag, clientId: clientId, licenseKey: licenseKey, baseUrl: baseUrl, logLevel: logLevel, focusType: focusType, siteExternalIdentifier: siteExternalIdentifier, param1: "", levelIndex: 0)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@objc func startAndFocus(_ reactTag: NSNumber, clientId: String, licenseKey: String, baseUrl: String, logLevel: Int, focusType: String, siteExternalIdentifier: String, param1: String) {
|
|
236
|
+
startAndFocus(reactTag, clientId: clientId, licenseKey: licenseKey, baseUrl: baseUrl, logLevel: logLevel, focusType: focusType, siteExternalIdentifier: siteExternalIdentifier, param1: param1, levelIndex: 0)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@objc func startAndFocus(_ reactTag: NSNumber, clientId: String, licenseKey: String, baseUrl: String, logLevel: Int, focusType: String, siteExternalIdentifier: String, param1: String, levelIndex: Int) {
|
|
240
|
+
|
|
241
|
+
// Initialize PTRParams
|
|
242
|
+
PTRNativeLibrary.params.clientIdentifier = clientId
|
|
243
|
+
PTRNativeLibrary.params.licenseKey = licenseKey
|
|
244
|
+
PTRNativeLibrary.params.baseUrl = baseUrl
|
|
245
|
+
PTRNativeLibrary.params.loggerLevel = PTRLoggerLevel(rawValue: Int32(logLevel)) ?? .error
|
|
246
|
+
PTRNativeLibrary.params.mode = PointrDebugMode()
|
|
247
|
+
|
|
248
|
+
// Set SDK params in map widget configuration
|
|
249
|
+
PTRNativeLibrary.mapWidgetConfiguration.sdkParams = PTRNativeLibrary.params
|
|
250
|
+
|
|
251
|
+
// Call appropriate focus method based on command type
|
|
252
|
+
switch focusType.lowercased() {
|
|
253
|
+
case "poi":
|
|
254
|
+
if !param1.isEmpty {
|
|
255
|
+
poi(reactTag, siteExternalIdentifier: siteExternalIdentifier, poiExternalIdentifier: param1)
|
|
256
|
+
} else {
|
|
257
|
+
print("Error: POI ID is required for POI focus")
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
case "level":
|
|
261
|
+
if !param1.isEmpty {
|
|
262
|
+
level(reactTag, siteExternalIdentifier: siteExternalIdentifier, buildingExternalIdentifier: param1, levelIndex: levelIndex)
|
|
263
|
+
} else {
|
|
264
|
+
print("Error: Building ID is required for level focus")
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
case "building":
|
|
268
|
+
if !param1.isEmpty {
|
|
269
|
+
building(reactTag, siteExternalIdentifier: siteExternalIdentifier, buildingExternalIdentifier: param1)
|
|
270
|
+
} else {
|
|
271
|
+
print("Error: Building ID is required for building focus")
|
|
238
272
|
}
|
|
273
|
+
|
|
274
|
+
case "site":
|
|
275
|
+
site(reactTag, siteExternalIdentifier: siteExternalIdentifier)
|
|
276
|
+
|
|
277
|
+
default:
|
|
278
|
+
print("Error: Unknown command type '\(focusType)'. Supported types: site, building, level, poi")
|
|
279
|
+
// Default to site focus if command type is unknown
|
|
280
|
+
site(reactTag, siteExternalIdentifier: siteExternalIdentifier)
|
|
239
281
|
}
|
|
240
282
|
}
|
|
241
283
|
}
|
|
242
|
-
|