react-native-steerpath-smart-map 1.29.5 → 2.0.0-alpha.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/.eslintrc.js +66 -0
- package/.prettierrc +7 -0
- package/CHANGELOG.md +35 -0
- package/README.md +7 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNEventKeys.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartGeofenceManager.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartLocationManager.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapManager.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapModule.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapPackage.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapPackage.kt +28 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapView.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapViewManager.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/Utils.class +0 -0
- package/android/build.gradle +22 -33
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartLocationManager.java +22 -14
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapManager.java +9 -31
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapPackage.java +11 -9
- package/android/src/main/java/com/steerpath/rnsmartmap/Utils.java +36 -36
- package/ios/RNSmartLocationManager.m +28 -3
- package/ios/RNSmartMapManager.m +10 -22
- package/lib/commonjs/SmartLocationManager.js +50 -0
- package/lib/commonjs/SmartLocationManager.js.map +1 -0
- package/lib/commonjs/SmartLocationManager.web.js +11 -0
- package/lib/commonjs/SmartLocationManager.web.js.map +1 -0
- package/lib/commonjs/SmartMapManager.js +59 -0
- package/lib/commonjs/SmartMapManager.js.map +1 -0
- package/lib/commonjs/SmartMapManager.web.js +24 -0
- package/lib/commonjs/SmartMapManager.web.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/SmartLocationManager.js +46 -0
- package/lib/module/SmartLocationManager.js.map +1 -0
- package/lib/module/SmartLocationManager.web.js +7 -0
- package/lib/module/SmartLocationManager.web.js.map +1 -0
- package/lib/module/SmartMapManager.js +54 -0
- package/lib/module/SmartMapManager.js.map +1 -0
- package/lib/module/SmartMapManager.web.js +20 -0
- package/lib/module/SmartMapManager.web.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/SmartLocationManager.d.ts +19 -0
- package/lib/typescript/SmartLocationManager.d.ts.map +1 -0
- package/{dist → lib/typescript}/SmartLocationManager.web.d.ts +1 -0
- package/lib/typescript/SmartLocationManager.web.d.ts.map +1 -0
- package/{dist → lib/typescript}/SmartMapManager.d.ts +13 -15
- package/lib/typescript/SmartMapManager.d.ts.map +1 -0
- package/lib/typescript/SmartMapManager.web.d.ts +8 -0
- package/lib/typescript/SmartMapManager.web.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +38 -13
- package/react-native-steerpath-smart-map.podspec +15 -12
- package/src/SmartLocationManager.ts +25 -9
- package/src/SmartMapManager.ts +12 -19
- package/src/SmartMapManager.web.ts +3 -24
- package/src/index.ts +3 -4
- package/tsconfig.json +14 -9
- package/.eslintrc.json +0 -81
- package/android/bin/.project +0 -34
- package/android/bin/.settings/org.eclipse.buildship.core.prefs +0 -13
- package/android/bin/README.md +0 -14
- package/android/bin/build.gradle +0 -59
- package/android/bin/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/bin/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/bin/gradlew +0 -172
- package/android/bin/gradlew.bat +0 -84
- package/android/bin/src/main/AndroidManifest.xml +0 -4
- package/android/src/main/java/com/steerpath/rnsmartmap/RNEventKeys.java +0 -29
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartGeofenceManager.java +0 -103
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapModule.java +0 -284
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapView.java +0 -470
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapViewManager.java +0 -307
- package/dist/SmartGeofenceManager.d.ts +0 -17
- package/dist/SmartGeofenceManager.js +0 -61
- package/dist/SmartGeofenceManager.web.d.ts +0 -9
- package/dist/SmartGeofenceManager.web.js +0 -10
- package/dist/SmartLocationManager.d.ts +0 -11
- package/dist/SmartLocationManager.js +0 -22
- package/dist/SmartLocationManager.web.js +0 -4
- package/dist/SmartMapEventManager.web.d.ts +0 -5
- package/dist/SmartMapEventManager.web.js +0 -10
- package/dist/SmartMapManager.js +0 -53
- package/dist/SmartMapManager.web.d.ts +0 -12
- package/dist/SmartMapManager.web.js +0 -33
- package/dist/SmartMapView.d.ts +0 -3
- package/dist/SmartMapView.js +0 -294
- package/dist/SmartMapView.web.d.ts +0 -3
- package/dist/SmartMapView.web.js +0 -270
- package/dist/SmartMapViewProps.d.ts +0 -267
- package/dist/SmartMapViewProps.js +0 -76
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -5
- package/dist/internalUtils.d.ts +0 -1
- package/dist/internalUtils.js +0 -5
- package/ios/RCTConvert+SmartMapView.h +0 -35
- package/ios/RCTConvert+SmartMapView.m +0 -295
- package/ios/RNSmartGeofenceManager.h +0 -24
- package/ios/RNSmartGeofenceManager.m +0 -110
- package/ios/RNSmartMapUserTaskEventManager.h +0 -19
- package/ios/RNSmartMapUserTaskEventManager.m +0 -46
- package/ios/RNSmartMapView.h +0 -37
- package/ios/RNSmartMapView.m +0 -21
- package/ios/RNSmartMapViewManager.h +0 -27
- package/ios/RNSmartMapViewManager.m +0 -608
- package/package-lock.json +0 -6570
- package/src/SmartGeofenceManager.ts +0 -94
- package/src/SmartGeofenceManager.web.ts +0 -11
- package/src/SmartMapEventManager.web.ts +0 -13
- package/src/SmartMapView.tsx +0 -377
- package/src/SmartMapView.web.tsx +0 -342
- package/src/SmartMapViewProps.ts +0 -338
- package/src/internalUtils.ts +0 -5
- package/src/typings/steerpath-smart-sdk.d.ts +0 -5
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
package com.steerpath.rnsmartmap;
|
|
2
|
-
|
|
3
|
-
import android.util.Log;
|
|
4
|
-
import android.view.View;
|
|
5
|
-
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.react.bridge.ReactContext;
|
|
8
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
9
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
10
|
-
import com.facebook.react.bridge.WritableMap;
|
|
11
|
-
import com.facebook.react.common.MapBuilder;
|
|
12
|
-
import com.facebook.react.uimanager.ThemedReactContext;
|
|
13
|
-
import com.facebook.react.uimanager.ViewGroupManager;
|
|
14
|
-
|
|
15
|
-
import com.facebook.react.uimanager.events.RCTEventEmitter;
|
|
16
|
-
import com.steerpath.smart.MapMode;
|
|
17
|
-
import com.steerpath.smart.SmartMapObject;
|
|
18
|
-
|
|
19
|
-
import java.util.ArrayList;
|
|
20
|
-
import java.util.List;
|
|
21
|
-
import java.util.Map;
|
|
22
|
-
import java.util.TreeMap;
|
|
23
|
-
|
|
24
|
-
import javax.annotation.Nonnull;
|
|
25
|
-
import javax.annotation.Nullable;
|
|
26
|
-
|
|
27
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.MAP_CLICKED;
|
|
28
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.MAP_LOADED;
|
|
29
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.NAVIGATION_DESTINATION_REACHED;
|
|
30
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.NAVIGATION_ENDED;
|
|
31
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.NAVIGATION_FAILED;
|
|
32
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.NAVIGATION_PREVIEW_APPEARED;
|
|
33
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.NAVIGATION_STARTED;
|
|
34
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.ON_BACK_PRESSED;
|
|
35
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.SEARCH_CATEGORY_SELECTED;
|
|
36
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.SEARCH_RESULT_SELECTED;
|
|
37
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.USER_FLOOR_CHANGED;
|
|
38
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.USER_TASK_RESPONSE;
|
|
39
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.VIEW_STATUS_CHANGED;
|
|
40
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.VISIBLE_FLOOR_CHANGED;
|
|
41
|
-
import static com.steerpath.rnsmartmap.RNEventKeys.BOTTOMSHEET_STATE_CHANGED;
|
|
42
|
-
import static com.steerpath.rnsmartmap.Utils.convertMapToJson;
|
|
43
|
-
|
|
44
|
-
import org.json.JSONException;
|
|
45
|
-
import org.json.JSONObject;
|
|
46
|
-
|
|
47
|
-
public class RNSmartMapViewManager extends ViewGroupManager<RNSmartMapView> {
|
|
48
|
-
|
|
49
|
-
private static final int ADD_MARKER = 1;
|
|
50
|
-
private static final int ADD_MARKERS = 2;
|
|
51
|
-
private static final int ANIMATE_CAMERA = 3;
|
|
52
|
-
private static final int CANCEL_CURRENT_USER_TASK = 4;
|
|
53
|
-
private static final int REMOVE_ALL_MARKERS = 5;
|
|
54
|
-
private static final int REMOVE_MARKER = 6;
|
|
55
|
-
private static final int REMOVE_MARKERS = 7;
|
|
56
|
-
private static final int SELECT_MAP_OBJECT = 8;
|
|
57
|
-
private static final int SET_CAMERA = 9;
|
|
58
|
-
private static final int START_USER_TASK = 10;
|
|
59
|
-
private static final int START_MAP = 11;
|
|
60
|
-
private static final int STOP_MAP = 12;
|
|
61
|
-
private static final int SET_MAP_MODE = 13;
|
|
62
|
-
private static final int SET_WIDGET_PADDING = 14;
|
|
63
|
-
|
|
64
|
-
private static final String REACT_CLASS = "RNSmartMapView";
|
|
65
|
-
|
|
66
|
-
@Override
|
|
67
|
-
@Nonnull
|
|
68
|
-
public String getName() {
|
|
69
|
-
return REACT_CLASS;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private final ReactApplicationContext reactApplicationContext;
|
|
73
|
-
|
|
74
|
-
public RNSmartMapViewManager(ReactApplicationContext reactApplicationContext) {
|
|
75
|
-
this.reactApplicationContext = reactApplicationContext;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@Override
|
|
79
|
-
public RNSmartMapView createViewInstance(ThemedReactContext context) {
|
|
80
|
-
RNSmartMapView smartMapView = new RNSmartMapView(context, reactApplicationContext, this);
|
|
81
|
-
return smartMapView;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@Override
|
|
85
|
-
public Map getExportedCustomDirectEventTypeConstants() {
|
|
86
|
-
String registrationName = "registrationName";
|
|
87
|
-
Map<String, Map<String, String>> map = MapBuilder.of(MAP_LOADED, MapBuilder.of(registrationName, MAP_LOADED),
|
|
88
|
-
MAP_CLICKED, MapBuilder.of(registrationName, MAP_CLICKED), SEARCH_RESULT_SELECTED,
|
|
89
|
-
MapBuilder.of(registrationName, SEARCH_RESULT_SELECTED), USER_FLOOR_CHANGED,
|
|
90
|
-
MapBuilder.of(registrationName, USER_FLOOR_CHANGED), VISIBLE_FLOOR_CHANGED,
|
|
91
|
-
MapBuilder.of(registrationName, VISIBLE_FLOOR_CHANGED), USER_TASK_RESPONSE,
|
|
92
|
-
MapBuilder.of(registrationName, USER_TASK_RESPONSE), VIEW_STATUS_CHANGED,
|
|
93
|
-
MapBuilder.of(registrationName, VIEW_STATUS_CHANGED));
|
|
94
|
-
|
|
95
|
-
map.putAll(MapBuilder.of(NAVIGATION_FAILED, MapBuilder.of(registrationName, NAVIGATION_FAILED),
|
|
96
|
-
NAVIGATION_ENDED, MapBuilder.of(registrationName, NAVIGATION_ENDED), NAVIGATION_STARTED,
|
|
97
|
-
MapBuilder.of(registrationName, NAVIGATION_STARTED), NAVIGATION_PREVIEW_APPEARED,
|
|
98
|
-
MapBuilder.of(registrationName, NAVIGATION_PREVIEW_APPEARED), NAVIGATION_DESTINATION_REACHED,
|
|
99
|
-
MapBuilder.of(registrationName, NAVIGATION_DESTINATION_REACHED), ON_BACK_PRESSED,
|
|
100
|
-
MapBuilder.of(registrationName, ON_BACK_PRESSED), BOTTOMSHEET_STATE_CHANGED,
|
|
101
|
-
MapBuilder.of(registrationName, BOTTOMSHEET_STATE_CHANGED)));
|
|
102
|
-
|
|
103
|
-
map.putAll(MapBuilder.of(SEARCH_CATEGORY_SELECTED, MapBuilder.of(registrationName, SEARCH_CATEGORY_SELECTED)));
|
|
104
|
-
|
|
105
|
-
return map;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
@Nullable
|
|
109
|
-
@Override
|
|
110
|
-
public Map<String, Integer> getCommandsMap() {
|
|
111
|
-
TreeMap<String, Integer> commands = new TreeMap<>();
|
|
112
|
-
commands.put("addMarker", ADD_MARKER);
|
|
113
|
-
commands.put("addMarkers", ADD_MARKERS);
|
|
114
|
-
commands.put("animateCamera", ANIMATE_CAMERA);
|
|
115
|
-
commands.put("cancelCurrentUserTask", CANCEL_CURRENT_USER_TASK);
|
|
116
|
-
commands.put("removeAllMarkers", REMOVE_ALL_MARKERS);
|
|
117
|
-
commands.put("removeMarker", REMOVE_MARKER);
|
|
118
|
-
commands.put("removeMarkers", REMOVE_MARKERS);
|
|
119
|
-
commands.put("selectMapObject", SELECT_MAP_OBJECT);
|
|
120
|
-
commands.put("setCamera", SET_CAMERA);
|
|
121
|
-
commands.put("startUserTask", START_USER_TASK);
|
|
122
|
-
commands.put("start", START_MAP);
|
|
123
|
-
commands.put("stop", STOP_MAP);
|
|
124
|
-
commands.put("setMapMode", SET_MAP_MODE);
|
|
125
|
-
commands.put("setWidgetPadding", SET_WIDGET_PADDING);
|
|
126
|
-
return commands;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@Override
|
|
130
|
-
public void receiveCommand(@Nonnull RNSmartMapView mapView, int commandId, @Nullable ReadableArray args) {
|
|
131
|
-
ReadableMap map;
|
|
132
|
-
String buildingRef;
|
|
133
|
-
double lat;
|
|
134
|
-
double lon;
|
|
135
|
-
double zoom;
|
|
136
|
-
double bearing;
|
|
137
|
-
double pitch;
|
|
138
|
-
int floorIndex;
|
|
139
|
-
|
|
140
|
-
switch (commandId) {
|
|
141
|
-
case ADD_MARKER:
|
|
142
|
-
map = args.getMap(0);
|
|
143
|
-
String layout = args.getString(1);
|
|
144
|
-
String iconImage = args.getString(2);
|
|
145
|
-
String rgbTextColor = args.getString(3);
|
|
146
|
-
String rgbTextHaloColor = args.getString(4);
|
|
147
|
-
mapView.addMarker(getLatitude(map), getLongitude(map), getFloorIndex(map), getLocalRef(map),
|
|
148
|
-
getBuildingRef(map), layout, iconImage, rgbTextColor, rgbTextHaloColor);
|
|
149
|
-
break;
|
|
150
|
-
case ADD_MARKERS:
|
|
151
|
-
mapView.addMarkers(generateMapObjectsList(args.getArray(0)), args.getString(1), args.getString(2),
|
|
152
|
-
args.getString(3), args.getString(4));
|
|
153
|
-
break;
|
|
154
|
-
case ANIMATE_CAMERA:
|
|
155
|
-
lat = args.getDouble(0);
|
|
156
|
-
lon = args.getDouble(1);
|
|
157
|
-
zoom = args.getDouble(2);
|
|
158
|
-
bearing = args.getDouble(3);
|
|
159
|
-
pitch = args.getDouble(4);
|
|
160
|
-
floorIndex = args.getInt(5);
|
|
161
|
-
buildingRef = args.getString(6);
|
|
162
|
-
mapView.animateCamera(lat, lon, zoom, bearing, pitch, floorIndex, buildingRef);
|
|
163
|
-
break;
|
|
164
|
-
case CANCEL_CURRENT_USER_TASK:
|
|
165
|
-
mapView.cancelCurrentUserTask();
|
|
166
|
-
break;
|
|
167
|
-
case REMOVE_ALL_MARKERS:
|
|
168
|
-
mapView.removeAllMarkers();
|
|
169
|
-
break;
|
|
170
|
-
case REMOVE_MARKER:
|
|
171
|
-
map = args.getMap(0);
|
|
172
|
-
mapView.removeMarker(getLatitude(map), getLongitude(map), getFloorIndex(map), getLocalRef(map),
|
|
173
|
-
getBuildingRef(map));
|
|
174
|
-
break;
|
|
175
|
-
case REMOVE_MARKERS:
|
|
176
|
-
mapView.removeMarkers(generateMapObjectsList(args.getArray(0)));
|
|
177
|
-
break;
|
|
178
|
-
case SELECT_MAP_OBJECT:
|
|
179
|
-
mapView.selectMapObject(generateMapObject(args.getMap(0)));
|
|
180
|
-
break;
|
|
181
|
-
case SET_CAMERA:
|
|
182
|
-
lat = args.getDouble(0);
|
|
183
|
-
lon = args.getDouble(1);
|
|
184
|
-
zoom = args.getDouble(2);
|
|
185
|
-
bearing = args.getDouble(3);
|
|
186
|
-
pitch = args.getDouble(4);
|
|
187
|
-
floorIndex = args.getInt(5);
|
|
188
|
-
buildingRef = args.getString(6);
|
|
189
|
-
mapView.setCamera(lat, lon, zoom, bearing, pitch, floorIndex, buildingRef);
|
|
190
|
-
break;
|
|
191
|
-
case START_USER_TASK:
|
|
192
|
-
map = args.getMap(0);
|
|
193
|
-
ReadableMap payload = map.getMap("payload");
|
|
194
|
-
String taskType = map.getString("type");
|
|
195
|
-
if (taskType.equals("navigation")) {
|
|
196
|
-
mapView.startNavigationUserTask(getLatitude(payload), getLongitude(payload), getFloorIndex(payload),
|
|
197
|
-
getLocalRef(payload), getBuildingRef(payload));
|
|
198
|
-
} else if (taskType.equals("poiSelection")) {
|
|
199
|
-
map = args.getMap(0);
|
|
200
|
-
payload = map.getMap("payload");
|
|
201
|
-
ReadableMap mapObject = payload.getMap("smartMapObject");
|
|
202
|
-
mapView.startPoiSelectionUserTask(getLocalRef(mapObject), getBuildingRef(mapObject),
|
|
203
|
-
getSource(mapObject), payload.getBoolean("shouldAddMarker"),
|
|
204
|
-
payload.getString("actionButtonText"), payload.getString("actionButtonIcon"));
|
|
205
|
-
} else {
|
|
206
|
-
Log.d("ERROR", "Invalid user task type");
|
|
207
|
-
}
|
|
208
|
-
break;
|
|
209
|
-
case START_MAP:
|
|
210
|
-
mapView.getMap().onStart();
|
|
211
|
-
mapView.getMap().onResume();
|
|
212
|
-
break;
|
|
213
|
-
case STOP_MAP:
|
|
214
|
-
mapView.getMap().onPause();
|
|
215
|
-
mapView.getMap().onStop();
|
|
216
|
-
break;
|
|
217
|
-
case SET_MAP_MODE:
|
|
218
|
-
String mapMode = args.getString(0);
|
|
219
|
-
switch (mapMode) {
|
|
220
|
-
case "mapOnly":
|
|
221
|
-
mapView.setMapMode(MapMode.MAP_ONLY);
|
|
222
|
-
break;
|
|
223
|
-
case "static":
|
|
224
|
-
mapView.setMapMode(MapMode.STATIC);
|
|
225
|
-
break;
|
|
226
|
-
case "search":
|
|
227
|
-
mapView.setMapMode(MapMode.SEARCH);
|
|
228
|
-
break;
|
|
229
|
-
default:
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
break;
|
|
233
|
-
case SET_WIDGET_PADDING:
|
|
234
|
-
if (args != null) {
|
|
235
|
-
mapView.setWidgetPadding(args.getInt(0), args.getInt(1), args.getInt(2), args.getInt(3));
|
|
236
|
-
} else {
|
|
237
|
-
Log.w("RnSmartMapView", "No arguments for method setWidgetPadding()");
|
|
238
|
-
}
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
private double getLatitude(ReadableMap map) {
|
|
244
|
-
return map.getDouble("latitude");
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
private double getLongitude(ReadableMap map) {
|
|
248
|
-
return map.getDouble("longitude");
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
private int getFloorIndex(ReadableMap map) {
|
|
252
|
-
return map.getInt("floorIndex");
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
private String getBuildingRef(ReadableMap map) {
|
|
256
|
-
return map.getString("buildingRef");
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
private String getLocalRef(ReadableMap map) {
|
|
260
|
-
return map.getString("localRef");
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
private String getSource(ReadableMap map) {
|
|
264
|
-
return map.getString("source");
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
private String getTitle(ReadableMap map) {
|
|
268
|
-
return map.getString("title");
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
private JSONObject getProperties(ReadableMap map) {
|
|
272
|
-
ReadableMap propertiesMap = map.getMap("properties");
|
|
273
|
-
JSONObject properties = new JSONObject();
|
|
274
|
-
if (propertiesMap != null) {
|
|
275
|
-
try {
|
|
276
|
-
properties = convertMapToJson(propertiesMap);
|
|
277
|
-
} catch (JSONException e) {
|
|
278
|
-
throw new RuntimeException(e);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return properties;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
private List<SmartMapObject> generateMapObjectsList(ReadableArray array) {
|
|
285
|
-
List<SmartMapObject> mapObjects = new ArrayList<>();
|
|
286
|
-
for (int i = 0; i < array.size(); i++) {
|
|
287
|
-
mapObjects.add(generateMapObject(array.getMap(i)));
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return mapObjects;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
private SmartMapObject generateMapObject(ReadableMap map) {
|
|
294
|
-
SmartMapObject mapObject = new SmartMapObject(getLatitude(map), getLongitude(map), getFloorIndex(map), getLocalRef(map),
|
|
295
|
-
getBuildingRef(map));
|
|
296
|
-
mapObject.setProperties(getProperties(map));
|
|
297
|
-
mapObject.setSource(getSource(map));
|
|
298
|
-
mapObject.setTitle(getTitle(map));
|
|
299
|
-
|
|
300
|
-
return mapObject;
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
void sendEvent(ReactContext reactContext, View view, String eventName, @Nullable WritableMap params) {
|
|
305
|
-
reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(view.getId(), eventName, params);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SmartGeofenceResponse } from "./SmartMapViewProps";
|
|
2
|
-
export declare enum SmartGeofenceEvent {
|
|
3
|
-
GEOFENCE_ENTERED = "GeofenceEntered",
|
|
4
|
-
GEOFENCE_EXITED = "GeofenceExited",
|
|
5
|
-
BEACONFENCE_ENTERED = "BeaconfenceEntered",
|
|
6
|
-
BEACONFENCE_EXITED = "BeaconfenceExited"
|
|
7
|
-
}
|
|
8
|
-
export declare const SmartGeofenceManager: {
|
|
9
|
-
addGeofence(localRef: string, buildingRef: string, callback: (error: Error, response: SmartGeofenceResponse) => void): void;
|
|
10
|
-
removeGeofence(localRef: string, buildingRef: string): void;
|
|
11
|
-
addBeaconfence(beaconId: string, radius: number, loiteringDelay: number, callback: (error: Error, response: SmartGeofenceResponse) => void): void;
|
|
12
|
-
removeBeaconfence(beaconId: string): void;
|
|
13
|
-
startListening(): void;
|
|
14
|
-
stopListening(): void;
|
|
15
|
-
addListener(listener: (eventName: SmartGeofenceEvent, data: Record<string, string>) => void): void;
|
|
16
|
-
removeListener(listener: (eventName: SmartGeofenceEvent, data: Record<string, string>) => void): void;
|
|
17
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/* eslint-disable prefer-destructuring */
|
|
2
|
-
import { NativeModules, NativeEventEmitter } from "react-native";
|
|
3
|
-
export var SmartGeofenceEvent;
|
|
4
|
-
(function (SmartGeofenceEvent) {
|
|
5
|
-
SmartGeofenceEvent["GEOFENCE_ENTERED"] = "GeofenceEntered";
|
|
6
|
-
SmartGeofenceEvent["GEOFENCE_EXITED"] = "GeofenceExited";
|
|
7
|
-
SmartGeofenceEvent["BEACONFENCE_ENTERED"] = "BeaconfenceEntered";
|
|
8
|
-
SmartGeofenceEvent["BEACONFENCE_EXITED"] = "BeaconfenceExited";
|
|
9
|
-
})(SmartGeofenceEvent || (SmartGeofenceEvent = {}));
|
|
10
|
-
var POSSIBLE_EVENTS = [
|
|
11
|
-
SmartGeofenceEvent.GEOFENCE_ENTERED,
|
|
12
|
-
SmartGeofenceEvent.GEOFENCE_EXITED,
|
|
13
|
-
SmartGeofenceEvent.BEACONFENCE_ENTERED,
|
|
14
|
-
SmartGeofenceEvent.BEACONFENCE_EXITED,
|
|
15
|
-
];
|
|
16
|
-
var RNSmartGeofenceManager = NativeModules.RNSmartGeofenceManager;
|
|
17
|
-
var smartGeofenceManagerEmitter = new NativeEventEmitter(RNSmartGeofenceManager);
|
|
18
|
-
function createSmartGeofenceManager() {
|
|
19
|
-
var eventListenerRegistered = false;
|
|
20
|
-
return {
|
|
21
|
-
addGeofence: function (localRef, buildingRef, callback) {
|
|
22
|
-
RNSmartGeofenceManager.addGeofence(localRef, buildingRef, callback);
|
|
23
|
-
},
|
|
24
|
-
removeGeofence: function (localRef, buildingRef) {
|
|
25
|
-
RNSmartGeofenceManager.removeGeofence(localRef, buildingRef);
|
|
26
|
-
},
|
|
27
|
-
addBeaconfence: function (beaconId, radius, loiteringDelay, callback) {
|
|
28
|
-
RNSmartGeofenceManager.addBeaconfence(beaconId, radius, loiteringDelay, callback);
|
|
29
|
-
},
|
|
30
|
-
removeBeaconfence: function (beaconId) {
|
|
31
|
-
RNSmartGeofenceManager.removeBeaconfence(beaconId);
|
|
32
|
-
},
|
|
33
|
-
startListening: function () {
|
|
34
|
-
RNSmartGeofenceManager.startListening();
|
|
35
|
-
},
|
|
36
|
-
stopListening: function () {
|
|
37
|
-
RNSmartGeofenceManager.stopListening();
|
|
38
|
-
},
|
|
39
|
-
addListener: function (listener) {
|
|
40
|
-
if (!eventListenerRegistered) {
|
|
41
|
-
RNSmartGeofenceManager.startListening();
|
|
42
|
-
eventListenerRegistered = true;
|
|
43
|
-
}
|
|
44
|
-
POSSIBLE_EVENTS.forEach(function (eventName) {
|
|
45
|
-
smartGeofenceManagerEmitter.addListener(eventName, function (payload) {
|
|
46
|
-
listener(eventName, payload);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
removeListener: function (listener) {
|
|
51
|
-
RNSmartGeofenceManager.stopListening();
|
|
52
|
-
eventListenerRegistered = false;
|
|
53
|
-
POSSIBLE_EVENTS.forEach(function (eventName) {
|
|
54
|
-
smartGeofenceManagerEmitter.removeListener(eventName, function (payload) {
|
|
55
|
-
listener(eventName, payload);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export var SmartGeofenceManager = createSmartGeofenceManager();
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* eslint-disable prefer-destructuring */
|
|
2
|
-
export var SmartGeofenceManager = {
|
|
3
|
-
addGeofence: function () { },
|
|
4
|
-
removeGeofence: function () { },
|
|
5
|
-
removeBeaconfences: function () { },
|
|
6
|
-
addBeaconfence: function () { },
|
|
7
|
-
removeBeaconfence: function () { },
|
|
8
|
-
addListener: function () { },
|
|
9
|
-
removeListener: function () { },
|
|
10
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare type LocationResponse = {
|
|
2
|
-
latitude: number;
|
|
3
|
-
longitude: number;
|
|
4
|
-
buildingRef: string | null;
|
|
5
|
-
floorIndex: number;
|
|
6
|
-
accuracyM: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const SmartLocationManager: {
|
|
9
|
-
addLocationChangedListener(listener: (data: LocationResponse) => void): void;
|
|
10
|
-
removeLocationChangedListener(): void;
|
|
11
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { NativeModules, NativeEventEmitter } from "react-native";
|
|
2
|
-
var RNSmartLocationManager = NativeModules.RNSmartLocationManager;
|
|
3
|
-
var smartLocationManagerEmitter = new NativeEventEmitter(RNSmartLocationManager);
|
|
4
|
-
function createSmartLocationManager() {
|
|
5
|
-
var eventListenerRegistered = false;
|
|
6
|
-
var eventListener;
|
|
7
|
-
return {
|
|
8
|
-
addLocationChangedListener: function (listener) {
|
|
9
|
-
if (!eventListenerRegistered) {
|
|
10
|
-
eventListenerRegistered = true;
|
|
11
|
-
eventListener = smartLocationManagerEmitter.addListener('locationChanged', function (payload) {
|
|
12
|
-
listener(payload);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
removeLocationChangedListener: function () {
|
|
17
|
-
eventListenerRegistered = false;
|
|
18
|
-
eventListener.remove();
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export var SmartLocationManager = createSmartLocationManager();
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NativeEventEmitter } from "react-native";
|
|
2
|
-
var SmartMapEventManagerEmitter = new NativeEventEmitter();
|
|
3
|
-
export var SmartMapEventManager = {
|
|
4
|
-
addListener: function (eventName, listener) {
|
|
5
|
-
SmartMapEventManagerEmitter.addListener(eventName, listener);
|
|
6
|
-
},
|
|
7
|
-
removeListener: function (eventName, listener) {
|
|
8
|
-
SmartMapEventManagerEmitter.removeListener(eventName, listener);
|
|
9
|
-
}
|
|
10
|
-
};
|
package/dist/SmartMapManager.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/* eslint-disable prefer-destructuring */
|
|
2
|
-
import { NativeModules, Platform } from "react-native";
|
|
3
|
-
var RNSmartMapManager = NativeModules.RNSmartMapManager;
|
|
4
|
-
export var SmartMapManager = {
|
|
5
|
-
start: function (apiKey) {
|
|
6
|
-
RNSmartMapManager.start(apiKey);
|
|
7
|
-
},
|
|
8
|
-
startWithConfig: function (config) {
|
|
9
|
-
if (Platform.OS === "web") {
|
|
10
|
-
throw new Error("Not implemented");
|
|
11
|
-
}
|
|
12
|
-
var configFilePath = config.configFilePath;
|
|
13
|
-
var configString = config.configString;
|
|
14
|
-
if (configFilePath && configFilePath.startsWith("file://")) {
|
|
15
|
-
// iOS only accept the path like this: /var/something/file.json
|
|
16
|
-
configFilePath = configFilePath.substring(7);
|
|
17
|
-
}
|
|
18
|
-
RNSmartMapManager.startWithConfig({
|
|
19
|
-
apiKey: config.apiKey,
|
|
20
|
-
configFilePath: configFilePath,
|
|
21
|
-
configString: configString,
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @deprecated Use loginToLive instead.
|
|
27
|
-
*/
|
|
28
|
-
setLiveConfig: function (config) {
|
|
29
|
-
RNSmartMapManager.setLiveConfig(config);
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* Share user location by setting transmit options and show live updates on map by setting receive options.
|
|
33
|
-
*
|
|
34
|
-
* Leave transmit out of the config if you don't want to share location and receive out if you don't want updates to map.
|
|
35
|
-
*
|
|
36
|
-
* @param config
|
|
37
|
-
*/
|
|
38
|
-
loginToLive: function (config) {
|
|
39
|
-
RNSmartMapManager.loginToLive(config);
|
|
40
|
-
},
|
|
41
|
-
/**
|
|
42
|
-
* Stop sharing user location and receiving live updates. Call loginToLive to start again.
|
|
43
|
-
*/
|
|
44
|
-
logoutFromLive: function () {
|
|
45
|
-
RNSmartMapManager.logoutFromLive();
|
|
46
|
-
},
|
|
47
|
-
fetchVersions: function (callback) {
|
|
48
|
-
RNSmartMapManager.fetchVersions(callback);
|
|
49
|
-
},
|
|
50
|
-
setLanguage: function (languageCode) {
|
|
51
|
-
RNSmartMapManager.setLanguage(languageCode);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const SmartMapManager: {
|
|
2
|
-
start(apiKey: string, config?: string | Record<string, unknown> | undefined): void;
|
|
3
|
-
/**
|
|
4
|
-
* Not implemented for web. Use start() instead.
|
|
5
|
-
*/
|
|
6
|
-
startWithConfig(): void;
|
|
7
|
-
setLanguage(languageCode: String): void;
|
|
8
|
-
setLiveConfig(): void;
|
|
9
|
-
loginToLive(): void;
|
|
10
|
-
logoutFromLive(): void;
|
|
11
|
-
fetchVersions(): void;
|
|
12
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable prefer-destructuring */
|
|
2
|
-
import { steerpath } from "steerpath-smart-sdk";
|
|
3
|
-
var smartSDKInstance = {
|
|
4
|
-
setLanguage: function () { }
|
|
5
|
-
};
|
|
6
|
-
export var SmartMapManager = {
|
|
7
|
-
start: function (apiKey, config) {
|
|
8
|
-
var smartSDK = new steerpath.SmartSDK();
|
|
9
|
-
smartSDKInstance = smartSDK;
|
|
10
|
-
smartSDK.start(apiKey, config);
|
|
11
|
-
},
|
|
12
|
-
/**
|
|
13
|
-
* Not implemented for web. Use start() instead.
|
|
14
|
-
*/
|
|
15
|
-
startWithConfig: function () {
|
|
16
|
-
// No web implementation
|
|
17
|
-
},
|
|
18
|
-
setLanguage: function (languageCode) {
|
|
19
|
-
smartSDKInstance.setLanguage(languageCode);
|
|
20
|
-
},
|
|
21
|
-
setLiveConfig: function () {
|
|
22
|
-
// No web implementation
|
|
23
|
-
},
|
|
24
|
-
loginToLive: function () {
|
|
25
|
-
// No web implementation
|
|
26
|
-
},
|
|
27
|
-
logoutFromLive: function () {
|
|
28
|
-
// No web implementation
|
|
29
|
-
},
|
|
30
|
-
fetchVersions: function () {
|
|
31
|
-
// No web implementation
|
|
32
|
-
}
|
|
33
|
-
};
|
package/dist/SmartMapView.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SmartMapViewProps, SmartMapViewMethods } from "./SmartMapViewProps";
|
|
3
|
-
export declare const SmartMapView: React.ForwardRefExoticComponent<Pick<SmartMapViewProps, "onMapLoaded" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityComponentType" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityTraits" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "apiKey" | "onBottomSheetStateChanged" | "onMapClicked" | "onNavigationDestinationReached" | "onNavigationEnded" | "onNavigationFailed" | "onNavigationPreviewAppeared" | "onNavigationStarted" | "onSearchCategorySelected" | "onSearchResultSelected" | "onUserFloorChanged" | "onUserTaskResponse" | "onViewStatusChanged" | "onVisibleFloorChanged"> & React.RefAttributes<SmartMapViewMethods>>;
|