Code Monkey home page Code Monkey logo

maptastic's Introduction

Formtastic Location Selector

Installation

First, you'll need to install Formtastic.

Next, install Maptastic as a plugin:

script/plugin install [email protected]:MattHall/maptastic.git

...and run the rake task to install the required js file into your javascripts directory. You will probably need to include this in your layouts, too.

	    rake maptastic_form:install

You can alternatively install the gem:

gem install maptastic-form

Note if you're using the gem, then you'll need to copy the JS asset from:

https://github.com/MattHall/maptastic/blob/master/assets/javascripts/maptastic.js

You'll need to add the Google Maps V3 script include in your page, above your semantic_form:

<script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=true'></script>

Note that you no longer need an API key with the latest Google Maps release.

Usage

Maptastic adds a new #multi_input method as well as the map control:

<% semantic_form_for @venue do |f| %>
  <%= f.multi_input :latitude, :longitude, :as => :map %>
<% end %>

Note that the map input expects two parameters - a latitude and longitude. The order is important.

Development

This plugin is under development. It's pretty simple, and patches are very welcome.

The Repo is available on GitHub

Report bugs here

A testbed app is available to check that the changes made actually work as expected.

Project Info

Copyright © 2010 Matthew Hall, released under the MIT license.

maptastic's People

Contributors

matthall avatar lostboy avatar

Stargazers

Devon Tivona avatar

Watchers

James Cloos avatar Devon Tivona avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.