has_a_location – the Latitude Longitude – Rails Plugin

Easy handling of latitude/longitude information, build on top of acts_as_mappable (aka geokit).

has_a_location Installation instructions

Usage

class User < ActiveRecord::Base
  has_a_location
end

@user.location = [11.101,22.121]# latitude , longitude
@user.in_radius(100) #find in 100 miles radius

#this location will not be stored since it is the "default location"
@user.location = [0,0] 

show_map if @user.location

All options and Readme

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s