Project

locomotion

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Geolocation library for RubyMotion
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

Locomotion

Code Climate

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.

Installation

Add this line to your application's Gemfile:

gem 'locomotion'

And then execute:

$ bundle

Or install it yourself as:

$ gem install locomotion

Usage

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

Configuration

Accuracy:

Choose from :best_for_navigation, :best, :nearest_ten, :nearest_hundred, :nearest_km, :nearest_3km

Locomotion.accuracy = :best

Distance:

Set a number in km or set to nil for none.

Locomotion.distance_filter = 3

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request