@mapsindoors/react-native-maps-indoors-mapbox 2.6.0 → 2.6.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/README.md +2 -2
- package/android/build.gradle +1 -1
- package/package.json +1 -1
- package/react-native-maps-indoors-mapbox.podspec +2 -2
- package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +0 -322
- package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +0 -166
- package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +0 -1699
- package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +0 -761
- package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +0 -410
- package/android/src/main/java/com/mapsindoorsrn/core/RCMapView.java +0 -16
- package/android/src/main/java/com/mapsindoorsrn/core/README.md +0 -3
- package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +0 -227
- package/android/src/main/java/com/mapsindoorsrn/core/models/BitmapStopIconConfig.java +0 -22
- package/android/src/main/java/com/mapsindoorsrn/core/models/Bounds.java +0 -19
- package/android/src/main/java/com/mapsindoorsrn/core/models/Filter.java +0 -77
- package/android/src/main/java/com/mapsindoorsrn/core/models/Location.java +0 -17
- package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraPosition.java +0 -34
- package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraUpdate.java +0 -68
- package/android/src/main/java/com/mapsindoorsrn/core/models/MPError.java +0 -38
- package/android/src/main/java/com/mapsindoorsrn/core/models/PositionProvider.java +0 -46
- package/android/src/main/java/com/mapsindoorsrn/core/models/PositionResult.java +0 -117
- package/android/src/main/java/com/mapsindoorsrn/core/models/Query.java +0 -30
- package/android/src/main/java/com/mapsindoorsrn/core/models/RouteStopIconConfigModel.java +0 -35
- package/ios/core/CameraPosition.swift +0 -15
- package/ios/core/CameraUpdate.swift +0 -19
- package/ios/core/CameraUpdateError.swift +0 -11
- package/ios/core/DirectionsRendererBridge.m +0 -59
- package/ios/core/DirectionsRendererModule.swift +0 -359
- package/ios/core/DirectionsServiceBridge.m +0 -55
- package/ios/core/DirectionsServiceModule.swift +0 -186
- package/ios/core/IconStopUrl.swift +0 -17
- package/ios/core/LabelGraphic.swift +0 -15
- package/ios/core/MPDisplayRuleBridge.m +0 -696
- package/ios/core/MPDisplayRuleModule.swift +0 -1704
- package/ios/core/MapControlBridge.m +0 -213
- package/ios/core/MapControlModule.swift +0 -702
- package/ios/core/MapsIndoorsBridge.m +0 -128
- package/ios/core/MapsIndoorsData.swift +0 -288
- package/ios/core/MapsIndoorsModule.swift +0 -363
- package/ios/core/RCMapView.swift +0 -16
- package/ios/core/README.md +0 -3
- package/ios/core/ReactPositionProvider.swift +0 -27
- package/ios/core/RouteIcon.swift +0 -34
- package/ios/core/UtilsBridge.m +0 -73
- package/ios/core/UtilsModule.swift +0 -182
- package/ios/core/helpers.swift +0 -57
- package/src/core/EventNames.ts +0 -21
- package/src/core/MPAdditionalDetail.ts +0 -102
- package/src/core/MPBadgePosition.ts +0 -12
- package/src/core/MPBounds.ts +0 -155
- package/src/core/MPBuilding.ts +0 -333
- package/src/core/MPBuildingCollection.ts +0 -57
- package/src/core/MPBuildingInfo.ts +0 -63
- package/src/core/MPCameraEvent.ts +0 -17
- package/src/core/MPCameraEventListener.ts +0 -17
- package/src/core/MPCameraPosition.ts +0 -82
- package/src/core/MPCameraUpdate.ts +0 -174
- package/src/core/MPCameraViewFitMode.ts +0 -25
- package/src/core/MPCategory.ts +0 -85
- package/src/core/MPCategoryCollection.ts +0 -62
- package/src/core/MPCollection.ts +0 -59
- package/src/core/MPCollisionHandling.ts +0 -12
- package/src/core/MPDailyOpeningHours.ts +0 -67
- package/src/core/MPDataField.ts +0 -69
- package/src/core/MPDetailType.ts +0 -73
- package/src/core/MPDirectionsRenderer.ts +0 -238
- package/src/core/MPDirectionsService.ts +0 -152
- package/src/core/MPDisplayRule.ts +0 -1823
- package/src/core/MPEntity.ts +0 -60
- package/src/core/MPEntityInfo.ts +0 -28
- package/src/core/MPError.ts +0 -122
- package/src/core/MPFeatureTypes.ts +0 -8
- package/src/core/MPFilter.ts +0 -168
- package/src/core/MPFilterBehavior.ts +0 -115
- package/src/core/MPFloor.ts +0 -170
- package/src/core/MPFloorSelectorInterface.ts +0 -63
- package/src/core/MPGeometry.ts +0 -91
- package/src/core/MPHighlightBehavior.ts +0 -115
- package/src/core/MPHighway.ts +0 -14
- package/src/core/MPIconPlacement.ts +0 -13
- package/src/core/MPIconSize.ts +0 -39
- package/src/core/MPLabelGraphic.ts +0 -24
- package/src/core/MPLabelPosition.ts +0 -12
- package/src/core/MPLabelType.ts +0 -11
- package/src/core/MPLocation.ts +0 -440
- package/src/core/MPLocationPropertyNames.ts +0 -30
- package/src/core/MPLocationSettings.ts +0 -40
- package/src/core/MPLocationType.ts +0 -16
- package/src/core/MPMapConfig.ts +0 -280
- package/src/core/MPMapStyle.ts +0 -57
- package/src/core/MPMultiPolygon.ts +0 -218
- package/src/core/MPOpeningHours.ts +0 -48
- package/src/core/MPPOIType.ts +0 -43
- package/src/core/MPPoint.ts +0 -169
- package/src/core/MPPolygon.ts +0 -219
- package/src/core/MPPositionProviderInterface.ts +0 -45
- package/src/core/MPPositionResultInterface.ts +0 -42
- package/src/core/MPPropertyData.ts +0 -234
- package/src/core/MPQuery.ts +0 -69
- package/src/core/MPRoute.ts +0 -105
- package/src/core/MPRouteCoordinate.ts +0 -95
- package/src/core/MPRouteLeg.ts +0 -158
- package/src/core/MPRouteProperty.ts +0 -83
- package/src/core/MPRouteStep.ts +0 -186
- package/src/core/MPRouteStopIconConfig.ts +0 -82
- package/src/core/MPSelectionBehavior.ts +0 -114
- package/src/core/MPSelectionMode.ts +0 -4
- package/src/core/MPSettings3D.ts +0 -107
- package/src/core/MPSize.ts +0 -21
- package/src/core/MPSolution.ts +0 -189
- package/src/core/MPSolutionConfig.ts +0 -188
- package/src/core/MPSolutionDisplayRule.ts +0 -15
- package/src/core/MPUserRole.ts +0 -60
- package/src/core/MPUserRoleCollection.ts +0 -37
- package/src/core/MPUtils.ts +0 -178
- package/src/core/MPVenue.ts +0 -294
- package/src/core/MPVenueCollection.ts +0 -58
- package/src/core/MPVenueInfo.ts +0 -62
- package/src/core/MPWeeklyOpeningHours.ts +0 -129
- package/src/core/MapControl.ts +0 -961
- package/src/core/MapView.tsx +0 -34
- package/src/core/MapsIndoors.ts +0 -571
- package/src/core/OnBuildingFoundAtCameraTargetListener.ts +0 -17
- package/src/core/OnFloorSelectionChangedListener.ts +0 -17
- package/src/core/OnFloorUpdateListener.ts +0 -16
- package/src/core/OnLegSelectedListener.ts +0 -17
- package/src/core/OnLiveLocationUpdateListener.ts +0 -17
- package/src/core/OnLocationSelectedListener.ts +0 -17
- package/src/core/OnMapClickListener.ts +0 -20
- package/src/core/OnMarkerClickListener.ts +0 -17
- package/src/core/OnMarkerInfoWindowClickListener.ts +0 -17
- package/src/core/OnPositionUpdateListener.ts +0 -17
- package/src/core/OnVenueFoundAtCameraTargetListener.ts +0 -17
- package/src/core/README.md +0 -3
- package/src/core/RouteStopIconConfig.ts +0 -10
package/src/core/MPQuery.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { MPPoint, MPLocationPropertyNames } from "../../index";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A collection of query parameters used to query entities in MapsIndoors.
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
|
-
* @class MPQuery
|
|
8
|
-
* @typedef {MPQuery}
|
|
9
|
-
*/
|
|
10
|
-
export default class MPQuery {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates an instance of MPQuery.
|
|
14
|
-
*
|
|
15
|
-
* @constructor
|
|
16
|
-
* @private
|
|
17
|
-
* @param {?string} [query] The queried text (search text).
|
|
18
|
-
* @param {?MPPoint} [near] The query is restricted to entities near this point.
|
|
19
|
-
* @param {?string[]} [queryProperties] A list of properties for this query, Uses {@link MPLocationPropertyNames}.
|
|
20
|
-
*/
|
|
21
|
-
private constructor(
|
|
22
|
-
public readonly query?: string,
|
|
23
|
-
public readonly near?: MPPoint,
|
|
24
|
-
public readonly queryProperties?: string[],
|
|
25
|
-
) { }
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Creator for MPQuery, used to decode JSON from the MapsIndoors SDK.
|
|
29
|
-
*
|
|
30
|
-
* @static
|
|
31
|
-
* @param {?MPQueryParams} [object]
|
|
32
|
-
* @returns {MPQuery}
|
|
33
|
-
*/
|
|
34
|
-
static create(object?: MPQueryParams): MPQuery {
|
|
35
|
-
return new MPQuery(
|
|
36
|
-
object?.query,
|
|
37
|
-
object?.near,
|
|
38
|
-
object?.queryProperties
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Parameter interface for {@link MPQuery}.
|
|
45
|
-
*
|
|
46
|
-
* @export
|
|
47
|
-
* @interface MPQueryParams
|
|
48
|
-
* @typedef {MPQueryParams}
|
|
49
|
-
*/
|
|
50
|
-
export interface MPQueryParams {
|
|
51
|
-
/**
|
|
52
|
-
* The queried text (search text).
|
|
53
|
-
*
|
|
54
|
-
* @type {?string}
|
|
55
|
-
*/
|
|
56
|
-
query?: string,
|
|
57
|
-
/**
|
|
58
|
-
* The query is restricted to entities near this point.
|
|
59
|
-
*
|
|
60
|
-
* @type {?MPPoint}
|
|
61
|
-
*/
|
|
62
|
-
near?: MPPoint,
|
|
63
|
-
/**
|
|
64
|
-
* A list of properties for this query, Uses {@link MPLocationPropertyNames}.
|
|
65
|
-
*
|
|
66
|
-
* @type {?string[]}
|
|
67
|
-
*/
|
|
68
|
-
queryProperties?: string[],
|
|
69
|
-
}
|
package/src/core/MPRoute.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { MPBounds, MPRouteLeg, MPBoundsParams, MPRouteLegParams } from "../../index";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A route from a origin to a destination broken up into {@link legs}.
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
|
-
* @class MPRoute
|
|
8
|
-
* @typedef {MPRoute}
|
|
9
|
-
*/
|
|
10
|
-
export default class MPRoute {
|
|
11
|
-
/**
|
|
12
|
-
* Creates an instance of MPRoute.
|
|
13
|
-
*
|
|
14
|
-
* @constructor
|
|
15
|
-
* @private
|
|
16
|
-
* @param {?MPRouteLeg[]} [legs] The legs the route consists of.
|
|
17
|
-
* @param {?string} [copyrights] The copyrights for this route, if any exists.
|
|
18
|
-
* @param {?string} [summary] A summary of the route.
|
|
19
|
-
* @param {?string[]} [warnings] Any warnings issued for any paths on the route.
|
|
20
|
-
* @param {?string[]} [restrictions] All restrictions in place for the route.
|
|
21
|
-
* @param {?MPBounds} [bounds] The outer bounds of the route.
|
|
22
|
-
* @param {?number[]} [orderedStopIndexes] The original indexes of the stops in the route.
|
|
23
|
-
*/
|
|
24
|
-
private constructor(
|
|
25
|
-
public readonly legs?: MPRouteLeg[],
|
|
26
|
-
public readonly copyrights?: string,
|
|
27
|
-
public readonly summary?: string,
|
|
28
|
-
public readonly warnings?: string[],
|
|
29
|
-
public readonly restrictions?: string[],
|
|
30
|
-
public readonly bounds?: MPBounds,
|
|
31
|
-
public readonly ordered_stop_indexes?: number[],
|
|
32
|
-
) { }
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Creator for MPRoute, used to decode JSON from the MapsIndoors SDK.
|
|
36
|
-
*
|
|
37
|
-
* @static
|
|
38
|
-
* @param {MPRouteParams} object
|
|
39
|
-
* @returns {MPRoute}
|
|
40
|
-
*/
|
|
41
|
-
static create(object: MPRouteParams): MPRoute {
|
|
42
|
-
return new MPRoute(
|
|
43
|
-
object?.legs ? object?.legs.map((leg: any) => MPRouteLeg.create(leg)) : undefined,
|
|
44
|
-
object?.copyrights,
|
|
45
|
-
object?.summary,
|
|
46
|
-
object?.warnings,
|
|
47
|
-
object?.restrictions,
|
|
48
|
-
object?.bounds ? MPBounds.create(object?.bounds) : undefined,
|
|
49
|
-
object?.ordered_stop_indexes,
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Parameter interface for {@link MPRoute}.
|
|
56
|
-
*
|
|
57
|
-
* @export
|
|
58
|
-
* @interface MPRouteParams
|
|
59
|
-
* @typedef {MPRouteParams}
|
|
60
|
-
*/
|
|
61
|
-
export interface MPRouteParams {
|
|
62
|
-
/**
|
|
63
|
-
* The legs the route consists of.
|
|
64
|
-
*
|
|
65
|
-
* @type {?MPRouteLegParams[]}
|
|
66
|
-
*/
|
|
67
|
-
legs?: MPRouteLegParams[],
|
|
68
|
-
/**
|
|
69
|
-
* The copyrights for this route, if any exists.
|
|
70
|
-
*
|
|
71
|
-
* @type {?string}
|
|
72
|
-
*/
|
|
73
|
-
copyrights?: string,
|
|
74
|
-
/**
|
|
75
|
-
* A summary of the route.
|
|
76
|
-
*
|
|
77
|
-
* @type {?string}
|
|
78
|
-
*/
|
|
79
|
-
summary?: string,
|
|
80
|
-
/**
|
|
81
|
-
* Any warnings issued for any paths on the route.
|
|
82
|
-
*
|
|
83
|
-
* @type {?string[]}
|
|
84
|
-
*/
|
|
85
|
-
warnings?: string[],
|
|
86
|
-
/**
|
|
87
|
-
* All restrictions in place for the route.
|
|
88
|
-
*
|
|
89
|
-
* @type {?string[]}
|
|
90
|
-
*/
|
|
91
|
-
restrictions?: string[],
|
|
92
|
-
/**
|
|
93
|
-
* The outer bounds of the route.
|
|
94
|
-
*
|
|
95
|
-
* @type {?MPBoundsParams}
|
|
96
|
-
*/
|
|
97
|
-
bounds?: MPBoundsParams,
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* The original indexes of the stops in the route.
|
|
101
|
-
*
|
|
102
|
-
* @type {?number[]}
|
|
103
|
-
*/
|
|
104
|
-
ordered_stop_indexes?: number[],
|
|
105
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
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
|
-
}
|
package/src/core/MPRouteLeg.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
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
|
-
* @param {?string} [legStartReason] The reason for the start of the leg.
|
|
27
|
-
* @param {?string} [legEndReason] The reason for the end of the leg.
|
|
28
|
-
* @param {?number} [stopIndex] The index of the stop.
|
|
29
|
-
*/
|
|
30
|
-
private constructor(
|
|
31
|
-
public readonly steps?: MPRouteStep[],
|
|
32
|
-
public readonly distance?: MPRouteProperty,
|
|
33
|
-
public readonly duration?: MPRouteProperty,
|
|
34
|
-
public readonly startAddress?: string,
|
|
35
|
-
public readonly endAdress?: string,
|
|
36
|
-
public readonly startLocation?: MPRouteCoordinate,
|
|
37
|
-
public readonly endLocation?: MPRouteCoordinate,
|
|
38
|
-
public readonly legStartReason?: string,
|
|
39
|
-
public readonly legEndReason?: string,
|
|
40
|
-
public readonly stopIndex?: number,
|
|
41
|
-
) { }
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Creator for MPRouteLeg, used to decode JSON from the MapsIndoors SDK.
|
|
46
|
-
*
|
|
47
|
-
* @public
|
|
48
|
-
* @static
|
|
49
|
-
* @param {MPRouteLegParams} object
|
|
50
|
-
* @returns {MPRouteLeg}
|
|
51
|
-
*/
|
|
52
|
-
public static create(object: MPRouteLegParams): MPRouteLeg {
|
|
53
|
-
return new MPRouteLeg(
|
|
54
|
-
object?.steps ? object?.steps.map((step: any) => MPRouteStep.create(step)) : undefined,
|
|
55
|
-
MPRouteProperty.create(object?.distance as MPRoutePropertyParams),
|
|
56
|
-
MPRouteProperty.create(object?.duration as MPRoutePropertyParams),
|
|
57
|
-
object?.start_address,
|
|
58
|
-
object?.end_address,
|
|
59
|
-
MPRouteCoordinate.create(object?.start_location as MPRouteCoordinateParams),
|
|
60
|
-
MPRouteCoordinate.create(object?.end_location as MPRouteCoordinateParams),
|
|
61
|
-
object?.leg_start_reason,
|
|
62
|
-
object?.leg_end_reason,
|
|
63
|
-
object?.stop_index,
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
70
|
-
*
|
|
71
|
-
* @public
|
|
72
|
-
* @returns {MPRouteLegParams}
|
|
73
|
-
*/
|
|
74
|
-
public toJSON(): MPRouteLegParams {
|
|
75
|
-
return {
|
|
76
|
-
start_address: this.startAddress,
|
|
77
|
-
end_address: this.endAdress,
|
|
78
|
-
start_location: this.startLocation,
|
|
79
|
-
end_location: this.endLocation,
|
|
80
|
-
steps: this.steps,
|
|
81
|
-
distance: this.distance,
|
|
82
|
-
duration: this.duration,
|
|
83
|
-
leg_start_reason: this.legStartReason,
|
|
84
|
-
leg_end_reason: this.legEndReason,
|
|
85
|
-
stop_index: this.stopIndex,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Parameter interface for {@link MPRouteLeg}.
|
|
92
|
-
*
|
|
93
|
-
* @export
|
|
94
|
-
* @interface MPRouteLegParams
|
|
95
|
-
* @typedef {MPRouteLegParams}
|
|
96
|
-
*/
|
|
97
|
-
export interface MPRouteLegParams {
|
|
98
|
-
/**
|
|
99
|
-
* The steps the leg consists of.
|
|
100
|
-
*
|
|
101
|
-
* @type {?MPRouteStep[]}
|
|
102
|
-
*/
|
|
103
|
-
steps?: MPRouteStep[];
|
|
104
|
-
/**
|
|
105
|
-
* The distance of the leg.
|
|
106
|
-
*
|
|
107
|
-
* @type {?MPRouteProperty}
|
|
108
|
-
*/
|
|
109
|
-
distance?: MPRouteProperty;
|
|
110
|
-
/**
|
|
111
|
-
* The expected time it takes to traverse the leg.
|
|
112
|
-
*
|
|
113
|
-
* @type {?MPRouteProperty}
|
|
114
|
-
*/
|
|
115
|
-
duration?: MPRouteProperty;
|
|
116
|
-
/**
|
|
117
|
-
* The address at the start of the leg.
|
|
118
|
-
*
|
|
119
|
-
* @type {?string}
|
|
120
|
-
*/
|
|
121
|
-
start_address?: string;
|
|
122
|
-
/**
|
|
123
|
-
* The address at the end of the leg.
|
|
124
|
-
*
|
|
125
|
-
* @type {?string}
|
|
126
|
-
*/
|
|
127
|
-
end_address?: string;
|
|
128
|
-
/**
|
|
129
|
-
* The start coordinate of the leg.
|
|
130
|
-
*
|
|
131
|
-
* @type {?MPRouteCoordinate}
|
|
132
|
-
*/
|
|
133
|
-
start_location?: MPRouteCoordinate;
|
|
134
|
-
/**
|
|
135
|
-
* The end coordinate of the leg.
|
|
136
|
-
*
|
|
137
|
-
* @type {?MPRouteCoordinate}
|
|
138
|
-
*/
|
|
139
|
-
end_location?: MPRouteCoordinate;
|
|
140
|
-
/**
|
|
141
|
-
* The reason for the start of the leg.
|
|
142
|
-
*
|
|
143
|
-
* @type {?string}
|
|
144
|
-
*/
|
|
145
|
-
leg_start_reason?: string;
|
|
146
|
-
/**
|
|
147
|
-
* The reason for the end of the leg.
|
|
148
|
-
*
|
|
149
|
-
* @type {?string}
|
|
150
|
-
*/
|
|
151
|
-
leg_end_reason?: string;
|
|
152
|
-
/**
|
|
153
|
-
* The index of the stop.
|
|
154
|
-
*
|
|
155
|
-
* @type {?number}
|
|
156
|
-
*/
|
|
157
|
-
stop_index?: number;
|
|
158
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
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
|
-
}
|
package/src/core/MPRouteStep.ts
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { Platform } from "react-native";
|
|
2
|
-
import { MPRouteProperty, MPRoutePropertyParams, MPRouteCoordinate, MPRouteCoordinateParams } from "../../index";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Description placeholder.
|
|
6
|
-
*
|
|
7
|
-
* @export
|
|
8
|
-
* @class MPRouteStep
|
|
9
|
-
* @typedef {MPRouteStep}
|
|
10
|
-
*/
|
|
11
|
-
export default class MPRouteStep {
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Creates an instance of MPRouteStep.
|
|
15
|
-
*
|
|
16
|
-
* @constructor
|
|
17
|
-
* @private
|
|
18
|
-
* @param {?MPRouteProperty} [distance]
|
|
19
|
-
* @param {?MPRouteProperty} [duration]
|
|
20
|
-
* @param {?MPRouteStep[]} [steps]
|
|
21
|
-
* @param {?MPRouteCoordinate[]} [geometry]
|
|
22
|
-
* @param {?string} [highway]
|
|
23
|
-
* @param {?string} [abutters]
|
|
24
|
-
* @param {?string} [maneuver]
|
|
25
|
-
* @param {?MPRouteCoordinate} [startLocation]
|
|
26
|
-
* @param {?MPRouteCoordinate} [endLocation]
|
|
27
|
-
* @param {?string} [htmlInstructions]
|
|
28
|
-
* @param {?string} [travelMode]
|
|
29
|
-
* @param {?string[]} [availableTravelModes]
|
|
30
|
-
*/
|
|
31
|
-
private constructor(
|
|
32
|
-
public readonly distance?: MPRouteProperty,
|
|
33
|
-
public readonly duration?: MPRouteProperty,
|
|
34
|
-
public readonly steps?: MPRouteStep[],
|
|
35
|
-
public readonly geometry?: MPRouteCoordinate[],
|
|
36
|
-
public readonly highway?: string,
|
|
37
|
-
public readonly abutters?: string,
|
|
38
|
-
public readonly maneuver?: string,
|
|
39
|
-
public readonly startLocation?: MPRouteCoordinate,
|
|
40
|
-
public readonly endLocation?: MPRouteCoordinate,
|
|
41
|
-
public readonly htmlInstructions?: string,
|
|
42
|
-
public readonly travelMode?: string,
|
|
43
|
-
public readonly availableTravelModes?: string[],
|
|
44
|
-
) { }
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Creator for MPRouteStep, used to decode JSON from the MapsIndoors SDK.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
* @static
|
|
52
|
-
* @param {MPRouteStepParams} object
|
|
53
|
-
* @returns {MPRouteStep}
|
|
54
|
-
*/
|
|
55
|
-
public static create(object: MPRouteStepParams): MPRouteStep {
|
|
56
|
-
return new MPRouteStep(
|
|
57
|
-
MPRouteProperty.create(object?.distance as MPRoutePropertyParams),
|
|
58
|
-
MPRouteProperty.create(object?.duration as MPRoutePropertyParams),
|
|
59
|
-
object?.steps ? object?.steps.map((subStep: any) => MPRouteStep.create(subStep)): undefined,
|
|
60
|
-
object?.geometry ? object?.geometry.map((geo: any) => MPRouteCoordinate.create(geo)): undefined,
|
|
61
|
-
Platform.OS === "ios" ? (object as any).highway?.type: object?.highway,
|
|
62
|
-
object?.abutters,
|
|
63
|
-
object?.maneuver,
|
|
64
|
-
MPRouteCoordinate.create(object?.start_location as MPRouteCoordinateParams),
|
|
65
|
-
MPRouteCoordinate.create(object?.end_location as MPRouteCoordinateParams),
|
|
66
|
-
object?.html_instructions,
|
|
67
|
-
object?.travel_mode,
|
|
68
|
-
object?.available_travel_modes,
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Parses the object to a JSON object that is compatible with the MapsIndoors SDK.
|
|
75
|
-
*
|
|
76
|
-
* @public
|
|
77
|
-
* @returns {MPRouteStepParams}
|
|
78
|
-
*/
|
|
79
|
-
public toJSON(): MPRouteStepParams {
|
|
80
|
-
return {
|
|
81
|
-
distance: this.distance,
|
|
82
|
-
duration: this.duration,
|
|
83
|
-
start_location: this.startLocation,
|
|
84
|
-
end_location: this.endLocation,
|
|
85
|
-
geometry: this.geometry,
|
|
86
|
-
highway: this.highway,
|
|
87
|
-
abutters: this.abutters,
|
|
88
|
-
html_instructions: this.htmlInstructions,
|
|
89
|
-
maneuver: this.maneuver,
|
|
90
|
-
travel_mode: this.travelMode,
|
|
91
|
-
steps: this.steps,
|
|
92
|
-
available_travel_modes: this.availableTravelModes,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Parameter interface for {@link MPRouteStep}.
|
|
99
|
-
*
|
|
100
|
-
* @export
|
|
101
|
-
* @interface MPRouteStepParams
|
|
102
|
-
* @typedef {MPRouteStepParams}
|
|
103
|
-
*/
|
|
104
|
-
export interface MPRouteStepParams {
|
|
105
|
-
/**
|
|
106
|
-
* The distance of the route step.
|
|
107
|
-
*
|
|
108
|
-
* @type {?MPRouteProperty}
|
|
109
|
-
*/
|
|
110
|
-
distance?: MPRouteProperty,
|
|
111
|
-
/**
|
|
112
|
-
* The duration of the route step.
|
|
113
|
-
*
|
|
114
|
-
* @type {?MPRouteProperty}
|
|
115
|
-
*/
|
|
116
|
-
duration?: MPRouteProperty,
|
|
117
|
-
/**
|
|
118
|
-
* An array of sub-steps for the route step.
|
|
119
|
-
*
|
|
120
|
-
* @type {?MPRouteStep[]}
|
|
121
|
-
*/
|
|
122
|
-
steps?: MPRouteStep[],
|
|
123
|
-
/**
|
|
124
|
-
* An array of coordinates representing the geometry of the route step.
|
|
125
|
-
*
|
|
126
|
-
* @type {?MPRouteCoordinate[]}
|
|
127
|
-
*/
|
|
128
|
-
geometry?: MPRouteCoordinate[],
|
|
129
|
-
/**
|
|
130
|
-
* The highway associated with the route step.
|
|
131
|
-
*
|
|
132
|
-
* @type {?string}
|
|
133
|
-
*/
|
|
134
|
-
highway?: string,
|
|
135
|
-
/**
|
|
136
|
-
* The abutters associated with the route step.
|
|
137
|
-
*
|
|
138
|
-
* @type {?string}
|
|
139
|
-
*/
|
|
140
|
-
abutters?: string,
|
|
141
|
-
/**
|
|
142
|
-
* The maneuver associated with the route step.
|
|
143
|
-
*
|
|
144
|
-
* Possible values incldue:
|
|
145
|
-
* - "turn-left"
|
|
146
|
-
* - "turn-right"
|
|
147
|
-
* - "straight"
|
|
148
|
-
* - "uturn-left"
|
|
149
|
-
* - "uturn-right"
|
|
150
|
-
* - "turn-sharp-left"
|
|
151
|
-
* - "turn-sharp-right"
|
|
152
|
-
*
|
|
153
|
-
* @type {?string}
|
|
154
|
-
*/
|
|
155
|
-
maneuver?: string,
|
|
156
|
-
/**
|
|
157
|
-
* The starting location of the route step.
|
|
158
|
-
*
|
|
159
|
-
* @type {?MPRouteCoordinate}
|
|
160
|
-
*/
|
|
161
|
-
start_location?: MPRouteCoordinate,
|
|
162
|
-
/**
|
|
163
|
-
* The ending location of the route step.
|
|
164
|
-
*
|
|
165
|
-
* @type {?MPRouteCoordinate}
|
|
166
|
-
*/
|
|
167
|
-
end_location?: MPRouteCoordinate,
|
|
168
|
-
/**
|
|
169
|
-
* Textual instructions for the step
|
|
170
|
-
*
|
|
171
|
-
* @type {?string}
|
|
172
|
-
*/
|
|
173
|
-
html_instructions?: string,
|
|
174
|
-
/**
|
|
175
|
-
* The travel mode for the route step.
|
|
176
|
-
*
|
|
177
|
-
* @type {?string}
|
|
178
|
-
*/
|
|
179
|
-
travel_mode?: string,
|
|
180
|
-
/**
|
|
181
|
-
* An array of available travel modes for the route step.
|
|
182
|
-
*
|
|
183
|
-
* @type {?string[]}
|
|
184
|
-
*/
|
|
185
|
-
available_travel_modes?: string[],
|
|
186
|
-
}
|