This project is deprecated and will not receive updates anymore.
ffwdme.js
ffwdme.js is a JavaScript toolkit that aims to bring interactive GPS driving directions to the mobile browser.
Introduction
For an introduction have a look at the guides.
Trying it out online
You can try a current build including a demo page online at dev.ffwdmejs.org
Please refer to this tutorial about how to get started with the demo application.
Requirements
The source code is built using
browserify and gulp so you need a working node.js environment on your local machine. I'm using node v5.0.0 right now (you can see your version with node --version)Check out the code from GitHub, e.g. by cloning the repository, and
cd into the main directory of ffwdme.js.To install all dependencies just do an
npm installThen you can run gulp for a local preview server:
gulpExternal API Services
To use the demo page on your local server, you need to sign up for some external services.
ffwdme.js uses the open source routing service GraphHopper for the route calculation. They are pretty awesome and provide us with a free demo API key to try things out. However, please be fair. Once your project gets more serious you should get in touchand obtain your own API key.
There is also a map component, that is powered by Mapbox. In order to use this, you have to sign up for a free plan and you need to get an access token.
Setup Credentials
Once you have your Mapbox access token ready, you can copy the file
static/demo/credentials_example.js tostatic/demo/credentials.js.Open the newly created file and fill in your own credentials.
Now you are ready to go!
Directory Structure
build- The generated JavaScript code and assetsgulp- The single gulp tasks to build and deploy the code/assetsspec- Spec suites and fixturessrc- Source code, divided in the packagescore,componentsanddebugstatic- Root directory for the local preview server, that also holds the demo applicationstatic/recorded_routes- This holds a collection of real world recorded GPS tracks, you can use to develop/debug your navigation system (see demo page)
Testing
ffwdme.js uses the following testing setup:
- Jasmine - http://jasmine.github.io/2.1/introduction.html
- Jasmine jQuery - https://github.com/velesin/jasmine-jquery/blob/master/README.md
- Karma - http://karma-runner.github.io/0.12/config/files.html
To run the specs, install the karma CLI helper globally
npm install -g karma-cliThen make sure you have the development server running:
gulpAnd then just call
karma startTesting your local install on mobile devices
Please be aware that some browsers only allow the usage of HTML5 Geolocation API in a secure context. And while
localhost is a secure context, serving you local install to a mobile device must be done via https, otherwise the access to the Geolocation API will be denied and ffwdme.js won't work.Please have a look at this pull request fixing this for browsersync or make use of another tool like ngrok that provides
httpsconnections for the mobile testing device.
Commentaires
Enregistrer un commentaire