Just me playing around with React Native with the Google Maps and MapBox APIs.
Set gmaps API key
npm run start:server
=> starts Express server
npm run serve:ios
=> opens xCode simulator for iPhone
=> opens terminal running the Metro Bundler
=> terminal used to run npm stops and hands off to new terminal
npm run serve ios
Open XCode project
Set destination to appropriate Simulator or Device
Start Xcode build
In XCode, Debug -> Simulate location
Hey dummy, you saved a bunch of tabs in your bookmarks related to this project.
- Get current location data from device
- react-native-maps shows gmaps interface
- Google directions API gives directions in the form of "polylines"
- MapBox polyline library decodes polyline strings to overlay onto map
- Open Xcode
- Press Command+Shift+2 it will open Devices & Simulators option.
- Go to Simulators tab and press + icon on the left bottom and add iPhone X or other device, based on error message
- In Simulator "Hardware" menu, press "Shake Gesture"
- Select "Debug JS Remotely"
- In the browser that opens, do 'inspect'
Trigger something when user reaches a waypoint
Use polylines
from each step object for better accuracy
.legs
represents waypointslegs.steps
represents steps in tha waypointlegs.steps.polyline.points
has the polyline
Display info for current leg and next leg For each step in the leg, display next step When user reaches within 2m of step dest, go to next step When use reaches within 5m of leg destination, go to next