All Projects → jvillarejo → Spyme

jvillarejo / Spyme

Licence: mit
Rails plugin that stores the browser geolocation

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Spyme

cordova-plugin-radar
Cordova plugin for Radar, the leading geofencing and location tracking platform
Stars: ✭ 14 (-87.04%)
Mutual labels:  geocoding, geolocation
Geocoding-with-Map-Vector
Resources for the ACL 2018 publication "Which Melbourne? Augmenting Geocoding with Maps", published in July 2018.
Stars: ✭ 24 (-77.78%)
Mutual labels:  geocoding, geolocation
radar-sdk-android
Android SDK for Radar, the leading geofencing and location tracking platform
Stars: ✭ 57 (-47.22%)
Mutual labels:  geocoding, geolocation
Jpx
JPX - Java GPX library
Stars: ✭ 125 (+15.74%)
Mutual labels:  geolocation, geocoding
Pelias Android Sdk
Android sdk for pelias
Stars: ✭ 20 (-81.48%)
Mutual labels:  geolocation, geocoding
kirby-locator
A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 only.
Stars: ✭ 83 (-23.15%)
Mutual labels:  geocoding, geolocation
geocoder
Geocoder is a Typescript library which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations
Stars: ✭ 28 (-74.07%)
Mutual labels:  geocoding, geolocation
Pgeocode
Postal code geocoding and distance calculation
Stars: ✭ 92 (-14.81%)
Mutual labels:  geolocation, geocoding
Leaflet Geosearch
(Leaflet) GeoSearch / GeoCode provider
Stars: ✭ 666 (+516.67%)
Mutual labels:  geolocation, geocoding
Googleapi
C# .NET Core Google Api (Maps, Places, Roads, Search, Translate). Supports all endpoints and requests / responses.
Stars: ✭ 346 (+220.37%)
Mutual labels:  geolocation, geocoding
Geo On Fire
A library to create high performance geolocation queries for Firebase. Checkout the demos: https://run.plnkr.co/plunks/AYaN8ABEDcMntgbJyLVW/ and https://run.plnkr.co/plunks/xJgstAvXYcp0w7MbOOjm/
Stars: ✭ 54 (-50%)
Mutual labels:  geolocation, geocoding
React Native Radar
React Native module for Radar, the leading geofencing and location tracking platform
Stars: ✭ 104 (-3.7%)
Mutual labels:  geolocation, geocoding
Rails Letsencrypt
The Let's Encrypt certificate manager for rails
Stars: ✭ 104 (-3.7%)
Mutual labels:  rails
Brimir
Email helpdesk built using Ruby on Rails and Zurb Foundation
Stars: ✭ 1,404 (+1200%)
Mutual labels:  rails
Geo ip
Retreive the geolocation of an IP address based on the ipinfodb.com webservice
Stars: ✭ 103 (-4.63%)
Mutual labels:  geolocation
Ruby Getting Started
Getting Started with Ruby on Heroku
Stars: ✭ 103 (-4.63%)
Mutual labels:  rails
Rails
Ruby on Rails
Stars: ✭ 49,693 (+45912.04%)
Mutual labels:  rails
Rubocop Rails config
RuboCop configuration which has the same code style checking as official Ruby on Rails.
Stars: ✭ 106 (-1.85%)
Mutual labels:  rails
Activestorage Aliyun
Wraps the Aliyun OSS as an Active Storage service.
Stars: ✭ 103 (-4.63%)
Mutual labels:  rails
Coding further
"Coding further" is made for my students who graduated from Le Wagon coding bootcamp and are just now exploring the world of programming.
Stars: ✭ 103 (-4.63%)
Mutual labels:  rails

Spyme

Track your visits location using the Geolocation Browser API easily

Location is stored in the session, it doesn't generate any model so you can persist it in anyway you like.

You get:

  • better geolocation - Browser geolocation has much better exactness than IP-based geocoding.
  • persist it the way you want it - As Spyme doesn't define any persisting model, you can map it to your model in any way you like.

How it works

When someone visits your site Spyme will check if the browser support the Geolocation API and if the user accepts to be tracked it automatically stores the the location in the session.

Use current_location to access the Location object for the current visit.

Power up

Use Geocoder with Spyme to track your model objects near the visit current location.

Example:

Venue.near(current_location.coords, 20) # venues within 20 miles current visit location

Installation

Add this line to your application's Gemfile:

gem 'spyme'

Lastly, include the javascript file in app/assets/javascripts/application.js after jQuery.

//= require jquery
//= require spyme

Location

Spyme automatically stores the current location at the session you can access in your controller with this helper method

current_location

Sometimes the user deny the tracking or the browser doesn't support geolocation, you can check if the current location is valid

current_location.valid?

Also the Spyme::Model::Location object has some useful methods

to_hash

current_location.to_hash

returns { latitude: # tracked_latitude, longitude: # tracked_longitude }

coords

current_location.coords

returns [ # tracked_latitude, # tracked_longitude]

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].