@sargsyansevak/expo-mapbox-navigation 1.0.0
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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +313 -0
- package/android/build.gradle +98 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/expo/modules/mapboxnavigation/ExpoMapboxNavigationModule.kt +120 -0
- package/android/src/main/java/expo/modules/mapboxnavigation/ExpoMapboxNavigationView.kt +1100 -0
- package/android/src/main/res/drawable-hdpi/icon_compass.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_mute.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_overview.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_sound.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_x.png +0 -0
- package/android/src/main/res/drawable-ldpi/icon_compass.png +0 -0
- package/android/src/main/res/drawable-ldpi/icon_mute.png +0 -0
- package/android/src/main/res/drawable-ldpi/icon_overview.png +0 -0
- package/android/src/main/res/drawable-ldpi/icon_sound.png +0 -0
- package/android/src/main/res/drawable-ldpi/icon_x.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_compass.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_mute.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_overview.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_sound.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_x.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_compass.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_mute.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_overview.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_sound.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_x.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_compass.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_mute.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_overview.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_sound.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_x.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_compass.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_mute.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_overview.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_sound.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_x.png +0 -0
- package/android/src/main/res/values/styles.xml +9 -0
- package/app.plugin.js +1 -0
- package/build/ExpoMapboxNavigation.types.d.ts +90 -0
- package/build/ExpoMapboxNavigation.types.d.ts.map +1 -0
- package/build/ExpoMapboxNavigation.types.js +2 -0
- package/build/ExpoMapboxNavigation.types.js.map +1 -0
- package/build/ExpoMapboxNavigationModule.d.ts +3 -0
- package/build/ExpoMapboxNavigationModule.d.ts.map +1 -0
- package/build/ExpoMapboxNavigationModule.js +3 -0
- package/build/ExpoMapboxNavigationModule.js.map +1 -0
- package/build/ExpoMapboxNavigationView.d.ts +5 -0
- package/build/ExpoMapboxNavigationView.d.ts.map +1 -0
- package/build/ExpoMapboxNavigationView.js +7 -0
- package/build/ExpoMapboxNavigationView.js.map +1 -0
- package/build/ExpoMapboxNavigationView.web.d.ts +4 -0
- package/build/ExpoMapboxNavigationView.web.d.ts.map +1 -0
- package/build/ExpoMapboxNavigationView.web.js +7 -0
- package/build/ExpoMapboxNavigationView.web.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +3 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/ExpoMapboxNavigation.podspec +46 -0
- package/ios/ExpoMapboxNavigationModule.swift +92 -0
- package/ios/ExpoMapboxNavigationView.swift +509 -0
- package/package.json +47 -0
- package/plugin/config.js +127 -0
- package/src/ExpoMapboxNavigation.types.ts +70 -0
- package/src/ExpoMapboxNavigationModule.ts +2 -0
- package/src/ExpoMapboxNavigationView.tsx +17 -0
- package/src/ExpoMapboxNavigationView.web.tsx +13 -0
- package/src/index.ts +11 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
|
|
3
|
+
<resources>
|
|
4
|
+
<style name="ManeuverTextAppearance" parent="TextAppearance.AppCompat">
|
|
5
|
+
<item name="android:textColor">#FFFFFF</item>
|
|
6
|
+
<item name="android:textSize">20dp</item>
|
|
7
|
+
<item name="android:textStyle">bold</item>
|
|
8
|
+
</style>
|
|
9
|
+
</resources>
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./plugin/config.js");
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ViewStyle, StyleProp } from "react-native/types";
|
|
2
|
+
import { Ref } from "react";
|
|
3
|
+
type ProgressEvent = {
|
|
4
|
+
distanceRemaining: number;
|
|
5
|
+
distanceTraveled: number;
|
|
6
|
+
durationRemaining: number;
|
|
7
|
+
fractionTraveled: number;
|
|
8
|
+
};
|
|
9
|
+
type Route = {
|
|
10
|
+
distance: number;
|
|
11
|
+
expectedTravelTime: number;
|
|
12
|
+
legs: Array<{
|
|
13
|
+
source?: {
|
|
14
|
+
latitude: number;
|
|
15
|
+
longitude: number;
|
|
16
|
+
};
|
|
17
|
+
destination?: {
|
|
18
|
+
latitude: number;
|
|
19
|
+
longitude: number;
|
|
20
|
+
};
|
|
21
|
+
steps: Array<{
|
|
22
|
+
shape?: {
|
|
23
|
+
coordinates: Array<{
|
|
24
|
+
latitude: number;
|
|
25
|
+
longitude: number;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
type Routes = {
|
|
32
|
+
mainRoute: Route;
|
|
33
|
+
alternativeRoutes: Route[];
|
|
34
|
+
};
|
|
35
|
+
export type ExpoMapboxNavigationViewRef = {
|
|
36
|
+
recenterMap: () => void;
|
|
37
|
+
};
|
|
38
|
+
export type ExpoMapboxNavigationViewProps = {
|
|
39
|
+
ref?: Ref<ExpoMapboxNavigationViewRef>;
|
|
40
|
+
coordinates: Array<{
|
|
41
|
+
latitude: number;
|
|
42
|
+
longitude: number;
|
|
43
|
+
}>;
|
|
44
|
+
waypointIndices?: number[];
|
|
45
|
+
useRouteMatchingApi?: boolean;
|
|
46
|
+
locale?: string;
|
|
47
|
+
routeProfile?: string;
|
|
48
|
+
routeExcludeList?: string[];
|
|
49
|
+
mapStyle?: string;
|
|
50
|
+
mute?: boolean;
|
|
51
|
+
vehicleMaxHeight?: number;
|
|
52
|
+
vehicleMaxWidth?: number;
|
|
53
|
+
initialLocation?: {
|
|
54
|
+
latitude: number;
|
|
55
|
+
longitude: number;
|
|
56
|
+
zoom?: number;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The URL of the custom raster source to use for the map.
|
|
60
|
+
* Should be a template string with {x}, {y}, {z} placeholders.
|
|
61
|
+
* Example: "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
62
|
+
*/
|
|
63
|
+
customRasterSourceUrl?: string;
|
|
64
|
+
placeCustomRasterLayerAbove?: string;
|
|
65
|
+
disableAlternativeRoutes?: boolean;
|
|
66
|
+
followingZoom?: number;
|
|
67
|
+
onRouteProgressChanged?: (event: {
|
|
68
|
+
nativeEvent: ProgressEvent;
|
|
69
|
+
}) => void;
|
|
70
|
+
onCancelNavigation?: () => void;
|
|
71
|
+
onWaypointArrival?: (event: {
|
|
72
|
+
nativeEvent: ProgressEvent | undefined;
|
|
73
|
+
}) => void;
|
|
74
|
+
onFinalDestinationArrival?: () => void;
|
|
75
|
+
onRouteChanged?: () => void;
|
|
76
|
+
onUserOffRoute?: () => void;
|
|
77
|
+
onRoutesLoaded?: (event: {
|
|
78
|
+
nativeEvent: {
|
|
79
|
+
routes: Routes;
|
|
80
|
+
};
|
|
81
|
+
}) => void;
|
|
82
|
+
onRouteFailedToLoad?: (event: {
|
|
83
|
+
nativeEvent: {
|
|
84
|
+
errorMessage: string;
|
|
85
|
+
};
|
|
86
|
+
}) => void;
|
|
87
|
+
style?: StyleProp<ViewStyle>;
|
|
88
|
+
};
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=ExpoMapboxNavigation.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMapboxNavigation.types.d.ts","sourceRoot":"","sources":["../src/ExpoMapboxNavigation.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMapboxNavigation.types.js","sourceRoot":"","sources":["../src/ExpoMapboxNavigation.types.ts"],"names":[],"mappings":"","sourcesContent":["//@ts-ignore\nimport { ViewStyle, StyleProp } from \"react-native/types\";\nimport { Ref } from \"react\";\n\ntype ProgressEvent = {\n distanceRemaining: number;\n distanceTraveled: number;\n durationRemaining: number;\n fractionTraveled: number;\n};\n\ntype Route = {\n distance: number;\n expectedTravelTime: number;\n legs: Array<{\n source?: { latitude: number; longitude: number };\n destination?: { latitude: number; longitude: number };\n steps: Array<{\n shape?: {\n coordinates: Array<{ latitude: number; longitude: number }>;\n };\n }>;\n }>;\n};\n\ntype Routes = {\n mainRoute: Route;\n alternativeRoutes: Route[];\n};\n\nexport type ExpoMapboxNavigationViewRef = {\n recenterMap: () => void;\n};\n\nexport type ExpoMapboxNavigationViewProps = {\n ref?: Ref<ExpoMapboxNavigationViewRef>;\n coordinates: Array<{ latitude: number; longitude: number }>;\n waypointIndices?: number[];\n useRouteMatchingApi?: boolean;\n locale?: string;\n routeProfile?: string;\n routeExcludeList?: string[];\n mapStyle?: string;\n mute?: boolean;\n vehicleMaxHeight?: number;\n vehicleMaxWidth?: number;\n initialLocation?: { latitude: number; longitude: number; zoom?: number };\n /**\n * The URL of the custom raster source to use for the map.\n * Should be a template string with {x}, {y}, {z} placeholders.\n * Example: \"https://tile.openstreetmap.org/{z}/{x}/{y}.png\"\n */\n customRasterSourceUrl?: string;\n placeCustomRasterLayerAbove?: string;\n disableAlternativeRoutes?: boolean;\n followingZoom?: number;\n onRouteProgressChanged?: (event: { nativeEvent: ProgressEvent }) => void;\n onCancelNavigation?: () => void;\n onWaypointArrival?: (event: {\n nativeEvent: ProgressEvent | undefined;\n }) => void;\n onFinalDestinationArrival?: () => void;\n onRouteChanged?: () => void;\n onUserOffRoute?: () => void;\n onRoutesLoaded?: (event: { nativeEvent: { routes: Routes } }) => void;\n onRouteFailedToLoad?: (event: {\n nativeEvent: { errorMessage: string };\n }) => void;\n style?: StyleProp<ViewStyle>;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMapboxNavigationModule.d.ts","sourceRoot":"","sources":["../src/ExpoMapboxNavigationModule.ts"],"names":[],"mappings":";AACA,wBAA2D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMapboxNavigationModule.js","sourceRoot":"","sources":["../src/ExpoMapboxNavigationModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,eAAe,mBAAmB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from \"expo-modules-core\";\nexport default requireNativeModule(\"ExpoMapboxNavigation\");\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ExpoMapboxNavigationViewProps, ExpoMapboxNavigationViewRef } from "./ExpoMapboxNavigation.types";
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<ExpoMapboxNavigationViewProps, "ref"> & React.RefAttributes<ExpoMapboxNavigationViewRef>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=ExpoMapboxNavigationView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMapboxNavigationView.d.ts","sourceRoot":"","sources":["../src/ExpoMapboxNavigationView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,8BAA8B,CAAC;;AAKtC,wBAKG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { requireNativeViewManager } from "expo-modules-core";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const NativeView = requireNativeViewManager("ExpoMapboxNavigation");
|
|
4
|
+
export default React.forwardRef((props, ref) => {
|
|
5
|
+
return <NativeView {...props} ref={ref}/>;
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=ExpoMapboxNavigationView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMapboxNavigationView.js","sourceRoot":"","sources":["../src/ExpoMapboxNavigationView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,UAAU,GACd,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;AAEnD,eAAe,KAAK,CAAC,UAAU,CAG7B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AAC7C,CAAC,CAAC,CAAC","sourcesContent":["import { requireNativeViewManager } from \"expo-modules-core\";\nimport * as React from \"react\";\n\nimport {\n ExpoMapboxNavigationViewProps,\n ExpoMapboxNavigationViewRef,\n} from \"./ExpoMapboxNavigation.types\";\n\nconst NativeView: React.ComponentType<ExpoMapboxNavigationViewProps> =\n requireNativeViewManager(\"ExpoMapboxNavigation\");\n\nexport default React.forwardRef<\n ExpoMapboxNavigationViewRef,\n ExpoMapboxNavigationViewProps\n>((props, ref) => {\n return <NativeView {...props} ref={ref} />;\n});\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ExpoMapboxNavigationViewProps } from "./ExpoMapboxNavigation.types";
|
|
3
|
+
export default function ExpoMapboxNavigationView(props: ExpoMapboxNavigationViewProps): React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=ExpoMapboxNavigationView.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMapboxNavigationView.web.d.ts","sourceRoot":"","sources":["../src/ExpoMapboxNavigationView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAE7E,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,KAAK,EAAE,6BAA6B,qBAOrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoMapboxNavigationView.web.js","sourceRoot":"","sources":["../src/ExpoMapboxNavigationView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,KAAoC;IAEpC,OAAO,CACL,CAAC,GAAG,CACF;MAAA,CAAC,IAAI,CAAC,sCAAsC,EAAE,IAAI,CACpD;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import * as React from \"react\";\n\nimport { ExpoMapboxNavigationViewProps } from \"./ExpoMapboxNavigation.types\";\n\nexport default function ExpoMapboxNavigationView(\n props: ExpoMapboxNavigationViewProps\n) {\n return (\n <div>\n <span>Mapbox navigation not supported on web</span>\n </div>\n );\n}\n"]}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import MapboxNavigationView from "./ExpoMapboxNavigationView";
|
|
2
|
+
import { ExpoMapboxNavigationViewProps, ExpoMapboxNavigationViewRef } from "./ExpoMapboxNavigation.types";
|
|
3
|
+
export { MapboxNavigationView, ExpoMapboxNavigationViewProps as MapboxNavigationViewProps, ExpoMapboxNavigationViewRef as MapboxNavigationViewRef, };
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,oBAAoB,EACpB,6BAA6B,IAAI,yBAAyB,EAC1D,2BAA2B,IAAI,uBAAuB,GACvD,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,4BAA4B,CAAC;AAM9D,OAAO,EACL,oBAAoB,GAGrB,CAAC","sourcesContent":["import MapboxNavigationView from \"./ExpoMapboxNavigationView\";\nimport {\n ExpoMapboxNavigationViewProps,\n ExpoMapboxNavigationViewRef,\n} from \"./ExpoMapboxNavigation.types\";\n\nexport {\n MapboxNavigationView,\n ExpoMapboxNavigationViewProps as MapboxNavigationViewProps,\n ExpoMapboxNavigationViewRef as MapboxNavigationViewRef,\n};\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'ExpoMapboxNavigation'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.description = package['description']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.homepage = package['homepage']
|
|
13
|
+
s.platforms = { :ios => '13.4', :tvos => '13.4' }
|
|
14
|
+
s.swift_version = '5.9'
|
|
15
|
+
s.source = { git: 'https://github.com/badatgil/expo-mapbox-navigation' }
|
|
16
|
+
s.static_framework = true
|
|
17
|
+
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
s.dependency 'MapboxMaps', ENV['ExpoNavigationMapboxMapsVersion']
|
|
20
|
+
s.dependency 'Turf', '~> 4.0.0'
|
|
21
|
+
|
|
22
|
+
s.source_files = "**/*.{h,m,swift}"
|
|
23
|
+
s.exclude_files = ["Frameworks/*.xcframework/**/*.h"]
|
|
24
|
+
s.preserve_paths = [
|
|
25
|
+
"Frameworks/*.xcframework",
|
|
26
|
+
"**/*.h",
|
|
27
|
+
"Frameworks/*.xcframework/**/*.h"
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
s.vendored_frameworks=[
|
|
31
|
+
'Frameworks/_MapboxNavigationHelpers.xcframework',
|
|
32
|
+
'Frameworks/MapboxDirections.xcframework',
|
|
33
|
+
'Frameworks/MapboxNavigationCore.xcframework',
|
|
34
|
+
'Frameworks/MapboxNavigationNative.xcframework',
|
|
35
|
+
'Frameworks/MapboxNavigationUIKit.xcframework',
|
|
36
|
+
'Frameworks/Turf.xcframework',
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
# Swift/Objective-C compatibility
|
|
40
|
+
s.pod_target_xcconfig = {
|
|
41
|
+
'DEFINES_MODULE' => 'YES',
|
|
42
|
+
'SWIFT_COMPILATION_MODE' => 'wholemodule',
|
|
43
|
+
'OTHER_SWIFT_FLAGS' => '$(inherited)'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
import CoreLocation
|
|
3
|
+
|
|
4
|
+
public class ExpoMapboxNavigationModule: Module {
|
|
5
|
+
|
|
6
|
+
public func definition() -> ModuleDefinition {
|
|
7
|
+
Name("ExpoMapboxNavigation")
|
|
8
|
+
|
|
9
|
+
View(ExpoMapboxNavigationView.self) {
|
|
10
|
+
Events("onRouteProgressChanged", "onCancelNavigation", "onWaypointArrival", "onFinalDestinationArrival", "onRouteChanged", "onUserOffRoute", "onRoutesLoaded", "onRouteFailedToLoad")
|
|
11
|
+
|
|
12
|
+
Prop("coordinates") { (view: ExpoMapboxNavigationView, coordinates: Array<Dictionary<String, Any>>) in
|
|
13
|
+
var points: Array<CLLocationCoordinate2D> = []
|
|
14
|
+
for coordinate in coordinates {
|
|
15
|
+
let longValue = coordinate["longitude"]
|
|
16
|
+
let latValue = coordinate["latitude"]
|
|
17
|
+
if let long = longValue as? Double, let lat = latValue as? Double {
|
|
18
|
+
points.append(CLLocationCoordinate2D(latitude: lat, longitude: long))
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
view.controller.setCoordinates(coordinates: points)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Prop("vehicleMaxHeight") { (view: ExpoMapboxNavigationView, maxHeight: Double?) in
|
|
25
|
+
view.controller.setVehicleMaxHeight(maxHeight: maxHeight)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
Prop("vehicleMaxWidth") { (view: ExpoMapboxNavigationView, maxWidth: Double?) in
|
|
29
|
+
view.controller.setVehicleMaxWidth(maxWidth: maxWidth)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Prop("locale") { (view: ExpoMapboxNavigationView, locale: String?) in
|
|
33
|
+
view.controller.setLocale(locale: locale)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Prop("useRouteMatchingApi"){ (view: ExpoMapboxNavigationView, useRouteMatchingApi: Bool?) in
|
|
37
|
+
view.controller.setIsUsingRouteMatchingApi(useRouteMatchingApi: useRouteMatchingApi)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
Prop("waypointIndices"){ (view: ExpoMapboxNavigationView, indices: Array<Int>?) in
|
|
41
|
+
view.controller.setWaypointIndices(waypointIndices: indices)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Prop("routeProfile"){ (view: ExpoMapboxNavigationView, profile: String?) in
|
|
45
|
+
view.controller.setRouteProfile(profile: profile)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Prop("routeExcludeList"){ (view: ExpoMapboxNavigationView, excludeList: Array<String>?) in
|
|
49
|
+
view.controller.setRouteExcludeList(excludeList: excludeList)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
Prop("mapStyle"){ (view: ExpoMapboxNavigationView, style: String?) in
|
|
53
|
+
view.controller.setMapStyle(style: style)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Prop("mute"){ (view: ExpoMapboxNavigationView, isMuted: Bool?) in
|
|
57
|
+
view.controller.setIsMuted(isMuted: isMuted)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
Prop("initialLocation") { (view: ExpoMapboxNavigationView, location: Dictionary<String, Any>?) in
|
|
61
|
+
if(location != nil){
|
|
62
|
+
let longValue = location!["longitude"]
|
|
63
|
+
let latValue = location!["latitude"]
|
|
64
|
+
let zoomValue = location!["zoom"]
|
|
65
|
+
if let long = longValue as? Double, let lat = latValue as? Double, let zoom = zoomValue as? Double? {
|
|
66
|
+
view.controller.setInitialLocation(location: CLLocationCoordinate2D(latitude: lat, longitude: long), zoom: zoom)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Prop("customRasterSourceUrl") { (view: ExpoMapboxNavigationView, url: String?) in
|
|
72
|
+
view.controller.setCustomRasterSourceUrl(url: url)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
Prop("placeCustomRasterLayerAbove") { (view: ExpoMapboxNavigationView, layerId: String?) in
|
|
76
|
+
view.controller.setPlaceCustomRasterLayerAbove(layerId: layerId)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
Prop("disableAlternativeRoutes") { (view: ExpoMapboxNavigationView, disableAlternativeRoutes: Bool?) in
|
|
80
|
+
view.controller.setDisableAlternativeRoutes(disableAlternativeRoutes: disableAlternativeRoutes)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
Prop("followingZoom") { (view: ExpoMapboxNavigationView, followingZoom: Double?) in
|
|
84
|
+
view.controller.setFollowingZoom(followingZoom: followingZoom)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
AsyncFunction("recenterMap") { (view: ExpoMapboxNavigationView) in
|
|
88
|
+
view.controller.recenterMap()
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|