README.md in radiant-event_map-extension-1.3.2 vs README.md in radiant-event_map-extension-1.3.3
- old
+ new
@@ -20,14 +20,16 @@
* [layouts](http://github.com/squaretalent/radiant-layouts-extension) or [share_layouts](http://github.com/radiant/radiant-share-layouts-extension) extension
* [geokit](http://geokit.rubyforge.org/) gem
## Configuration
-There is one required config setting:
+There is one required config setting if you're using the full-page map controller:
* `event_map.layout` is the name of the layout used by the controller
+If you're only using the `events:googlemap` radius tag then this isn't required.
+
## Basic Usage
### Linking to maps
We override the `url` method of EventVenue to return a map link if no other url is defined. The format of those links is determined by the link template stored in the config setting `event_map.link_format`. The markers :lat, :lng and :title will be replaced with the the correct value for each event venue.
@@ -35,17 +37,25 @@
There are also two shortcuts:
* 'google' is the default and equivalent to `http://maps.google.com/maps?q=:lat+:lng+(:title)` and will drop a pin on a google map.
* 'bing' is equivalent to `http://www.bing.com/maps/?v=2&cp=:lat~:lng&rtp=~pos.:lat_:lng_:title&lvl=15&sty=s&eo=0`, which will display a 1:25000 ordnance survey map (if you're in the UK) with a destination flag at your chosen point.
+### Placing a map on one of your pages
+
+For simple uses this radius tag might suffice:
+
+ <r:events:googlemap [calendar="slug"] />
+
+For more searchability you need to use the full-page map controller.
+
### Displaying a map page
Create a layout that includes a `map_canvas` div and these page parts:
* `map_js` is required. It brings in the javascripts (and can be used in the header or at the end of the page as you prefer)
* `title` is the page title and can also be shown with `r:title`
-* `faceting` here only gives the option to remove any date filters that have been applied. If you add the `taggable_events` extension it gets more useful.
+* `faceting` gives the option to remove any date filters that have been applied. If you add the `taggable_events` extension it gets more useful.
Here's a starting point:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
@@ -74,39 +84,27 @@
NB. we're not doing anything fancy here with offsets or masks: if you need that kind of detail then a bit more javascript is required.
### javascript compatibility
-The map javascript is generated by the EventVenuesController using `app/views/event_venues/index.js.erb`. It provides a `build_map_and_markers` method and the minimal jQuery hook required to populate #map_canvas when the DOM loads.
+The map javascript is generated by the EventVenuesController using `app/views/event_venues/index.js.erb`. You should find that it automatically populates the map with or without jquery present.
-If you're not using jQuery you should find it straightforward to call `build_map_and_markers(div element)` from another script, and in that case you don't have to use our naming scheme either.
-
-### Displaying a map on a normal radiant page
-
- <r:events:googlemap calendar="slug" />
-
-If you omit the calendar attribute then all future events will be displayed.
-
-The map will be presented in a `div#map_canvas` to which your stylesheet will need to give dimensions (and any text styles you want to apply the location bubbles).
-
-At the moment you don't get any other control of displayed events, but soon the radius tag will support all the usual period specifications.
-
### JSON interface
If you don't want to use the included scripts, you can skip that whole mechanism and work with the event data instead. EventVenuesController provides a simple JSON interface. Usually it's at /map and looks for addresses like this:
- /map everything
+ /map everything
/map/2010 events in 2010
- /map/2010/12/ events in December 2010
- /map/2010/12/12 events on 12 December 2010
+ /map/2010/12/ events in December 2010
+ /map/2010/12/12 events on 12 December 2010
If you're using `taggable_events` then we also inherit the tag-faceting interface here.
## Bugs and features
[Github issues](http://github.com/spanner/radiant-event_map-extension/issues) please, or for little things an email or github message is fine.
## Author & Copyright
-Copyright 2008-2010 Will at spanner.org.
+Copyright 2008-2011 Will at spanner.org.
Released under the same terms as Radiant and/or Rails.