A Flight component for geo-location.
bower install --save flight-geolocation
define(['flight-geolocation'], function(GeoLocation) {
GeoLocation.attachTo(document, {
enableHighAccuracy: false,
timeout: 500,
maximumAge: 500
});
// Listen for geo-location updates
$(document).on('geolocation-update', function(e, position) {
console.log(e, position);
});
// Listen for errors
$(document).on('geolocation-error', function(e, error) {
console.error(e, error);
});
// Query current location
$(document).trigger('geolocation-current');
// Watch for geo-location updates
$(document).trigger('geolocation-watch');
});
Development of this component needs Bower, and ideally Karma to be globally installed:
npm install -g bower karma
Then install the Node.js and client-side dependencies by running the following commands in the repo's root directory.
npm install
bower install
To continuously run the tests in Chrome and Firefox during development, just run:
karma start