react-native-ptv-navigator
Getting started
$ npm install react-native-ptv-navigator --save
Mostly automatic installation
$ react-native link react-native-ptv-navigator
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-ptv-navigator
and addRNReactNativePtvNavigator.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNReactNativePtvNavigator.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNReactNativePtvNavigatorPackage;
to the imports at the top of the file - Add
new RNReactNativePtvNavigatorPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-ptv-navigator' project(':react-native-ptv-navigator').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ptv-navigator/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-ptv-navigator')
Windows
- In Visual Studio add the
RNReactNativePtvNavigator.sln
innode_modules/react-native-ptv-navigator/windows/RNReactNativePtvNavigator.sln
folder to their solution, reference from their app. - Open up your
MainPage.cs
app
- Add
using React.Native.Ptv.Navigator.RNReactNativePtvNavigator;
to the usings at the top of the file - Add
new RNReactNativePtvNavigatorPackage()
to theList<IReactPackage>
returned by thePackages
method
Usage
import PtvNavigator from "react-native-ptv-navigator";
return (
<PtvNavigator
destinationCoords={coords}
path={[path, ptvCountryCode!]}
onManeuverInfoChanged={handleManeuverInfoChange}
onNavigationInfoChanged={handleNavigationInfoChange}
style={styles.navContainer}
is3d={is3d}
isFocused={isFocused}
/>);