Google Map Module
From Fishcakes Wiki
This page contains info about the Exponent Google Map Module developed by Fishcakes.
Contents |
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.
File Structure
Definitions
-
datatypes/definitions/googlemapmodule_config.php— creates database table of 5 fields which sets configuration settings for the module including API key and Google Map url to pull maps from. -
datatypes/definitions/googlemap.php— 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
-
datatypes/googlemapmodule_config.php— field input definitions for module configuration. -
datatypes/googlemap.php— field input definitions for Maps.
Class
-
modules/googlemapmodule/class.php— class definition. -
modules/googlemapmodule/manifest.php— list of files.
Actions
-
modules/googlemapmodule/actions/delete_googlemap.php— delete map. -
modules/googlemapmodule/actions/edit_googlemap.php— edit map. -
modules/googlemapmodule/actions/rank_switch.php— move map up/down page. -
modules/googlemapmodule/actions/save_googlemap.php— save map. -
modules/googlemapmodule/actions/view_googlemap.php— view individual map.
Views
-
modules/googlemapmodule/views/Default.tpl— default view. -
modules/googlemapmodule/views/Text_on_right.tpl— UNUSED. -
modules/googlemapmodule/views/_viewgooglemap.tpl— view individual map. -
modules/googlemapmodule/views/_form_editgooglemap.tpl— edit map view.
Subsystem Files
-
subsystems/lang/eng_US/datatypes/googlemapmodule_config.php— on-screen text (English) for database fields called by datatype filedatatypes/googlemapmodule_config.php. -
subsystems/lang/eng_US/datatypes/googlemap.php— on-screen text (English) for database fields called by datatype filedatatypes/googlemap.php. -
subsystems/lang/eng_US/modules/googlemapmodule/'— tbd.
Extra Files
-
modules/googlemapmodule/graphics/google-controllers.png— help graphic used in edit map view. -
modules/googlemapmodule/graphics/google-zoom-levels.png— help graphic used in edit map view. -
modules/googlemapmodule/googlemaps/googlemaps_markers.js— Google Map Javascript. -
modules/googlemapmodule/googlemaps/loadMarkers.php— Google Map script. -
modules/googlemapmodule/googlemaps/saveMarkers.php— Google Map script. -
modules/googlemapmodule/googlemaps/googlemapMarkers.xml— Google Map markers file (TO BE MOVED TO SQL TABLE).
Database Fields
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 datatypes/googlemapmodule_config.php 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 datatypes/googlemap.php 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 datatypes/googlemap.php to select which zoom level the Google Map will start at.
- 1 to 20
Note: Currently Google Maps only display to level 17, but extra levels have been included in case these become supported in future.
Controller Pan Zoom List
Called by file datatypes/googlemap.php to select which type of Google Map Pan Zoom Controller will be displayed.
- None = 0
- Large Map Controller = GLargeMapControl
- Small Map Controller = GSmallMapControl
- Small Zoom Controller = GSmallZoomControl
See Fishcakes Wiki section Google Maps Zoom Controllers.
Controller Type List
Called by file datatypes/googlemap.php to select whether the Google Map Type Controller will be displayed.
- None = 0
- Map Type Controller = GMapTypeControl
See Fishcakes Wiki section Google Maps Map Type Controller.
Controller Scale List
Called by file datatypes/googlemap.php to select whether the Google Map Scale Controller will be displayed.
- None = 0
- Scale Controller = GScaleControl
See Fishcakes Wiki section Google Maps Scale Controller.
Target Type List
Called by file datatypes/googlemap.php 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
Other
Passing PHP variables to Javascript
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.
Exponent CMS Resources
Official Exponent Resources
- exponentcms.org — official website.
- exponentcms.org Download — get Exponent.
- sourceforge.net Exponent — get Exponent from SourceForge.
- exponentcms.org Download Themes — change the look.
- exponentcms.org Download Modules — extend Exponent.
- exponentcms.org Forums — for advice.
- exponentcms.org FAQ — How Do I guide to common questions.
- exponentcms.org User Guides — PDF downloads.
- exponentcms.org Designers Guide — doesn't really exist yet!
- exponentcms.org Developers Guide — doesn't really exist yet!
- exponentcms.org How To Create a Module — basic module structure explained.
Unofficial Exponent Resources
- phpxref.com Exponent — online browsing of Exponent 0.96.3 source code.
- netstepcms.com eXponent Overview — good review of what's on offer.
- zimmertech.com Tutorials — excellent tutorials on variety of topics, including great Themes tutorial.
MySQL Resources
- mysql.com — MySQL official website.
- mysql.com Documentation — official user guide.
- wikipedia.org MySQL — good history and definition.
- php.net MySQL Functions — using PHP and MySQL together.
PHP Resources
- php.net — PHP Hypertext Processor official website.
- wikipedia.org PHP — good history and definition.
- w3schools.com PHP Tutorial — excellent online tutorial.
- php.resourceindex.com — index of PHP code snippets for the seriously techie.

