Sorry for posting here, but I don't have a CVS account yet.

Description
-----------

The RidingMap module is based on the GMap module, version 4.6.

The RidingMap module is a module that has 4 essential parts. The first part
an API that allows other modules or administrators to convert either an
array of specifications or a macro text into a html/javascript text that
will include the google map on their page.

The second part is a macro generator which will allow you to interactively
create a macro suitable for using with this module.

The third part is the filter, which allows you to take the text created
from the macro and insert it into a node and the filter will convert this
into a google map shown on the node.

The fourth part is a user interface that allows users to enter their location
in a google map and then a map can be viewed that can show where users are
from around the world.

Installation and configuration
------------------------------

1) copy the ridingmap.module file into the modules directory

2) edit the theme files to ensure that the html file has the following at
the top of each page (the first one is recommended by Google, the
second is required for the lines to work in IE:

3) Get a Google maps API Key at http://www.google.com/apis/maps/signup.html

4) enable the 'ridingmap module' in drupal

5) edit admin/settings/ridingmap to include the key you received from google and
change any other default setting.

6) configure an 'input format' so that the ridingmap filter is activated. If
this will be on a 'html filtered' format, ensure that the weighting is
such that the HTML filter comes before the ridingmap filter.

7) to display the boundaries of a riding named in a ridingmap page macro,
a table of lat/long points by riding number must exist, as per

CREATE TABLE `ridingboundaries` (
`id` int(11) NOT NULL auto_increment,
`ridingcode` varchar(8) NOT NULL default '',
`latitude` float NOT NULL default '',
`longitude` float NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

8) to display contacts by riding, create a 'Riding' custom data
group in CiviCRM and populate the select values with the riding
numbers (option) and names (label).

9) to display quotes from contacts, create a 'Quotes' custom data
group in CiviCRM and create text fields by name.

10) to display contacts by location, CiviCRM profiles must include
lat/long data in the geo_code_1 and geo_code_2 fields, and the
contacts must be assigned to the named riding.

** N.B.** Because of current limitiations in the civicrm
api, civicrm tables are named as civicrm_* and
accessed directly to obtain custom field information
to be used in contact search

Map macro setup instructions
---------------------------

A basic ridingmap macro can be created on the ridingmapmacro page and the text can then be
copied and pasted into any node where the ridingmap filter is enabled.

Additional parameters (not in the original gmap module) include:

riding - number of the riding to be displayed
boundres - the resolution of the riding boundary display (if absent or 1, all points
in the ridingboundary table are displayed; if boundres = n (an integer)
every nth point is displayed.
quotename - name of the active quote field

Contacts to be displayed must be assigned to the named riding and must have a quote
entered in the 'quotename' field.

Bugs & quirks
-------------

- There is a conflict between the xmaps script and the javascript that does
the collapsing menus. If want to use the xmaps functionality, it is
recommended that you comment out all of the statements in the function
"collapseEnsureErrorsVisible()" in misc/collapse.js.
- The "dynamic" gmap method of inserting the initialization script does not
work with the filter functionality. (It does work with user functionality).
- The "track" method is not yet implemented.

- When you preview a node, if the map is shown in the short version, it
will not be shown on the long version of the node, this is because only
one copy of a mapid can be shown on the same page.

To do
-----

- An API for the gmap module is being developed and should probably be used
for future versions of this module.

- The CiviCRM API is currently missing functionality needed to make it possible to
use it to fully implement some custom data functions

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joe.murray’s picture

Sorry, the geoquote documentation posted was a bit dated - the module was renamed from ridingmap to geoquote.

joe.murray’s picture

This module was written by Paul Newby for a client of mine. After looking at the 1.4 CiviCRM API, Paul tells me that he can clean up the kludge needed to work around the 1.3 API. We'll be doing that in a few weeks.

On another note, Dan Robinson's mapthing module is taking a more generalized approach to incorporating CiviCRM field data into google maps. I understand he's going to refactor to work with gmap.

I believe mapthing is using smart groups to select CiviCRM records for display - that replicates the functionality of searching a custom field for a particular value in geoquote.

The major functionality that mapthing doesn't have that geoquote does have is pulling text out of CiviCRM fields and putting them into popup bubbles on the Googlemap. That's a small piece of code that should be fairly easy to code. It would be great if the fields could be specified in a drop-down box in the admin interface.

A general function that would be useful is to allow the values in a CiviCRM field to be used to set the colour of the bubble in the Googlemap, with a legend mapping each colour to a label. Then you could do things like show the results of a poll on map, so that the geographical dispersion of different responses would be visible.

pauln600’s picture

FileSize
27.56 KB

Here's a more sanitary version of the 'geoquote' module using version 1.4 api functions.

enky’s picture

Title: geoquote module » geoquote module for Drupal 4.7?

is the GeoQuote module for Drupal 4.7?

pauln600’s picture

Title: geoquote module for Drupal 4.7? » geoquote module
FileSize
27.56 KB

Same as above (with 1.4 api functions), but with a bug fix.

Paul N.

pauln600’s picture

Title: geoquote module » geoquote module for Drupal 4.7?

It's based on the 4.6 version of GMap, not tested on 4.7.

Paul N.

webgeer’s picture

Version: 4.7.x-1.x-dev » 4.6.x-1.x-dev

Do you have a site that shows this in action. I wouldn't mind seeing what it does.

(Although I know the feature request is for 4.7 I changed this to be on the 4.6 code as you said your current example only works on 4.6)

joe.murray’s picture

joe.murray’s picture

Status: Active » Closed (fixed)

No longer under development.