@mapsindoors/react-native-maps-indoors-mapbox 0.0.5-beta
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/LICENSE +11 -0
- package/README.md +178 -0
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +19 -0
- package/android/.idea/jarRepositories.xml +45 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/README.md +14 -0
- package/android/build.gradle +169 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +17 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/java/com/reactlibrary/DirectionsRendererModule.java +207 -0
- package/android/src/main/java/com/reactlibrary/DirectionsServiceModule.java +130 -0
- package/android/src/main/java/com/reactlibrary/MPDisplayRuleModule.java +816 -0
- package/android/src/main/java/com/reactlibrary/MapControlModule.java +661 -0
- package/android/src/main/java/com/reactlibrary/MapsIndoorsModule.java +327 -0
- package/android/src/main/java/com/reactlibrary/MapsIndoorsPackage.java +46 -0
- package/android/src/main/java/com/reactlibrary/MapsIndoorsViewManager.java +119 -0
- package/android/src/main/java/com/reactlibrary/UtilsModule.java +165 -0
- package/android/src/main/java/com/reactlibrary/models/Bounds.java +19 -0
- package/android/src/main/java/com/reactlibrary/models/Filter.java +77 -0
- package/android/src/main/java/com/reactlibrary/models/Location.java +17 -0
- package/android/src/main/java/com/reactlibrary/models/MPCameraPosition.java +29 -0
- package/android/src/main/java/com/reactlibrary/models/MPCameraUpdate.java +92 -0
- package/android/src/main/java/com/reactlibrary/models/MPError.java +38 -0
- package/android/src/main/java/com/reactlibrary/models/PositionProvider.java +46 -0
- package/android/src/main/java/com/reactlibrary/models/PositionResult.java +117 -0
- package/android/src/main/java/com/reactlibrary/models/Query.java +30 -0
- package/android/src/main/res/values/google_maps_api_key.xml +4 -0
- package/android/src/main/res/values/mapbox_api_key.xml +5 -0
- package/index.ts +184 -0
- package/ios/DirectionsRendererBridge.m +53 -0
- package/ios/DirectionsRendererModule.swift +187 -0
- package/ios/DirectionsServiceBridge.m +46 -0
- package/ios/DirectionsServiceModule.swift +149 -0
- package/ios/MPDisplayRuleBridge.m +410 -0
- package/ios/MPDisplayRuleModule.swift +845 -0
- package/ios/MapControlBridge.m +178 -0
- package/ios/MapControlModule.swift +602 -0
- package/ios/MapsIndoors.xcodeproj/project.pbxproj +318 -0
- package/ios/MapsIndoors.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/MapsIndoors.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/MapsIndoorsBridge.m +98 -0
- package/ios/MapsIndoorsData.swift +203 -0
- package/ios/MapsIndoorsModule.swift +247 -0
- package/ios/MapsIndoorsViewManager.swift +30 -0
- package/ios/MapsIndoorsViewManagerBridge.m +9 -0
- package/ios/ReactPositionProvider.swift +25 -0
- package/ios/UtilsBridge.m +63 -0
- package/ios/UtilsModule.swift +146 -0
- package/ios/helpers.swift +57 -0
- package/ios/react-native-maps-indoors-Bridging-Header.h +6 -0
- package/package.json +52 -0
- package/react-native-maps-indoors-mapbox.podspec +30 -0
- package/src/EventNames.ts +21 -0
- package/src/MPBounds.ts +137 -0
- package/src/MPBuilding.ts +334 -0
- package/src/MPBuildingCollection.ts +57 -0
- package/src/MPBuildingInfo.ts +63 -0
- package/src/MPCameraEvent.ts +17 -0
- package/src/MPCameraEventListener.ts +17 -0
- package/src/MPCameraPosition.ts +83 -0
- package/src/MPCameraUpdate.ts +174 -0
- package/src/MPCameraViewFitMode.ts +21 -0
- package/src/MPCategory.ts +76 -0
- package/src/MPCategoryCollection.ts +62 -0
- package/src/MPCollection.ts +59 -0
- package/src/MPCollisionHandling.ts +12 -0
- package/src/MPDataField.ts +69 -0
- package/src/MPDirectionsRenderer.ts +194 -0
- package/src/MPDirectionsService.ts +119 -0
- package/src/MPDisplayRule.ts +1027 -0
- package/src/MPEntity.ts +60 -0
- package/src/MPEntityInfo.ts +28 -0
- package/src/MPError.ts +122 -0
- package/src/MPFilter.ts +168 -0
- package/src/MPFilterBehavior.ts +95 -0
- package/src/MPFloor.ts +170 -0
- package/src/MPFloorSelectorInterface.ts +63 -0
- package/src/MPGeometry.ts +91 -0
- package/src/MPHighway.ts +14 -0
- package/src/MPIconSize.ts +39 -0
- package/src/MPLocation.ts +386 -0
- package/src/MPLocationPropertyNames.ts +30 -0
- package/src/MPLocationType.ts +16 -0
- package/src/MPMapConfig.ts +211 -0
- package/src/MPMapStyle.ts +57 -0
- package/src/MPMultiPolygon.ts +205 -0
- package/src/MPPoint.ts +165 -0
- package/src/MPPolygon.ts +206 -0
- package/src/MPPositionProviderInterface.ts +45 -0
- package/src/MPPositionResultInterface.ts +42 -0
- package/src/MPPropertyData.ts +215 -0
- package/src/MPQuery.ts +69 -0
- package/src/MPRoute.ts +95 -0
- package/src/MPRouteCoordinate.ts +95 -0
- package/src/MPRouteLeg.ts +128 -0
- package/src/MPRouteProperty.ts +83 -0
- package/src/MPRouteStep.ts +176 -0
- package/src/MPSelectionBehavior.ts +93 -0
- package/src/MPSettings3D.ts +107 -0
- package/src/MPSize.ts +21 -0
- package/src/MPSolution.ts +180 -0
- package/src/MPSolutionConfig.ts +127 -0
- package/src/MPSolutionDisplayRule.ts +13 -0
- package/src/MPUserRole.ts +60 -0
- package/src/MPUserRoleCollection.ts +37 -0
- package/src/MPUtils.ts +157 -0
- package/src/MPVenue.ts +294 -0
- package/src/MPVenueCollection.ts +58 -0
- package/src/MPVenueInfo.ts +62 -0
- package/src/MapControl.ts +861 -0
- package/src/MapView.tsx +34 -0
- package/src/MapsIndoors.ts +530 -0
- package/src/OnBuildingFoundAtCameraTargetListener.ts +17 -0
- package/src/OnFloorSelectionChangedListener.ts +17 -0
- package/src/OnFloorUpdateListener.ts +16 -0
- package/src/OnLegSelectedListener.ts +17 -0
- package/src/OnLiveLocationUpdateListener.ts +17 -0
- package/src/OnLocationSelectedListener.ts +17 -0
- package/src/OnMapClickListener.ts +20 -0
- package/src/OnMarkerClickListener.ts +17 -0
- package/src/OnMarkerInfoWindowClickListener.ts +17 -0
- package/src/OnPositionUpdateListener.ts +17 -0
- package/src/OnVenueFoundAtCameraTargetListener.ts +17 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
package com.reactlibrary.models;
|
|
2
|
+
|
|
3
|
+
import com.google.gson.annotations.SerializedName;
|
|
4
|
+
import com.mapsindoors.core.MPFilter;
|
|
5
|
+
import com.mapsindoors.core.MPMapExtend;
|
|
6
|
+
import com.mapsindoors.core.models.MPLatLngBounds;
|
|
7
|
+
|
|
8
|
+
import java.util.List;
|
|
9
|
+
|
|
10
|
+
public class Filter {
|
|
11
|
+
@SerializedName("take")
|
|
12
|
+
private Integer mTake;
|
|
13
|
+
@SerializedName("skip")
|
|
14
|
+
private Integer mSkip;
|
|
15
|
+
@SerializedName("depth")
|
|
16
|
+
private Integer mDepth;
|
|
17
|
+
@SerializedName("floorIndex")
|
|
18
|
+
private Integer mFloorIndex;
|
|
19
|
+
@SerializedName("categories")
|
|
20
|
+
private List<String> mCategories;
|
|
21
|
+
@SerializedName("locations")
|
|
22
|
+
private List<String> mLocations;
|
|
23
|
+
@SerializedName("types")
|
|
24
|
+
private List<String> mTypes;
|
|
25
|
+
@SerializedName("parents")
|
|
26
|
+
private List<String> mParents;
|
|
27
|
+
@SerializedName("mapExtend")
|
|
28
|
+
private Bounds mMapExtend;
|
|
29
|
+
@SerializedName("geometry")
|
|
30
|
+
private Bounds mGeometry;
|
|
31
|
+
@SerializedName("ignoreSearchableStatus")
|
|
32
|
+
private Boolean mIgnoreSearchableStatus;
|
|
33
|
+
@SerializedName("ignoreActiveStatus")
|
|
34
|
+
private Boolean mIgnoreActiveStatus;
|
|
35
|
+
|
|
36
|
+
public MPFilter toMPFilter() {
|
|
37
|
+
MPFilter.Builder builder = new MPFilter.Builder();
|
|
38
|
+
if (mTake != null) {
|
|
39
|
+
builder.setTake(mTake);
|
|
40
|
+
}
|
|
41
|
+
if (mSkip != null) {
|
|
42
|
+
builder.setSkip(mSkip);
|
|
43
|
+
}
|
|
44
|
+
if (mDepth != null) {
|
|
45
|
+
builder.setDepth(mDepth);
|
|
46
|
+
}
|
|
47
|
+
if (mFloorIndex != null) {
|
|
48
|
+
builder.setFloorIndex(mFloorIndex);
|
|
49
|
+
}
|
|
50
|
+
if (mCategories != null) {
|
|
51
|
+
builder.setCategories(mCategories);
|
|
52
|
+
}
|
|
53
|
+
if (mLocations != null) {
|
|
54
|
+
builder.setLocations(mLocations);
|
|
55
|
+
}
|
|
56
|
+
if (mTypes != null) {
|
|
57
|
+
builder.setTypes(mTypes);
|
|
58
|
+
}
|
|
59
|
+
if (mParents != null) {
|
|
60
|
+
builder.setParents(mParents);
|
|
61
|
+
}
|
|
62
|
+
if (mMapExtend != null) {
|
|
63
|
+
builder.setMapExtend(new MPMapExtend(mMapExtend.getSouthWest().getLatLng(), mMapExtend.getNorthEast().getLatLng()));
|
|
64
|
+
}
|
|
65
|
+
if (mGeometry != null) {
|
|
66
|
+
MPLatLngBounds bounds = new MPLatLngBounds(mGeometry.getSouthWest().getLatLng(), mGeometry.getNorthEast().getLatLng());
|
|
67
|
+
builder.setGeometry(new MPFilter.Geometry(bounds.getCenter().getLat(), bounds.getCenter().getLng(), new MPMapExtend(bounds)));
|
|
68
|
+
}
|
|
69
|
+
if (mIgnoreSearchableStatus != null) {
|
|
70
|
+
builder.setIgnoreLocationSearchableStatus(mIgnoreSearchableStatus);
|
|
71
|
+
}
|
|
72
|
+
if (mIgnoreActiveStatus != null) {
|
|
73
|
+
builder.setIgnoreLocationActiveStatus(mIgnoreActiveStatus);
|
|
74
|
+
}
|
|
75
|
+
return builder.build();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.reactlibrary.models;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
|
|
5
|
+
import com.google.gson.annotations.SerializedName;
|
|
6
|
+
import com.mapsindoors.core.MPLocation;
|
|
7
|
+
import com.mapsindoors.core.MapsIndoors;
|
|
8
|
+
|
|
9
|
+
public class Location {
|
|
10
|
+
@SerializedName("id")
|
|
11
|
+
String id;
|
|
12
|
+
|
|
13
|
+
@Nullable
|
|
14
|
+
public MPLocation toMPLocation() {
|
|
15
|
+
return MapsIndoors.getLocationById(id);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
package com.reactlibrary.models;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.google.gson.annotations.SerializedName;
|
|
5
|
+
import com.mapbox.maps.CameraState;
|
|
6
|
+
import com.mapsindoors.core.MPPoint;
|
|
7
|
+
|
|
8
|
+
import javax.annotation.Nullable;
|
|
9
|
+
|
|
10
|
+
public class MPCameraPosition {
|
|
11
|
+
@SerializedName("zoom")
|
|
12
|
+
@Nullable
|
|
13
|
+
Float zoom;
|
|
14
|
+
@SerializedName("tilt")
|
|
15
|
+
@Nullable
|
|
16
|
+
Float tilt;
|
|
17
|
+
@SerializedName("bearing")
|
|
18
|
+
@Nullable
|
|
19
|
+
Float bearing;
|
|
20
|
+
@SerializedName("target")
|
|
21
|
+
@NonNull
|
|
22
|
+
MPPoint target;
|
|
23
|
+
public MPCameraPosition(CameraState position) {
|
|
24
|
+
zoom = Double.valueOf(position.getZoom()).floatValue();
|
|
25
|
+
tilt = Double.valueOf(position.getPitch()).floatValue();
|
|
26
|
+
bearing = Double.valueOf(position.getBearing()).floatValue();
|
|
27
|
+
target = new MPPoint(position.getCenter().latitude(), position.getCenter().longitude());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
package com.reactlibrary.models;
|
|
2
|
+
|
|
3
|
+
import com.google.gson.annotations.SerializedName;
|
|
4
|
+
import com.mapbox.geojson.Point;
|
|
5
|
+
import com.mapbox.maps.CameraOptions;
|
|
6
|
+
import com.mapbox.maps.CoordinateBounds;
|
|
7
|
+
import com.mapbox.maps.EdgeInsets;
|
|
8
|
+
import com.mapbox.maps.MapboxMap;
|
|
9
|
+
import com.mapsindoors.core.MPPoint;
|
|
10
|
+
|
|
11
|
+
public class MPCameraUpdate {
|
|
12
|
+
@SerializedName("mode")
|
|
13
|
+
String modeString;
|
|
14
|
+
@SerializedName("point")
|
|
15
|
+
MPPoint point;
|
|
16
|
+
@SerializedName("bounds")
|
|
17
|
+
Bounds bounds;
|
|
18
|
+
@SerializedName("padding")
|
|
19
|
+
Integer padding;
|
|
20
|
+
@SerializedName("width")
|
|
21
|
+
Integer width;
|
|
22
|
+
@SerializedName("height")
|
|
23
|
+
Integer height;
|
|
24
|
+
@SerializedName("zoom")
|
|
25
|
+
Float zoom;
|
|
26
|
+
@SerializedName("position")
|
|
27
|
+
MPCameraPosition position;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
private CameraUpdateMode getMode() {
|
|
31
|
+
return CameraUpdateMode.fromString(modeString);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public CameraOptions toCameraOptions(MapboxMap map) {
|
|
35
|
+
CameraUpdateMode mode = getMode();
|
|
36
|
+
if (mode == null) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
switch (mode) {
|
|
41
|
+
case FROM_POINT:
|
|
42
|
+
return new CameraOptions.Builder().center(Point.fromLngLat(point.getLng(),point.getLat())).build();
|
|
43
|
+
case FROM_BOUNDS:
|
|
44
|
+
Point southWest = Point.fromLngLat(bounds.getSouthWest().getLng(), bounds.getSouthWest().getLat());
|
|
45
|
+
Point northEast = Point.fromLngLat(bounds.getNorthEast().getLng(), bounds.getNorthEast().getLat());
|
|
46
|
+
CoordinateBounds coordinateBounds = new CoordinateBounds(southWest, northEast);
|
|
47
|
+
return map.cameraForCoordinateBounds(coordinateBounds, new EdgeInsets(0,0,0,0), null, null);
|
|
48
|
+
case ZOOM_BY:
|
|
49
|
+
return new CameraOptions.Builder().zoom(map.getCameraState().getZoom() + zoom).build();
|
|
50
|
+
case ZOOM_TO:
|
|
51
|
+
return new CameraOptions.Builder().zoom(Double.valueOf(zoom)).build();
|
|
52
|
+
case FROM_CAMERA_POSITION:
|
|
53
|
+
return new CameraOptions.Builder()
|
|
54
|
+
.center(Point.fromLngLat(position.target.getLng(), position.target.getLat()))
|
|
55
|
+
.zoom(Double.valueOf(position.zoom))
|
|
56
|
+
.bearing(Double.valueOf(position.bearing))
|
|
57
|
+
.pitch(Double.valueOf(position.tilt))
|
|
58
|
+
.build();
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public enum CameraUpdateMode {
|
|
64
|
+
FROM_POINT("fromPoint"),
|
|
65
|
+
FROM_BOUNDS("fromBounds"),
|
|
66
|
+
ZOOM_BY("zoomBy"),
|
|
67
|
+
ZOOM_TO("zoomTo"),
|
|
68
|
+
FROM_CAMERA_POSITION("fromCameraPosition");
|
|
69
|
+
final String mode;
|
|
70
|
+
CameraUpdateMode(String mode) {
|
|
71
|
+
this.mode = mode;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public static CameraUpdateMode fromString(String value) {
|
|
75
|
+
switch (value) {
|
|
76
|
+
case "fromPoint":
|
|
77
|
+
return FROM_POINT;
|
|
78
|
+
case "fromBounds":
|
|
79
|
+
return FROM_BOUNDS;
|
|
80
|
+
case "zoomBy":
|
|
81
|
+
return ZOOM_BY;
|
|
82
|
+
case "zoomTo":
|
|
83
|
+
return ZOOM_TO;
|
|
84
|
+
case "fromCameraPosition":
|
|
85
|
+
return FROM_CAMERA_POSITION;
|
|
86
|
+
default:
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
package com.reactlibrary.models;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
import com.google.gson.annotations.SerializedName;
|
|
7
|
+
import com.mapsindoors.core.errors.MIError;
|
|
8
|
+
|
|
9
|
+
public class MPError {
|
|
10
|
+
@NonNull
|
|
11
|
+
@SerializedName("code")
|
|
12
|
+
private final Integer mCode;
|
|
13
|
+
@NonNull
|
|
14
|
+
@SerializedName("message")
|
|
15
|
+
private final String mMessage;
|
|
16
|
+
@Nullable
|
|
17
|
+
@SerializedName("status")
|
|
18
|
+
private final Integer mStatus;
|
|
19
|
+
@Nullable
|
|
20
|
+
@SerializedName("tag")
|
|
21
|
+
private final Object mTag;
|
|
22
|
+
|
|
23
|
+
MPError(int code, @NonNull String message, @Nullable Integer status, @Nullable Object tag) {
|
|
24
|
+
mCode = code;
|
|
25
|
+
mMessage = message;
|
|
26
|
+
mStatus = status;
|
|
27
|
+
mTag = tag;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Nullable
|
|
31
|
+
public static MPError fromMIError(@Nullable MIError miError) {
|
|
32
|
+
if (miError != null) {
|
|
33
|
+
return new MPError(miError.code, miError.message, miError.status, miError.tag);
|
|
34
|
+
} else {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
package com.reactlibrary.models;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
import com.mapsindoors.core.MPPositionProvider;
|
|
7
|
+
import com.mapsindoors.core.MPPositionResultInterface;
|
|
8
|
+
import com.mapsindoors.core.OnPositionUpdateListener;
|
|
9
|
+
|
|
10
|
+
import java.util.ArrayList;
|
|
11
|
+
import java.util.List;
|
|
12
|
+
|
|
13
|
+
public class PositionProvider implements MPPositionProvider {
|
|
14
|
+
private String mName;
|
|
15
|
+
private List<OnPositionUpdateListener> onPositionUpdateListeners;
|
|
16
|
+
private MPPositionResultInterface latest;
|
|
17
|
+
|
|
18
|
+
public PositionProvider(String name) {
|
|
19
|
+
mName = name;
|
|
20
|
+
onPositionUpdateListeners = new ArrayList<>();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public void addOnPositionUpdateListener(@NonNull OnPositionUpdateListener onPositionUpdateListener) {
|
|
26
|
+
onPositionUpdateListeners.add(onPositionUpdateListener);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public void removeOnPositionUpdateListener(@NonNull OnPositionUpdateListener onPositionUpdateListener) {
|
|
31
|
+
onPositionUpdateListeners.remove(onPositionUpdateListener);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@Nullable
|
|
35
|
+
@Override
|
|
36
|
+
public MPPositionResultInterface getLatestPosition() {
|
|
37
|
+
return latest;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public void updatePosition(@Nullable MPPositionResultInterface position) {
|
|
41
|
+
latest = position;
|
|
42
|
+
for (OnPositionUpdateListener onPositionUpdateListener : onPositionUpdateListeners) {
|
|
43
|
+
onPositionUpdateListener.onPositionUpdate(position);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
package com.reactlibrary.models;
|
|
2
|
+
|
|
3
|
+
import android.location.Location;
|
|
4
|
+
|
|
5
|
+
import androidx.annotation.Nullable;
|
|
6
|
+
|
|
7
|
+
import com.google.gson.annotations.SerializedName;
|
|
8
|
+
import com.mapsindoors.core.MPPoint;
|
|
9
|
+
import com.mapsindoors.core.MPPositionProvider;
|
|
10
|
+
import com.mapsindoors.core.MPPositionResultInterface;
|
|
11
|
+
|
|
12
|
+
public class PositionResult implements MPPositionResultInterface {
|
|
13
|
+
@SerializedName("point")
|
|
14
|
+
private MPPoint mPoint;
|
|
15
|
+
@SerializedName("floorIndex")
|
|
16
|
+
private Integer mFloorIndex;
|
|
17
|
+
@SerializedName("bearing")
|
|
18
|
+
private Float mBearing;
|
|
19
|
+
@SerializedName("accuracy")
|
|
20
|
+
private Float mAccuracy;
|
|
21
|
+
@SerializedName("providerName")
|
|
22
|
+
private String mProviderName;
|
|
23
|
+
|
|
24
|
+
@Nullable
|
|
25
|
+
@Override
|
|
26
|
+
public MPPoint getPoint() {
|
|
27
|
+
return mPoint;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Override
|
|
31
|
+
public boolean hasFloor() {
|
|
32
|
+
return mFloorIndex != null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@Override
|
|
36
|
+
public int getFloorIndex() {
|
|
37
|
+
if (hasFloor()) {
|
|
38
|
+
return mFloorIndex;
|
|
39
|
+
}else {
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@Override
|
|
45
|
+
public void setFloorIndex(int i) {
|
|
46
|
+
mFloorIndex = i;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@Override
|
|
50
|
+
public boolean hasBearing() {
|
|
51
|
+
return mBearing != null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@Override
|
|
55
|
+
public float getBearing() {
|
|
56
|
+
if (mBearing != null) {
|
|
57
|
+
return mBearing;
|
|
58
|
+
}else {
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@Override
|
|
64
|
+
public void setBearing(float v) {
|
|
65
|
+
mBearing = v;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@Override
|
|
69
|
+
public boolean hasAccuracy() {
|
|
70
|
+
return mAccuracy != null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@Override
|
|
74
|
+
public float getAccuracy() {
|
|
75
|
+
if (mAccuracy != null) {
|
|
76
|
+
return mAccuracy;
|
|
77
|
+
}else {
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@Override
|
|
83
|
+
public void setAccuracy(float v) {
|
|
84
|
+
mAccuracy = v;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@Nullable
|
|
88
|
+
@Override
|
|
89
|
+
public MPPositionProvider getProvider() {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@Override
|
|
94
|
+
public void setProvider(@Nullable MPPositionProvider mpPositionProvider) {
|
|
95
|
+
//Unimplemented
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@Nullable
|
|
99
|
+
@Override
|
|
100
|
+
public Location getAndroidLocation() {
|
|
101
|
+
if (mPoint != null) {
|
|
102
|
+
Location location = new Location(mProviderName);
|
|
103
|
+
location.setBearing(mBearing);
|
|
104
|
+
location.setAccuracy(mAccuracy);
|
|
105
|
+
location.setLatitude(mPoint.getLat());
|
|
106
|
+
location.setLongitude(mPoint.getLng());
|
|
107
|
+
return location;
|
|
108
|
+
}else {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@Override
|
|
114
|
+
public void setAndroidLocation(@Nullable Location location) {
|
|
115
|
+
//unimplemented
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package com.reactlibrary.models;
|
|
2
|
+
|
|
3
|
+
import com.google.gson.annotations.SerializedName;
|
|
4
|
+
import com.mapsindoors.core.MPPoint;
|
|
5
|
+
import com.mapsindoors.core.MPQuery;
|
|
6
|
+
|
|
7
|
+
import java.util.List;
|
|
8
|
+
|
|
9
|
+
public class Query {
|
|
10
|
+
@SerializedName("query")
|
|
11
|
+
private String mQuery;
|
|
12
|
+
@SerializedName("near")
|
|
13
|
+
private MPPoint mNear;
|
|
14
|
+
@SerializedName("queryProperties")
|
|
15
|
+
private List<String> mQueryProperties;
|
|
16
|
+
|
|
17
|
+
public MPQuery toMPQuery() {
|
|
18
|
+
MPQuery.Builder builder = new MPQuery.Builder();
|
|
19
|
+
if (mQuery != null) {
|
|
20
|
+
builder.setQuery(mQuery);
|
|
21
|
+
}
|
|
22
|
+
if (mNear != null) {
|
|
23
|
+
builder.setNear(mNear);
|
|
24
|
+
}
|
|
25
|
+
if (mQueryProperties != null) {
|
|
26
|
+
builder.setQueryProperties(mQueryProperties);
|
|
27
|
+
}
|
|
28
|
+
return builder.build();
|
|
29
|
+
}
|
|
30
|
+
}
|
package/index.ts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import MPGeometry from './src/MPGeometry';
|
|
2
|
+
import MPPoint from './src/MPPoint';
|
|
3
|
+
import MPEntity from './src/MPEntity';
|
|
4
|
+
import MPVenue from './src/MPVenue';
|
|
5
|
+
import MPFloor from './src/MPFloor';
|
|
6
|
+
import MPQuery from './src/MPQuery';
|
|
7
|
+
import MPError from './src/MPError';
|
|
8
|
+
import MPFilter from './src/MPFilter';
|
|
9
|
+
import MPBounds from './src/MPBounds';
|
|
10
|
+
import { MPLocationType } from './src/MPLocationType';
|
|
11
|
+
import { MPLocationPropertyNames } from './src/MPLocationPropertyNames';
|
|
12
|
+
import MPPolygon from './src/MPPolygon';
|
|
13
|
+
import MPMapStyle from './src/MPMapStyle';
|
|
14
|
+
import MPBuilding from './src/MPBuilding';
|
|
15
|
+
import MPLocation from './src/MPLocation';
|
|
16
|
+
import MPCategory from './src/MPCategory';
|
|
17
|
+
import MapControl from './src/MapControl';
|
|
18
|
+
import MPIconSize from './src/MPIconSize';
|
|
19
|
+
import MPUserRole from './src/MPUserRole';
|
|
20
|
+
import MPSolution from './src/MPSolution';
|
|
21
|
+
import MapsIndoors from './src/MapsIndoors';
|
|
22
|
+
import MPVenueInfo from './src/MPVenueInfo';
|
|
23
|
+
import MPDataField from './src/MPDataField';
|
|
24
|
+
import MPMapConfig from './src/MPMapConfig';
|
|
25
|
+
import MPSettings3D from './src/MPSettings3D';
|
|
26
|
+
import MPDisplayRule from './src/MPDisplayRule';
|
|
27
|
+
import MPCameraEvent from './src/MPCameraEvent';
|
|
28
|
+
import MPCameraUpdate from './src/MPCameraUpdate';
|
|
29
|
+
import MPMultiPolygon from './src/MPMultiPolygon';
|
|
30
|
+
import MPRoute from './src/MPRoute';
|
|
31
|
+
import MPRouteCoordinate from './src/MPRouteCoordinate';
|
|
32
|
+
import MPRouteLeg from './src/MPRouteLeg';
|
|
33
|
+
import MPRouteStep from './src/MPRouteStep';
|
|
34
|
+
import MPRouteProperty from './src/MPRouteProperty';
|
|
35
|
+
import MPDirectionsRenderer from './src/MPDirectionsRenderer';
|
|
36
|
+
import MPDirectionsService from './src/MPDirectionsService';
|
|
37
|
+
import { MPCameraViewFitMode } from './src/MPCameraViewFitMode';
|
|
38
|
+
import MPCameraPosition from './src/MPCameraPosition';
|
|
39
|
+
import MPFilterBehavior from './src/MPFilterBehavior';
|
|
40
|
+
import MPSolutionConfig from './src/MPSolutionConfig';
|
|
41
|
+
import { OnMapClickListener } from './src/OnMapClickListener';
|
|
42
|
+
import MPSelectionBehavior from './src/MPSelectionBehavior';
|
|
43
|
+
import { MPCollisionHandling } from './src/MPCollisionHandling';
|
|
44
|
+
import { MPSolutionDisplayRule } from './src/MPSolutionDisplayRule';
|
|
45
|
+
import MPCameraEventListener from './src/MPCameraEventListener';
|
|
46
|
+
import { OnFloorUpdateListener } from './src/OnFloorUpdateListener';
|
|
47
|
+
import { OnMarkerClickListener } from './src/OnMarkerClickListener';
|
|
48
|
+
import { OnPositionUpdateListener } from './src/OnPositionUpdateListener';
|
|
49
|
+
import { MPFloorSelectorInterface } from './src/MPFloorSelectorInterface';
|
|
50
|
+
import { MPPositionResultInterface } from './src/MPPositionResultInterface';
|
|
51
|
+
import { OnLocationSelectedListener } from './src/OnLocationSelectedListener';
|
|
52
|
+
import { MPPositionProviderInterface } from './src/MPPositionProviderInterface';
|
|
53
|
+
import { OnLiveLocationUpdateListener } from './src/OnLiveLocationUpdateListener';
|
|
54
|
+
import { OnMarkerInfoWindowClickListener } from './src/OnMarkerInfoWindowClickListener';
|
|
55
|
+
import { OnFloorSelectionChangedListener } from './src/OnFloorSelectionChangedListener';
|
|
56
|
+
import { OnVenueFoundAtCameraTargetListener } from './src/OnVenueFoundAtCameraTargetListener';
|
|
57
|
+
import { OnBuildingFoundAtCameraTargetListener } from './src/OnBuildingFoundAtCameraTargetListener';
|
|
58
|
+
import { OnLegSelectedListener } from './src/OnLegSelectedListener';
|
|
59
|
+
import MPBuildingCollection from './src/MPBuildingCollection';
|
|
60
|
+
import MPVenueCollection from './src/MPVenueCollection';
|
|
61
|
+
import MPCategoryCollection from './src/MPCategoryCollection';
|
|
62
|
+
import MPUserRoleCollection from './src/MPUserRoleCollection';
|
|
63
|
+
import { MPHighway } from './src/MPHighway';
|
|
64
|
+
import { MPFloorParams } from './src/MPFloor';
|
|
65
|
+
import { MPQueryParams } from './src/MPQuery';
|
|
66
|
+
import { MPRouteParams } from './src/MPRoute';
|
|
67
|
+
import { MPVenueParams } from './src/MPVenue';
|
|
68
|
+
import { MPPointParams } from './src/MPPoint';
|
|
69
|
+
import { MPBoundsParams } from './src/MPBounds';
|
|
70
|
+
import { MPFilterParams } from './src/MPFilter';
|
|
71
|
+
import { MPPolygonParams } from './src/MPPolygon';
|
|
72
|
+
import { MPBuildingParams } from './src/MPBuilding';
|
|
73
|
+
import { MPCategoryParams } from './src/MPCategory';
|
|
74
|
+
import { MPMapStyleParams } from './src/MPMapStyle';
|
|
75
|
+
import { MPRouteLegParams } from './src/MPRouteLeg';
|
|
76
|
+
import { MPSolutionParams } from './src/MPSolution';
|
|
77
|
+
import { MPUserRoleParams } from './src/MPUserRole';
|
|
78
|
+
import { MPDataFieldParams } from './src/MPDataField';
|
|
79
|
+
import { MPMapConfigParams } from './src/MPMapConfig';
|
|
80
|
+
import { MPRouteStepParams } from './src/MPRouteStep';
|
|
81
|
+
import { MPVenueInfoParams } from './src/MPVenueInfo';
|
|
82
|
+
import { MPMultiPolygonParams } from './src/MPMultiPolygon';
|
|
83
|
+
import { MPRoutePropertyParams } from './src/MPRouteProperty';
|
|
84
|
+
import { MPCameraPositionParams } from './src/MPCameraPosition';
|
|
85
|
+
import { MPFilterBehaviorParams } from './src/MPFilterBehavior';
|
|
86
|
+
import { MPSolutionConfigParams } from './src/MPSolutionConfig';
|
|
87
|
+
import { MPRouteCoordinateParams } from './src/MPRouteCoordinate';
|
|
88
|
+
import MapView from './src/MapView';
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
export default MapsIndoors;
|
|
92
|
+
export {
|
|
93
|
+
MapControl,
|
|
94
|
+
MPBounds,
|
|
95
|
+
MPBuilding,
|
|
96
|
+
MPCameraEvent,
|
|
97
|
+
MPCameraPosition,
|
|
98
|
+
MPCameraUpdate,
|
|
99
|
+
MPCategory,
|
|
100
|
+
MPCollisionHandling,
|
|
101
|
+
MPDataField,
|
|
102
|
+
MPDisplayRule,
|
|
103
|
+
MPError,
|
|
104
|
+
MPFilter,
|
|
105
|
+
MPFilterBehavior,
|
|
106
|
+
MPSelectionBehavior,
|
|
107
|
+
MPFloor,
|
|
108
|
+
MPPoint,
|
|
109
|
+
MPGeometry,
|
|
110
|
+
MPIconSize,
|
|
111
|
+
MPLocation,
|
|
112
|
+
MPMapConfig,
|
|
113
|
+
MPMapStyle,
|
|
114
|
+
MPMultiPolygon,
|
|
115
|
+
MPPolygon,
|
|
116
|
+
MPQuery,
|
|
117
|
+
MPSettings3D,
|
|
118
|
+
MPSolution,
|
|
119
|
+
MPSolutionConfig,
|
|
120
|
+
MPSolutionDisplayRule,
|
|
121
|
+
MPUserRole,
|
|
122
|
+
MPVenue,
|
|
123
|
+
MPVenueInfo,
|
|
124
|
+
MPLocationType,
|
|
125
|
+
MPLocationPropertyNames,
|
|
126
|
+
MPDirectionsRenderer,
|
|
127
|
+
MPDirectionsService,
|
|
128
|
+
MPRoute,
|
|
129
|
+
MPRouteCoordinate,
|
|
130
|
+
MPRouteLeg,
|
|
131
|
+
MPRouteProperty,
|
|
132
|
+
MPRouteStep,
|
|
133
|
+
MPCameraViewFitMode,
|
|
134
|
+
MPBuildingCollection,
|
|
135
|
+
MPVenueCollection,
|
|
136
|
+
MPCategoryCollection,
|
|
137
|
+
MPUserRoleCollection,
|
|
138
|
+
MPHighway,
|
|
139
|
+
MapView
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export type {
|
|
143
|
+
MPFloorSelectorInterface,
|
|
144
|
+
MPPositionProviderInterface,
|
|
145
|
+
MPPositionResultInterface,
|
|
146
|
+
MPCameraEventListener,
|
|
147
|
+
OnMapClickListener,
|
|
148
|
+
OnPositionUpdateListener,
|
|
149
|
+
OnFloorUpdateListener,
|
|
150
|
+
OnFloorSelectionChangedListener,
|
|
151
|
+
OnLocationSelectedListener,
|
|
152
|
+
OnVenueFoundAtCameraTargetListener,
|
|
153
|
+
OnBuildingFoundAtCameraTargetListener,
|
|
154
|
+
OnMarkerClickListener,
|
|
155
|
+
OnMarkerInfoWindowClickListener,
|
|
156
|
+
OnLiveLocationUpdateListener,
|
|
157
|
+
OnLegSelectedListener,
|
|
158
|
+
MPEntity,
|
|
159
|
+
MPFloorParams,
|
|
160
|
+
MPQueryParams,
|
|
161
|
+
MPRouteParams,
|
|
162
|
+
MPVenueParams,
|
|
163
|
+
MPPointParams,
|
|
164
|
+
MPBoundsParams,
|
|
165
|
+
MPFilterParams,
|
|
166
|
+
MPPolygonParams,
|
|
167
|
+
MPBuildingParams,
|
|
168
|
+
MPCategoryParams,
|
|
169
|
+
MPMapStyleParams,
|
|
170
|
+
MPRouteLegParams,
|
|
171
|
+
MPSolutionParams,
|
|
172
|
+
MPUserRoleParams,
|
|
173
|
+
MPDataFieldParams,
|
|
174
|
+
MPMapConfigParams,
|
|
175
|
+
MPRouteStepParams,
|
|
176
|
+
MPVenueInfoParams,
|
|
177
|
+
MPMultiPolygonParams,
|
|
178
|
+
MPRoutePropertyParams,
|
|
179
|
+
MPCameraPositionParams,
|
|
180
|
+
MPFilterBehaviorParams,
|
|
181
|
+
MPSolutionConfigParams,
|
|
182
|
+
MPRouteCoordinateParams
|
|
183
|
+
};
|
|
184
|
+
|