Skip to content
This repository has been archived by the owner on Nov 18, 2017. It is now read-only.

cameronhunter/flight-geolocation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

No Maintenance Intended Build Status

flight-geolocation

A Flight component for geo-location.

Installation

bower install --save flight-geolocation

Example

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

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

About

Geo-location component for Flight

Resources

License

Stars

Watchers

Forks

Packages

No packages published