Google Maps for Foswiki


TML example

You type:

  address="Union Station, Los Angeles, USA" 
  infowindowaddress="Union Station, Los Angeles, USA"
  infowindow="<b>Here it is!</b>"

  address="Union Station, Los Angeles, USA" 
  infowindowaddress="Union Station, Los Angeles, USA"
  infowindow="<b>Here it is!</b>"

You get (if installed):

JavaScript example

As GoogleMapsPlugin is based on gmap3, using its JavaScript API isn't that hard either while opening up a few more possibilities.

Address: find
Error: no such plugin googlemaps

<div id="example2" style="height:350px;width:600px"></div>

<div class="foswikiPageForm">
<table class="foswikiLayoutTable" style="width:600px">
  <td><input type="text" class="foswikiInputField" size="50" id="address" /> <a href="#" id="searchAddress">%JQICON{"find"}%</a></td>
  <td><input type="text" class="foswikiInputField" size="50" id="lat" /></td>
  <td><input type="text" class="foswikiInputField" size="50" id="lng" /></td>
  <td><input type="text" class="foswikiInputField" size="50" id="zoom" /></td>
%JQREQUIRE{"googlemaps"}%%ADDTOZONE{"script" id="MYGOOGLEMAPS::JS" requires="JQUERYPLUGIN::GOOGLEMAPS" text="<script type='text/javascript' src='%ATTACHURLPATH%/script.js'></script>"}%



  • address: free form address to center the map on
  • center: comma-separated latitude and longitude position to center the map on, e.g. 53, 9 (use either address or center);
  • zoom: integer zoom factor
  • markeraddress: addresses of markers to be displayed on the map; addresses are separated by newlines
  • infowindow: content of the info window to be displayed at the marker, or at the infowindowaddress
  • infowindowaddress: position where to put the infowindow
  • infowindowposition: coma-separated latitude and longitude position of the infowindow (use either infowindowaddress or infowindowposition);
  • type: map type, can be roadmap, sattelite, hybrid or terrain
  • typecontrol: boolean flag whether to display the type control widget
  • navigationcontrol: boolean flag whether to display the navigation control
  • streetviewcontrol: boolean flag whether to display the streetview control
  • scrollwheel: boolean flag whether to enable/disable zooming using the scroll wheel
  • height: height of the map (required)
  • width: width of the map, defaults to 100% expanding to the size of the container
  • id: the html id of the container holding the map, defaults to a random id

Further reading


Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See for more help.

If you are using SecurityHeadersPlugin then you need to allow a few google resources to be loaded by Foswiki:

  • add * to script-src
  • add to style-src
  • add to font-src



Change History

02 Sep 2016: repackaged to contain a missing js file in the examples
21 Apr 2016: upgraded to latest version of gmap3
07 Nov 2013: fixed issue mixing HTTP and HTTPS assets
06 May 2013: implement multiple markers, all having a click event to open an infowindow
08 Feb 2013: initial release
Form definition 'PackageForm' not found

PackageForm? edit

Author Michael Daum
Version 3.01
Release 02 Sep 2016
Description Google Maps for Foswiki
Copyright © 2013-2016 Michael Daum (Foswiki integration), © 2010-2012 Jean-Baptiste Demonte (gmap3)
License GPL (Gnu General Public License)
Home Foswiki:Extensions/GoogleMapsPlugin
Support Foswiki:Support/GoogleMapsPlugin
Topic attachments
I Attachment Action Size Date WhoSorted ascending Comment
GoogleMapsSnap1.pngpng GoogleMapsSnap1.png manage 264.6 K 11 Jul 2016 - 12:50 ProjectContributor  
script.jsjs script.js manage 2.6 K 11 Jul 2016 - 12:50 ProjectContributor Generated by AttachContentPlugin
Topic revision: 11 Jul 2016, ProjectContributor

This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback