Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Rails plugin to convert models into map ready marker objects. Includes support for marker clustering and offsetting. Requires the geokit and geokit-rails.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 History.txt
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 init.rb
Octocat-spinner-32 install.rb
Octocat-spinner-32 uninstall.rb
README
MapReady
========

A Rails plugin to convert models into map ready marker objects. Includes support for marker clustering and offsetting. Requires the geokit and geokit-rails.

The plugin provides several strategies for building map marker objects from mappable ActiveRecord models. Currently, a mappable ActiveRecord model is one that "acts_as_mappable" as defined in the geokit-rails plugin (dependency). The strategies include:
 1. one-to-one conversion (simple), 
 2. grouping by proximity (clustered), 
 3. offsetting by location (offset).

Dependencies
============

Currently map_ready depends on the geokit gem and the geokit-rails plugin

geokit

- http://github.com/andre/geokit-gem/tree/master

geokit-rails

- http://github.com/andre/geokit-rails/tree/master


Example
=======

Setup

Say for your Rails app you're building a map of all the best burger joints in your area. To make your burger joints map ready:

1. Use geokit/geokit-rails to provide geolocations (lat, lng) and add 'acts_as_mappable' to the class definition.
2. Add 'acts_as_map_marker' to the class definition. This declaration provides the interface for the marker builders to translate your mappable class to map markers.

class BurgerJoint < ActiveRecord::Base
  acts_as_mappable
  acts_as_map_marker
end

Usage

Simple
  markers = MapReady::MarkerBuilder::Simple.new(burger_joints).create_markers

Clustered
  markers = MapReady::MarkerBuilder::Clusterable.new(burger_joints).create_markers

Offset
  markers = MapReady::MarkerBuilder::Offsetable.new(burger_joints).create_markers


Copyright (c) 2009 Ross Kaffenberger, released under the MIT license
Something went wrong with that request. Please try again.