Google Map Module

   Google Map Module

This page contains info about the Exponent Google Map Module developed by Fishcakes.

About Google Map Module
A module for generating Google Maps. See Google Maps Guidelines for notes on the Google Maps API. Developed by Dan Salmon, July 2007.
 * briantoth.com Google Map Project — Google Maps Plugin is the easiest way to find your Apple Address Book contacts using Google Maps and Google Earth.
 * exponentcms.org Forum: Using Page Display for Google/Yahoo Maps.

Definitions

 * — creates database table of 5 fields which sets configuration settings for the module including API key and Google Map url to pull maps from.
 * — creates database table of 18 fields which sets up individual Maps including location, zoom level, controllers, markers plus a title, text box and notes.

Datatypes

 * — field input definitions for module configuration.
 * — field input definitions for Maps.

Class

 * — class definition.
 * — list of files.

Actions

 * — delete map.
 * — edit map.
 * — move map up/down page.
 * — save map.
 * — view individual map.

Views

 * — default view.
 * — UNUSED.
 * — view individual map.
 * — edit map view.

Subsystem Files

 * — on-screen text (English) for database fields called by datatype file.
 * — on-screen text (English) for database fields called by datatype file.
 * — tbd.

Extra Files

 * — help graphic used in edit map view.
 * — help graphic used in edit map view.
 * — Google Map Javascript.
 * — Google Map script.
 * — Google Map script.
 * — Google Map markers file (TO BE MOVED TO SQL TABLE).

Configuration Fields

 * id — (id) — module id.
 * location_data — (string 200) — module location data.
 * api_key — (string 150) — Google Maps API Key for domain.
 * allow_edits — (boolean) — allow users to edit pages. NOTE: not sure best way to implement this!
 * google_country — (string 60) — select which google domain you wish to use, .com, .co.uk, etc.

Note: The country list will be used for geocoding addresses, but all maps will be generated from maps.google.com.

Map Fields

 * id — (id) — module id.
 * location_data — (string 200) — module location.
 * file_id — (id) — file id.
 * rank — (integer) — rank allows maps to be moved up and down page.


 * name — (string 200) — map title.
 * map_width — (integer) — map width.
 * map_height — (integer) — map height.
 * map_lat — (decimal) — map center latitude.
 * map_lon — (decimal) — map center longitude.
 * map_zoom — (integer) — map zoom level 1 to 15.
 * map_type — (string 30) — visualisation mode can be Map, Satellite or Hybrid: G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP.


 * controller_panzoom — (string 30) — controller GLargeMapControl, GSmallMapControl or GSmallZoomControl.
 * controller_type — (string 30) — controller GMapTypeControl on or off.
 * controller_scale — (string 30) — controller GScaleControl on or off.


 * map_icon — (string 30) — set map icon type.
 * click_target — (string 30) — target for map links
 * body — (string 5000) — text box to display (don't display if empty).
 * notes — (string 5000) — notes, display on edit page only.

Subsystems
Dropdown lists used by datatype files for Module configuration and Map configuration.

Country List
Called by file  to select which Google Map domain the module's Maps will be generated from.
 * Australia & New Zealand - google.com.au = google.com.au
 * Belgium - google.be = google.be
 * Canada - google.ca = google.ca
 * Denmark - google.dk = google.dk
 * Finland - google.fi = google.fi
 * France - google.fr = google.fr
 * Germany (Deutschland) - google.de = google.de
 * Italy - google.it = google.it
 * Japan - google.co.jp = google.co.jp
 * Netherlands - google.nl = google.nl
 * Norway - google.no = google.no
 * Russian Federation - google.ru = google.ru
 * Spain (España) - google.es = google.es
 * Sweden - google.se = google.se
 * United Kingdom & Ireland - google.co.uk = google.co.uk
 * United States - google.com = google.com

Note: List of Google Maps domains as of Wed 01 August 2007. If you find another let me know and I'll add it to the list.

Map Type List
Called by file  to select which type of Google Map will be displayed.
 * Normal Map = G_NORMAL_MAP
 * Satellite Map = G_SATELLITE_MAP
 * Hybrid Map = G_HYBRID_MAP

Zoom Level List
Called by file  to select which zoom level the Google Map will start at. Note: Currently Google Maps only display to level 17, but extra levels have been included in case these become supported in future.
 * 1 to 20

Controller Pan Zoom List
Called by file  to select which type of Google Map Pan Zoom Controller will be displayed. See Fishcakes Wiki section Google Maps Zoom Controllers.
 * None = 0
 * Large Map Controller = GLargeMapControl
 * Small Map Controller = GSmallMapControl
 * Small Zoom Controller = GSmallZoomControl

Controller Type List
Called by file  to select whether the Google Map Type Controller will be displayed. See Fishcakes Wiki section Google Maps Map Type Controller.
 * None = 0
 * Map Type Controller = GMapTypeControl

Controller Scale List
Called by file  to select whether the Google Map Scale Controller will be displayed. See Fishcakes Wiki section Google Maps Scale Controller.
 * None = 0
 * Scale Controller = GScaleControl

Target Type List
Called by file  to determine how url links from Google Map Markers will be handled.
 * None (use implicit) = ""
 * New window (_blank) = _blank
 * Same frame (_self) = _self
 * Top frame (_top) = _top

Passing PHP variables to Javascript

 * techrepublic.com
 * activewidgets.com
 * p2p.wrox.com

Javascript if/else
if (controller_panzoom != "") { map.addControl(new GSmallMapControl); } else { map.addControl(new GSmallZoomControl); }

Code Corrections
Necessary code changes required to fix bugs.

Code Modifications
Optional code changes which extend functionality.