Locomotion is a location aware library for iOS applications written in RubyMotion. It exists to tirelessly update your application with a users location.
Note unlike BubbleWrap, Locomotion does not consider loosing GPS signal to be an error, and will keep retrying forever until you tell it to stop.
Add this line to your application's Gemfile:
gem 'locomotion'
And then execute:
$ bundle
Or install it yourself as:
$ gem install locomotion
To start watching a users location changes, use watch
, you can optionally
specify a purpose for the permission dialog if you like (purpose: 'my cool app'
)
Locomotion.watch do |location_details|
#perform your
end
Location details exposes latitude
, longitude
, speed
, heading
, time
and accuracy
. You can also compare them to any other location object responding
to latitude
and longitude
to get a distance in km.
To pause updates for a certain period of time, use:
Locomotion.defer 10 #seconds
To stop tracking location...
Locomotion.stop
Choose from :best_for_navigation, :best, :nearest_ten, :nearest_hundred, :nearest_km, :nearest_3km
Locomotion.accuracy = :best
Set a number in km or set to nil
for none.
Locomotion.distance_filter = 3
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request