Google Maps Simple Module
From Fishcakes Wiki
Information about structure of Exponent Google Maps Simple Module developed by Fishcakes.
For information about using this module, see the Google Maps Simple Module User Guide.
Contents |
About Google Maps Simple Module
A module for displaying Google Maps using a Google Maps Link or old-style KML File on Exponent web pages. See Resources section below for links to Google Maps help pages.
- Developed by Dan Salmon, July 2007.
- Based on Avi Alkalay Google Maps Plugin — please leave all references to this guy in the code as without him this module wouldn't have happened.
File Structure
Module Folder
-
modules/googlemapsimplemodule— contains files as indicated below.
Definitions
-
datatypes/definitions/googlemapsimplemodule_config.php— creates database table of 4 fields with configuration settings for the module including API key and Google Map domain to generate maps from. -
datatypes/definitions/googlemapsimple.php— creates database table of 14 fields with setting for individual Maps including link, dimensions, controllers, plus a title, text box and notes.
Datatypes
-
datatypes/googlemapsimplemodule_config.php— field input definitions for module configuration. -
datatypes/googlemapsimple.php— field input definitions for Maps.
Class
-
modules/googlemapsimplemodule/class.php— class definition. -
modules/googlemapsimplemodule/manifest.php— list of files.
Actions
-
modules/googlemapsimplemodule/actions/delete_googlemapsimple.php— delete map. -
modules/googlemapsimplemodule/actions/edit_googlemapsimple.php— edit map. -
modules/googlemapsimplemodule/actions/rank_switch.php— move map up/down page. -
modules/googlemapsimplemodule/actions/save_googlemapsimple.php— save map. -
modules/googlemapsimplemodule/actions/view_googlemapsimple.php— view individual map.
Views
-
modules/googlemapsimplemodule/views/Default.tpl— default view. -
modules/googlemapsimplemodule/views/List View.tpl— list view with links to individual maps. -
modules/googlemapsimplemodule/views/_viewgooglemapsimple.tpl— view individual map. -
modules/googlemapsimplemodule/views/_form_editgooglemapsimple.tpl— edit map view.
Subsystem Files Datatypes
-
subsystems/lang/eng_US/datatypes/googlemapsimplemodule_config.php— text (English US) used by datatypes template. -
subsystems/lang/eng_US/datatypes/googlemapsimple.php— text (English US) used by datatypes template.
Subsystem Files Module Views
-
subsystems/lang/eng_US/modules/googlemapsimplemodule/views/Default.php— text (English US) used by views template. -
subsystems/lang/eng_US/modules/googlemapsimplemodule/views/List View.php— text (English US) used by views template. -
subsystems/lang/eng_US/modules/googlemapsimplemodule/views/_form_editgooglemapsimple.php— text (English US) used by views template. -
subsystems/lang/eng_US/modules/googlemapsimplemodule/views/_viewgooglemapsimple.php— text (English US) used by views template.
Javascript Files
-
modules/googlemapsimplemodule/googlemaps/googelmapsPlugin.js— Google Map Javascript code. -
modules/googlemapsimplemodule/googlemaps/sample.kml— sample KML file for testing module. -
modules/googlemapsimplemodule/googlemaps/testfile.html— flat HTML version of plugin to test module and KML files
Tutorial Files
-
modules/googlemapsimplemodule/tutorial/index.html— tutorial page with module User Guide. -
modules/googlemapsimplemodule/tutorial/style.css— css style sheet. -
modules/googlemapsimplemodule/tutorial/images/— images for tutorial.
Database Fields
Configuration Fields
- id — (id) — module id.
- location_data — (string 200) — module location data.
- map_key — (string 150) — Google Maps API Key for domain.
- google_country — (string 60) — select which google domain you wish to use, .com, .co.uk, etc.
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_link — (string 500) — url link to display Google Map.
- map_width — (integer) — map width.
- map_height — (integer) — map height.
- map_width_perc — (boolean) — display map width by percent.
- map_height_perc — (boolean) — display map height by percent (currently unused).
- map_controls — (string 10) — map controls (pan, zoom, type, scale, overlay) on/off.
- map_markers — (string 9) — turn Google Search markers on/off (Personal Markers are not affected).
- 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
Used to select which Google Map domain the module's Maps will be generated from, called by files:
- Subsystem —
subsystems/lang/eng_US/datatypes/googlemapsimplemodule_config.php - Datatype List —
datatypes/googlemapsimplemodule_config.php
Values:
- 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 Controls List
Used to select whether Google Map control overlays (pan, zoom, type, scale, overview) will be displayed, called by files:
- Subsystem —
subsystems/lang/eng_US/datatypes/googlemapsimple.php - Datatype List —
datatypes/googlemapsimple.php
Values:
- None = nocontrols
- Show Google Map Controls = ""
Markers List
Used to select whether Google Search Markers will be displayed, called by files:
- Subsystem —
subsystems/lang/eng_US/datatypes/googlemapsimple.php - Datatype List —
datatypes/googlemapsimple.php
Values:
- None = nomarkers
- Show Google Search Markers = ""
Width Percent List
Used to set if map width is displayed as percentage of page/table/div value, called by file:
- Datatype List —
datatypes/googlemapsimple.php
Values:
- Off = 0
- On = 1
Revisions
Not implemented. No plans to add this.
Search
Not yet implemented. MUST ADD THIS!
Workflow
Not implemented. No plans to add this.
Code Corrections
Necessary code changes required to fix bugs.
Code Modifications
Optional code changes which extend functionality.
Switch Off HTML Editor for Map Description field
To have a simple text field for your map description (body field) rather than using the HTML Editor. Edit file datatypes/googlemapsimple.php.
Remove the // from line 79:
// $form->register('body',$i18n['input_body'],new texteditorcontrol($object->body,6,false,5000));
Add the // to line 80 (or delete the line):
$form->register('body',$i18n['input_body'],new htmleditorcontrol($object->body));
Google Maps See Also
- Google Maps Home Page — official site.
- Get Google Maps API Key — you need a key for each domain or sub-domain on which you want to display maps.
- Google Maps Tour — find out what Google Maps can do.
- Google Maps User Guide — understanding how to use Google Maps.
- Avi Alkalay Google Maps Plugin — provided the Javascript code this module utilises.
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.

