Mappa plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install svn://neverintheoffice.net/mappa/trunk/mappa
The following quick example should produce a basic map.
map_controller.rb :
class MapController < ApplicationController def index @page_title = "Create new map" @gmap = Mappa::GMap.new() # the gmap api key for localhost:3000 - remember to change this! @gmap.api_key = "ABQIAAAArjtwNyA-0TDmcb74hMzhHBTJQa0g3IQ9GZqIMmInSLzwtGDKaBRSDWK-cqMmi3YB5dD-8a6Kwe1Qmg" @gmap.lat = 51.775362610 @gmap.lng = -0.00100011 @gmap.name = 'gmap' @gmap.zoom = 12 end end
The layout file: map.rhtml
In the html head
<%= yield :map_headers %>
Within the body:
body onload="<%= @gmap.onload_func_name %>()" onunload="GUnload" <%= yield %>
The view: index.rhtml
<% content_for :map_headers do %> <%= map_header(@gmap) %> <%= map_body(@gmap) %> <% end %>
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (1 older version) | Last edited by: scott, 4 months ago

