@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,95 @@
|
|
|
1
|
+
import MPRouteStep from "../index";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A coordinate used for routing, it is contained within a {@link MPRouteStep}.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class MPRouteCoordinate
|
|
8
|
+
* @typedef {MPRouteCoordinate}
|
|
9
|
+
*/
|
|
10
|
+
export default class MPRouteCoordinate {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of MPRouteCoordinate.
|
|
14
|
+
*
|
|
15
|
+
* @constructor
|
|
16
|
+
* @private
|
|
17
|
+
* @param {?number} [latitude] The latitude part of the coordinate.
|
|
18
|
+
* @param {?number} [longitude] The longitude part of the coordinate.
|
|
19
|
+
* @param {?number} [floorIndex] The index of the floor the coordinate is on.
|
|
20
|
+
* @param {?string} [floorName] The name of the floor the coordinate is on.
|
|
21
|
+
*/
|
|
22
|
+
private constructor(
|
|
23
|
+
public readonly latitude?: number,
|
|
24
|
+
public readonly longitude?: number,
|
|
25
|
+
public readonly floorIndex?: number,
|
|
26
|
+
public readonly floorName?: string,
|
|
27
|
+
) { }
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Creator for MPRouteCoordinate, used to decode JSON from the MapsIndoors SDK.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
* @static
|
|
34
|
+
* @param {MPRouteCoordinateParams} object
|
|
35
|
+
* @returns {MPRouteCoordinate}
|
|
36
|
+
*/
|
|
37
|
+
public static create(object: MPRouteCoordinateParams): MPRouteCoordinate {
|
|
38
|
+
return new MPRouteCoordinate(
|
|
39
|
+
object?.lat,
|
|
40
|
+
object?.lng,
|
|
41
|
+
object?.zLevel,
|
|
42
|
+
object?.floor_name,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
* @returns {MPRouteCoordinateParams}
|
|
52
|
+
*/
|
|
53
|
+
public toJSON(): MPRouteCoordinateParams {
|
|
54
|
+
return {
|
|
55
|
+
lat: this.latitude,
|
|
56
|
+
lng: this.longitude,
|
|
57
|
+
zLevel: this.floorIndex,
|
|
58
|
+
floor_name: this.floorName,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Parameter interface for {@link MPRouteCoordinate}.
|
|
65
|
+
*
|
|
66
|
+
* @export
|
|
67
|
+
* @interface MPRouteCoordinateParams
|
|
68
|
+
* @typedef {MPRouteCoordinateParams}
|
|
69
|
+
*/
|
|
70
|
+
export interface MPRouteCoordinateParams {
|
|
71
|
+
/**
|
|
72
|
+
* The latitude part of the coordinate.
|
|
73
|
+
*
|
|
74
|
+
* @type {?number}
|
|
75
|
+
*/
|
|
76
|
+
lat?: number;
|
|
77
|
+
/**
|
|
78
|
+
* The longitude part of the coordinate.
|
|
79
|
+
*
|
|
80
|
+
* @type {?number}
|
|
81
|
+
*/
|
|
82
|
+
lng?: number;
|
|
83
|
+
/**
|
|
84
|
+
* The index of the floor the coordinate is on.
|
|
85
|
+
*
|
|
86
|
+
* @type {?number}
|
|
87
|
+
*/
|
|
88
|
+
zLevel?: number;
|
|
89
|
+
/**
|
|
90
|
+
* The name of the floor the coordinate is on.
|
|
91
|
+
*
|
|
92
|
+
* @type {?string}
|
|
93
|
+
*/
|
|
94
|
+
floor_name?: string;
|
|
95
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { MPRouteStep, MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams, MPRoute } from "../index";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A leg of a {@link MPRoute} is defined as all steps between any context shifts (entering/exiting buildings, changing floors).
|
|
5
|
+
*
|
|
6
|
+
* A leg is comprised of a list of {@link steps} as well as a {@link startLocation} and an {@link endLocation}.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class MPRouteLeg
|
|
10
|
+
* @typedef {MPRouteLeg}
|
|
11
|
+
*/
|
|
12
|
+
export default class MPRouteLeg {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of MPRouteLeg.
|
|
16
|
+
*
|
|
17
|
+
* @constructor
|
|
18
|
+
* @private
|
|
19
|
+
* @param {?MPRouteStep[]} [steps] The steps the leg consists of.
|
|
20
|
+
* @param {?MPRouteProperty} [distance] The distance of the leg.
|
|
21
|
+
* @param {?MPRouteProperty} [duration] The expected time it takes to traverse the leg.
|
|
22
|
+
* @param {?string} [startAddress] The address at the start of the leg.
|
|
23
|
+
* @param {?string} [endAdress] The address at the end of the leg.
|
|
24
|
+
* @param {?MPRouteCoordinate} [startLocation] The start coordinate of the leg.
|
|
25
|
+
* @param {?MPRouteCoordinate} [endLocation] The end coordinate of the leg.
|
|
26
|
+
*/
|
|
27
|
+
private constructor(
|
|
28
|
+
public readonly steps?: MPRouteStep[],
|
|
29
|
+
public readonly distance?: MPRouteProperty,
|
|
30
|
+
public readonly duration?: MPRouteProperty,
|
|
31
|
+
public readonly startAddress?: string,
|
|
32
|
+
public readonly endAdress?: string,
|
|
33
|
+
public readonly startLocation?: MPRouteCoordinate,
|
|
34
|
+
public readonly endLocation?: MPRouteCoordinate,
|
|
35
|
+
) { }
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Creator for MPRouteLeg, used to decode JSON from the MapsIndoors SDK.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
* @static
|
|
43
|
+
* @param {MPRouteLegParams} object
|
|
44
|
+
* @returns {MPRouteLeg}
|
|
45
|
+
*/
|
|
46
|
+
public static create(object: MPRouteLegParams): MPRouteLeg {
|
|
47
|
+
return new MPRouteLeg(
|
|
48
|
+
object?.steps ? object?.steps.map((step: any) => MPRouteStep.create(step)) : undefined,
|
|
49
|
+
MPRouteProperty.create(object?.distance as MPRoutePropertyParams),
|
|
50
|
+
MPRouteProperty.create(object?.duration as MPRoutePropertyParams),
|
|
51
|
+
object?.start_address,
|
|
52
|
+
object?.end_address,
|
|
53
|
+
MPRouteCoordinate.create(object?.start_location as MPRouteCoordinateParams),
|
|
54
|
+
MPRouteCoordinate.create(object?.end_location as MPRouteCoordinateParams),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
* @returns {MPRouteLegParams}
|
|
64
|
+
*/
|
|
65
|
+
public toJSON(): MPRouteLegParams {
|
|
66
|
+
return {
|
|
67
|
+
start_address: this.startAddress,
|
|
68
|
+
end_address: this.endAdress,
|
|
69
|
+
start_location: this.startLocation,
|
|
70
|
+
end_location: this.endLocation,
|
|
71
|
+
steps: this.steps,
|
|
72
|
+
distance: this.distance,
|
|
73
|
+
duration: this.duration,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Parameter interface for {@link MPRouteLeg}.
|
|
80
|
+
*
|
|
81
|
+
* @export
|
|
82
|
+
* @interface MPRouteLegParams
|
|
83
|
+
* @typedef {MPRouteLegParams}
|
|
84
|
+
*/
|
|
85
|
+
export interface MPRouteLegParams {
|
|
86
|
+
/**
|
|
87
|
+
* The steps the leg consists of.
|
|
88
|
+
*
|
|
89
|
+
* @type {?MPRouteStep[]}
|
|
90
|
+
*/
|
|
91
|
+
steps?: MPRouteStep[];
|
|
92
|
+
/**
|
|
93
|
+
* The distance of the leg.
|
|
94
|
+
*
|
|
95
|
+
* @type {?MPRouteProperty}
|
|
96
|
+
*/
|
|
97
|
+
distance?: MPRouteProperty;
|
|
98
|
+
/**
|
|
99
|
+
* The expected time it takes to traverse the leg.
|
|
100
|
+
*
|
|
101
|
+
* @type {?MPRouteProperty}
|
|
102
|
+
*/
|
|
103
|
+
duration?: MPRouteProperty;
|
|
104
|
+
/**
|
|
105
|
+
* The address at the start of the leg.
|
|
106
|
+
*
|
|
107
|
+
* @type {?string}
|
|
108
|
+
*/
|
|
109
|
+
start_address?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The address at the end of the leg.
|
|
112
|
+
*
|
|
113
|
+
* @type {?string}
|
|
114
|
+
*/
|
|
115
|
+
end_address?: string;
|
|
116
|
+
/**
|
|
117
|
+
* The start coordinate of the leg.
|
|
118
|
+
*
|
|
119
|
+
* @type {?MPRouteCoordinate}
|
|
120
|
+
*/
|
|
121
|
+
start_location?: MPRouteCoordinate;
|
|
122
|
+
/**
|
|
123
|
+
* The end coordinate of the leg.
|
|
124
|
+
*
|
|
125
|
+
* @type {?MPRouteCoordinate}
|
|
126
|
+
*/
|
|
127
|
+
end_location?: MPRouteCoordinate;
|
|
128
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A property of of a route.
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @class MPRouteProperty
|
|
6
|
+
* @typedef {MPRouteProperty}
|
|
7
|
+
*/
|
|
8
|
+
export default class MPRouteProperty {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creates an instance of MPRouteProperty.
|
|
12
|
+
*
|
|
13
|
+
* @constructor
|
|
14
|
+
* @private
|
|
15
|
+
* @param {?string} [text]
|
|
16
|
+
* @param {?number} [value]
|
|
17
|
+
* @param {?string} [timeZone]
|
|
18
|
+
*/
|
|
19
|
+
private constructor(
|
|
20
|
+
public readonly value?: number,
|
|
21
|
+
public readonly text?: string,
|
|
22
|
+
public readonly timeZone?: string,
|
|
23
|
+
) { }
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creator for MPRouteProperty, used to decode JSON from the MapsIndoors SDK.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
* @static
|
|
30
|
+
* @param {MPRoutePropertyParams} object
|
|
31
|
+
* @returns {MPRouteProperty}
|
|
32
|
+
*/
|
|
33
|
+
public static create(object: MPRoutePropertyParams): MPRouteProperty {
|
|
34
|
+
return new MPRouteProperty(
|
|
35
|
+
object?.value,
|
|
36
|
+
object?.text,
|
|
37
|
+
object?.time_zone,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
44
|
+
*
|
|
45
|
+
* @public
|
|
46
|
+
* @returns {MPRoutePropertyParams}
|
|
47
|
+
*/
|
|
48
|
+
public toJSON(): MPRoutePropertyParams {
|
|
49
|
+
return {
|
|
50
|
+
value: this.value,
|
|
51
|
+
text: this.text,
|
|
52
|
+
time_zone: this.timeZone,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Parameter interface for {@link MPRouteProperty}.
|
|
59
|
+
*
|
|
60
|
+
* @export
|
|
61
|
+
* @interface MPRoutePropertyParams
|
|
62
|
+
* @typedef {MPRoutePropertyParams}
|
|
63
|
+
*/
|
|
64
|
+
export interface MPRoutePropertyParams {
|
|
65
|
+
/**
|
|
66
|
+
* The value of the property.
|
|
67
|
+
*
|
|
68
|
+
* @type {?number}
|
|
69
|
+
*/
|
|
70
|
+
value?: number,
|
|
71
|
+
/**
|
|
72
|
+
* Accompanying text to the value.
|
|
73
|
+
*
|
|
74
|
+
* @type {?string}
|
|
75
|
+
*/
|
|
76
|
+
text?: string,
|
|
77
|
+
/**
|
|
78
|
+
* The timezone of the property.
|
|
79
|
+
*
|
|
80
|
+
* @type {?string}
|
|
81
|
+
*/
|
|
82
|
+
time_zone?: string,
|
|
83
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams } from "../index";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Description placeholder.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class MPRouteStep
|
|
8
|
+
* @typedef {MPRouteStep}
|
|
9
|
+
*/
|
|
10
|
+
export default class MPRouteStep {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of MPRouteStep.
|
|
14
|
+
*
|
|
15
|
+
* @constructor
|
|
16
|
+
* @private
|
|
17
|
+
* @param {?MPRouteProperty} [distance]
|
|
18
|
+
* @param {?MPRouteProperty} [duration]
|
|
19
|
+
* @param {?MPRouteStep[]} [steps]
|
|
20
|
+
* @param {?MPRouteCoordinate[]} [geometry]
|
|
21
|
+
* @param {?string} [highway]
|
|
22
|
+
* @param {?string} [abutters]
|
|
23
|
+
* @param {?string} [maneuver]
|
|
24
|
+
* @param {?MPRouteCoordinate} [startLocation]
|
|
25
|
+
* @param {?MPRouteCoordinate} [endLocation]
|
|
26
|
+
* @param {?string} [htmlInstructions]
|
|
27
|
+
* @param {?string} [travelMode]
|
|
28
|
+
* @param {?string[]} [availableTravelModes]
|
|
29
|
+
*/
|
|
30
|
+
private constructor(
|
|
31
|
+
public readonly distance?: MPRouteProperty,
|
|
32
|
+
public readonly duration?: MPRouteProperty,
|
|
33
|
+
public readonly steps?: MPRouteStep[],
|
|
34
|
+
public readonly geometry?: MPRouteCoordinate[],
|
|
35
|
+
public readonly highway?: string,
|
|
36
|
+
public readonly abutters?: string,
|
|
37
|
+
public readonly maneuver?: string,
|
|
38
|
+
public readonly startLocation?: MPRouteCoordinate,
|
|
39
|
+
public readonly endLocation?: MPRouteCoordinate,
|
|
40
|
+
public readonly htmlInstructions?: string,
|
|
41
|
+
public readonly travelMode?: string,
|
|
42
|
+
public readonly availableTravelModes?: string[],
|
|
43
|
+
) { }
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Creator for MPRouteStep, used to decode JSON from the MapsIndoors SDK.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
* @static
|
|
51
|
+
* @param {MPRouteStepParams} object
|
|
52
|
+
* @returns {MPRouteStep}
|
|
53
|
+
*/
|
|
54
|
+
public static create(object: MPRouteStepParams): MPRouteStep {
|
|
55
|
+
return new MPRouteStep(
|
|
56
|
+
MPRouteProperty.create(object?.distance as MPRoutePropertyParams),
|
|
57
|
+
MPRouteProperty.create(object?.duration as MPRoutePropertyParams),
|
|
58
|
+
object?.steps ? object?.steps.map((subStep: any) => MPRouteStep.create(subStep)): undefined,
|
|
59
|
+
object?.geometry ? object?.geometry.map((geo: any) => MPRouteCoordinate.create(geo)): undefined,
|
|
60
|
+
object?.highway,
|
|
61
|
+
object?.abutters,
|
|
62
|
+
object?.maneuver,
|
|
63
|
+
MPRouteCoordinate.create(object?.start_location as MPRouteCoordinateParams),
|
|
64
|
+
MPRouteCoordinate.create(object?.end_location as MPRouteCoordinateParams),
|
|
65
|
+
object?.html_instructions,
|
|
66
|
+
object?.travel_mode,
|
|
67
|
+
object?.available_travel_modes,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
74
|
+
*
|
|
75
|
+
* @public
|
|
76
|
+
* @returns {MPRouteStepParams}
|
|
77
|
+
*/
|
|
78
|
+
public toJSON(): MPRouteStepParams {
|
|
79
|
+
return {
|
|
80
|
+
distance: this.distance,
|
|
81
|
+
duration: this.duration,
|
|
82
|
+
start_location: this.startLocation,
|
|
83
|
+
end_location: this.endLocation,
|
|
84
|
+
geometry: this.geometry,
|
|
85
|
+
highway: this.highway,
|
|
86
|
+
abutters: this.abutters,
|
|
87
|
+
html_instructions: this.htmlInstructions,
|
|
88
|
+
maneuver: this.maneuver,
|
|
89
|
+
travel_mode: this.travelMode,
|
|
90
|
+
steps: this.steps,
|
|
91
|
+
available_travel_modes: this.availableTravelModes,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Parameter interface for {@link MPRouteStep}.
|
|
98
|
+
*
|
|
99
|
+
* @export
|
|
100
|
+
* @interface MPRouteStepParams
|
|
101
|
+
* @typedef {MPRouteStepParams}
|
|
102
|
+
*/
|
|
103
|
+
export interface MPRouteStepParams {
|
|
104
|
+
/**
|
|
105
|
+
* Description placeholder.
|
|
106
|
+
*
|
|
107
|
+
* @type {?MPRouteProperty}
|
|
108
|
+
*/
|
|
109
|
+
distance?: MPRouteProperty,
|
|
110
|
+
/**
|
|
111
|
+
* Description placeholder.
|
|
112
|
+
*
|
|
113
|
+
* @type {?MPRouteProperty}
|
|
114
|
+
*/
|
|
115
|
+
duration?: MPRouteProperty,
|
|
116
|
+
/**
|
|
117
|
+
* Description placeholder.
|
|
118
|
+
*
|
|
119
|
+
* @type {?MPRouteStep[]}
|
|
120
|
+
*/
|
|
121
|
+
steps?: MPRouteStep[],
|
|
122
|
+
/**
|
|
123
|
+
* Description placeholder.
|
|
124
|
+
*
|
|
125
|
+
* @type {?MPRouteCoordinate[]}
|
|
126
|
+
*/
|
|
127
|
+
geometry?: MPRouteCoordinate[],
|
|
128
|
+
/**
|
|
129
|
+
* Description placeholder.
|
|
130
|
+
*
|
|
131
|
+
* @type {?string}
|
|
132
|
+
*/
|
|
133
|
+
highway?: string,
|
|
134
|
+
/**
|
|
135
|
+
* Description placeholder.
|
|
136
|
+
*
|
|
137
|
+
* @type {?string}
|
|
138
|
+
*/
|
|
139
|
+
abutters?: string,
|
|
140
|
+
/**
|
|
141
|
+
* Description placeholder.
|
|
142
|
+
*
|
|
143
|
+
* @type {?string}
|
|
144
|
+
*/
|
|
145
|
+
maneuver?: string,
|
|
146
|
+
/**
|
|
147
|
+
* Description placeholder.
|
|
148
|
+
*
|
|
149
|
+
* @type {?MPRouteCoordinate}
|
|
150
|
+
*/
|
|
151
|
+
start_location?: MPRouteCoordinate,
|
|
152
|
+
/**
|
|
153
|
+
* Description placeholder.
|
|
154
|
+
*
|
|
155
|
+
* @type {?MPRouteCoordinate}
|
|
156
|
+
*/
|
|
157
|
+
end_location?: MPRouteCoordinate,
|
|
158
|
+
/**
|
|
159
|
+
* Description placeholder.
|
|
160
|
+
*
|
|
161
|
+
* @type {?string}
|
|
162
|
+
*/
|
|
163
|
+
html_instructions?: string,
|
|
164
|
+
/**
|
|
165
|
+
* Description placeholder.
|
|
166
|
+
*
|
|
167
|
+
* @type {?string}
|
|
168
|
+
*/
|
|
169
|
+
travel_mode?: string,
|
|
170
|
+
/**
|
|
171
|
+
* Description placeholder.
|
|
172
|
+
*
|
|
173
|
+
* @type {?string[]}
|
|
174
|
+
*/
|
|
175
|
+
available_travel_modes?: string[],
|
|
176
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import MapControl from "../index";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sets a behavior for the map when calling {@link MapControl#selectLocation}.
|
|
5
|
+
*
|
|
6
|
+
* Has a default behavior:
|
|
7
|
+
* * MoveCamera = false
|
|
8
|
+
* * ShowInfoWindow = false
|
|
9
|
+
* * AnimationDuration = 0
|
|
10
|
+
* * AllowFloorChange = false
|
|
11
|
+
* * ZoomToFit = true
|
|
12
|
+
*
|
|
13
|
+
* @export
|
|
14
|
+
* @class MPFilterBehavior
|
|
15
|
+
* @typedef {MPFilterBehavior}
|
|
16
|
+
*/
|
|
17
|
+
export default class MPSelectionBehavior {
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of MPSelectionBehavior.
|
|
20
|
+
*
|
|
21
|
+
* @constructor
|
|
22
|
+
* @private
|
|
23
|
+
* @param {boolean} allowFloorChange
|
|
24
|
+
* @param {boolean} moveCamera
|
|
25
|
+
* @param {number} animationDuration
|
|
26
|
+
* @param {boolean} showInfoWindow
|
|
27
|
+
* @param {boolean} zoomToFit
|
|
28
|
+
*/
|
|
29
|
+
private constructor(
|
|
30
|
+
public allowFloorChange: boolean,
|
|
31
|
+
public moveCamera: boolean,
|
|
32
|
+
public animationDuration: number,
|
|
33
|
+
public showInfoWindow: boolean,
|
|
34
|
+
public zoomToFit: boolean,
|
|
35
|
+
) { }
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Creator for MPSelectionBehavior, used to decode JSON from the MapsIndoors SDK.
|
|
39
|
+
*
|
|
40
|
+
* @static
|
|
41
|
+
* @param {MPSelectionBehaviorParams} object
|
|
42
|
+
* @returns {MPSelectionBehavior}
|
|
43
|
+
*/
|
|
44
|
+
static create(object: MPSelectionBehaviorParams): MPSelectionBehavior {
|
|
45
|
+
return new MPSelectionBehavior(
|
|
46
|
+
object?.allowFloorChange ?? true,
|
|
47
|
+
object?.moveCamera ?? true,
|
|
48
|
+
object?.animationDuration ?? 500,
|
|
49
|
+
object?.showInfoWindow ?? true,
|
|
50
|
+
object?.zoomToFit ?? true
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Parameter interface for {@link MPSelectionBehavior}.
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
* @interface MPSelectionBehaviorParams
|
|
60
|
+
* @typedef {MPSelectionBehaviorParams}
|
|
61
|
+
*/
|
|
62
|
+
export interface MPSelectionBehaviorParams {
|
|
63
|
+
/**
|
|
64
|
+
* Whether the filtering is allowed to change the floor if no results are visible on the current floor.
|
|
65
|
+
*
|
|
66
|
+
* @type {?boolean}
|
|
67
|
+
*/
|
|
68
|
+
allowFloorChange?: boolean,
|
|
69
|
+
/**
|
|
70
|
+
* Whether the filtering should move the camera to encompass the results.
|
|
71
|
+
*
|
|
72
|
+
* @type {?boolean}
|
|
73
|
+
*/
|
|
74
|
+
moveCamera?: boolean,
|
|
75
|
+
/**
|
|
76
|
+
* How long the camera movement should be animated for, set to 0 disables animation.
|
|
77
|
+
*
|
|
78
|
+
* @type {?number}
|
|
79
|
+
*/
|
|
80
|
+
animationDuration?: number,
|
|
81
|
+
/**
|
|
82
|
+
* Whether to open the info window if a single result is returned.
|
|
83
|
+
*
|
|
84
|
+
* @type {?boolean}
|
|
85
|
+
*/
|
|
86
|
+
showInfoWindow?: boolean,
|
|
87
|
+
/**
|
|
88
|
+
* Whether the filtering is allowed to zoom in/out the camera.
|
|
89
|
+
*
|
|
90
|
+
* @type {?boolean}
|
|
91
|
+
*/
|
|
92
|
+
zoomToFit?: boolean,
|
|
93
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import MPUtils from "./MPUtils";
|
|
2
|
+
import { MPSolutionConfig } from "../index"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A configuration object that governs layer settings for 3D features.
|
|
6
|
+
*
|
|
7
|
+
* Can be aquired with {@link MPSolutionConfig.settings3D}.
|
|
8
|
+
*
|
|
9
|
+
* @export
|
|
10
|
+
* @class MPSettings3D
|
|
11
|
+
* @typedef {MPSettings3D}
|
|
12
|
+
*/
|
|
13
|
+
export default class MPSettings3D {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of MPSettings3D.
|
|
17
|
+
*
|
|
18
|
+
* @constructor
|
|
19
|
+
* @private
|
|
20
|
+
* @param {?number} [_extrusionOpacity]
|
|
21
|
+
* @param {?number} [_wallOpacity]
|
|
22
|
+
*/
|
|
23
|
+
private constructor(
|
|
24
|
+
private _extrusionOpacity?: number,
|
|
25
|
+
private _wallOpacity?: number,
|
|
26
|
+
) { }
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Creator for MPSettings3D, used to decode JSON from the MapsIndoors SDK.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
* @static
|
|
34
|
+
* @param {MPSettings3DParams} object
|
|
35
|
+
* @returns {MPSettings3D}
|
|
36
|
+
*/
|
|
37
|
+
public static create(object: MPSettings3DParams): MPSettings3D {
|
|
38
|
+
return new MPSettings3D(
|
|
39
|
+
object?.extrusionOpacity,
|
|
40
|
+
object?.wallOpacity,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Set the opacity of extruded rooms.
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
* @type {number}
|
|
49
|
+
*/
|
|
50
|
+
public set extrusionOpacity(opacity: number) {
|
|
51
|
+
this._extrusionOpacity = opacity;
|
|
52
|
+
MPUtils.setExtrusionOpacity(opacity)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get the opacity of extruded rooms.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
* @type {number}
|
|
60
|
+
*/
|
|
61
|
+
public get extrusionOpacity(): number {
|
|
62
|
+
return this._extrusionOpacity!;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Set the opacity of extruded walls.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
* @type {number}
|
|
70
|
+
*/
|
|
71
|
+
public set wallOpacity(opacity: number) {
|
|
72
|
+
this._wallOpacity = opacity;
|
|
73
|
+
MPUtils.setWallOpacity(opacity);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Get the opacity of extruded walls.
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
* @type {number}
|
|
81
|
+
*/
|
|
82
|
+
public get wallOpacity(): number {
|
|
83
|
+
return this._wallOpacity!;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Parameter interface for {@link MPSettings3D}.
|
|
89
|
+
*
|
|
90
|
+
* @export
|
|
91
|
+
* @interface MPSettings3DParams
|
|
92
|
+
* @typedef {MPSettings3DParams}
|
|
93
|
+
*/
|
|
94
|
+
export interface MPSettings3DParams {
|
|
95
|
+
/**
|
|
96
|
+
* The opacity of extruded rooms.
|
|
97
|
+
*
|
|
98
|
+
* @type {?number}
|
|
99
|
+
*/
|
|
100
|
+
extrusionOpacity?: number,
|
|
101
|
+
/**
|
|
102
|
+
* The opacity of extruded walls.
|
|
103
|
+
*
|
|
104
|
+
* @type {?number}
|
|
105
|
+
*/
|
|
106
|
+
wallOpacity?: number,
|
|
107
|
+
}
|
package/src/MPSize.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A container for a height/width pair.
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @interface MPSize
|
|
6
|
+
* @typedef {MPSize}
|
|
7
|
+
*/
|
|
8
|
+
export default interface MPSize {
|
|
9
|
+
/**
|
|
10
|
+
* Height.
|
|
11
|
+
*
|
|
12
|
+
* @type {number}
|
|
13
|
+
*/
|
|
14
|
+
height: number;
|
|
15
|
+
/**
|
|
16
|
+
* Width.
|
|
17
|
+
*
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
width: number;
|
|
21
|
+
}
|