GoogleMapsPlugin is a plugin for embedding Google Maps into a JSPWiki page.

You can use it to mark certain landmarks, or to describe routes. Here's an example of how a running route was described with this plugin for a local event called Parkfestlauf-Gemmingen

The Plugin is Open Source (LGPL) -> Download Sourcecode


  1. Download the and unzip it into your JSPWiki's WEB-INF directory.
  2. Edit WEB-INF/ file and add org.wikiwizard.jspwiki.googlemaps to the property jspwiki.plugin.searchPath.
  3. Obtain an API key from Google Maps. Your Web URL will depend on your configuration. Usually, it should be your jspwiki.baseURL property value.
  4. Edit WEB-INF/ file add the key to the property jspwiki.Google.maps.key.
  5. Optional: Edit WEB-INF/googlemaps/ if you want to modify or add marker and line styles
  6. Optional: Edit your template's CSS file and define a map id such as
#map {
    min-width: 400px;
    min-height: 400px;


Place the following line anywhere in a JSPWiki page.

[{GoogleMaps lat='coordinate latitude' lng='coordinate longitude'}]

Due to the nature of Google Maps, only one map is permitted per page.


Google Maps API key, now deprecated and the value is loaded from properties file
Coordinate Latitude value from -90 to 90, must be enclosed in single quotation marks
Coordinate Longitude value from -180 to 180, must be enclosed in single quotation marks
Zoom value from 0 to 19, where 0 is widest and 19 is closest
hybrid, map or sat
small or big
plugin width
plugin heigth
values true/false - adds a trace bar at the end of the plugin to display the current lat and lng -> useful for setting new markers
yes or no (workaround for InternetExplorer)

Defining Markers and Lines between Markers#

This is an example of two markers (points) with text in it and lines between those markers. GoogleMaps.png

Heres an example of how the above image was created:

[{GoogleMaps lat='49.12271669366686' 

Marker p1: 49.12271669366686, 9.206113815307617
Das [i3g Institut|]

Marker p2: 49.12226732260275, 9.211091995239258
Die [Hochschule|]

p1 -> p2

To get the coordinate, you can use Google Maps to navigate to the point you want to display, double click it so it is centered, and make note of the ll=xx.xxxx,yy.yyyy value in "Link to this page" link. They are the latitude and longitude values respectively.

Alternatively you can set the trace parameter to 'true'. This will display lat and lng at the bottom of the plugin in a yellow bar.

Additional usage#

Invisible Marker#

Invis Marker: 49.12226732260275, 9.211091995239258

Marker (default color: red)#

Marker: 49.12226732260275, 9.211091995239258

Colored Marker#

Blue Marker: 49.12226732260275, 9.211091995239258

Marker with the name "m1" (helpful to create lines)#

Marker point: 49.12226732260275, 9.211091995239258

Green Marker with the name "m2"#

Green Marker m1: 49.17226732260275, 9.211091995239258

Marker with two Tabs#

Marker: 49.12226732260275, 9.211091995239258

Tab: Tabname

Tab: Tabname2


49.12226732260275, 9.211091995239258 -> 49.15226732260295, 9.211091995239228

Colored Line#

Red Lines:
49.12226732260275, 9.211091995239258 -> 49.15226732260295, 9.211091995239228

Line using Marker names#

m1 -> m2 -> 49.15226732260295, 9.211091995239228

Known Issues#

Map is not displayed (Internet Explorer)#

Somehow the plugin does not work with Internet Explorer. But there is a workaround:

  1. Add fixIE='yes' to the plugin parameters.
  2. Change the ViewTemplate.jsp of the used JSPWiki template as follows:


  <script type="text/javascript">
  function checkgooglemaps(){
  	if ( window.googlemaps )

into the <head> section of the page. Then add an onload parameter to the <body> tag:

<body class="view" bgcolor="#FFFFFF" onload="checkgooglemaps()">

This should solve the problem. If anyone knows a better solution, please let us know (just add a comment below). It seems IE has a problem with directly executing the javascript code. But it works when putting all code into a function and executing it from onload.

Map is not displayed (Internet Explorer) part 2:#

The above solution prevents (?) the window.onload call in commonheaders.jsp (breaking TabbedSection, SearchBox, Sortable, ZebraTable... etc.). The following solution works for me (2007-Jan-12, RonAtkins):
  1. Follow the directions in the section Lines and overview map are not displayed (below, to resolve lines not being displayed in IE).
  2. Add fixIE='yes' to the plugin parameters.
  3. Make the following changes in commonheader.jsp (of the JSPWiki template you are using):
<%-- Here we define the "run when the page loads" -script. --%>
<script type="text/javascript">

function checkgooglemaps()
  	if ( window.googlemaps )

function runOnLoad()
  <wiki:IncludeResources type="jsfunction"/>

window.onload = runOnLoad;


Lines and overview map are not displayed (Internet Explorer)#

Even using the workaround for the IE problem, lines and the minmap are not displayed when using IE. The solution is described on the Google Maps API page: The changes also have to be made in the ViewTemplate.jsp file.


This Plugin was implemented independently by the i3G Institute and

The Plugin as described above is a semester work by Amir Farokhzad done at the i3G Institute.

The plugin by was published on this page three days before Amir Farokhzads Plugin, but the implementation is very basic an therefore is lacking several features

  • User-defined map type
  • Point information
  • Multiple points
  • Connect the points with lines

The Implementation is attached on this page. -> and GoogleMapsPlugin.jar(info).

Please visit the project page of for more details.

14-Jun-2006 --ChristophSauer


--Fan Wang, 15-Jul-2006

I followed your guide step by step, but

Plugin insertion failed: Plugin failed ?


My wiki is 2.4.53

--AnonymousCoward, 24-Sep-2006

The plugins seems to need Java 5... Also there is a little typo error which makes pop-up ballons go werk (javascript errors pop up). Specifically, in, line 289 should look like this:

map += "  document.getElementById(\"zoom\").innerHTML = map.getZoom()\n";

also, as you fix this in the source code, ballons appear without content. In tomcat's stdout you can see that data is correctly retrieved but it's not shown in the G'Map

-- JP 02/10/2006

Update: I've been looking through the code. Wiki2HTMLConverter was using TranslatorReader which is deprecated since 2.3 so, when parsing text into Tabs you always got a blank String. Fixed the code for 2.4.x (thanks Janne for pointing here for instructions on how to parse wiki markup in 2.4). I've also corrected the small typo noted yesterday and removed all System.out's, as debugging with Eclipse is a lot easier if you want to follow the code.

This jar has been tested on 2.4.64, compiled and uploaded to this page with the source code. Download the plugin for 2.4 branch clicking here(info). The zip has the source code and the compiled jar (it's in the ./bin folder). For installing it, take that jar and follow the previous instructions (place it in WEB-INF/lib, etc)

-- JP 03/10/2006

I wanted to use this on a machine that only had Java 1.4 on it, so has to replace some Java 5 functions that were being used with some 1.4 equivalents.

  • String.replace(String regex, String text) became String.replaceAll(String regex, String text)
  • String.contains(String needle) became String.indexOf(String needle)>=0

This patch(info) is against the 2.4.64(info) branch below.

To apply the patch and recompile.

cd googlemaps
patch -p1 < path/to/java1.4_patch_for_googlemaps-plugin-2.4.64
rm -Rf bin/org/
javac -d bin -classpath /path/to/apache-tomcat/common/lib/servlet-api.jar:/path/to/apache-tomcat/webapps/JSPWiki/WEB-INF/lib/JSPWiki.jar src/org/wikiwizard/jspwiki/googlemaps/*.java
cd bin/
rm googlemaps.jar 
zip googlemaps.jar -r .

then install the jar as normal (place it in WEB-INF/lib, etc)

-- Jonathan 2006/12/03

I followed the install step by step. But I got the following problem.

Plugin insertion failed: Could not find plugin GoogleMaps

I modify jspwiki.propertires file as the following:

jspwiki.plugin.searchPath =org.wikiwizard.jspwiki.googlemaps


XXXXXX is Google Maps key number.

Does any get the same proble? My JSPWiki version is v2.8.1.

-- TonyChou 2009/03/17

That's what I get from the Parkfestlauf-Gemmingen example: Plugin insertion failed: Could not find plugin org.wikiwizard.jspwiki.googlemaps.GoogleMaps

--Rolf Schumacher, 23-Dec-2009 22:53

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
001.jpg 162.7 kB 1 28-May-2009 17:01
GoogleMaps.png 269.0 kB 3 15-Jun-2006 10:25 Christoph Sauer
GoogleMapsPlugin.jar 2.3 kB 1 12-Jun-2006 13:45 msb0b
java 5.0 kB 1 12-Jun-2006 13:45 msb0b
zip 59.2 kB 1 03-Oct-2006 12:10
java1.4_patch_for_googlemaps-p... 2.9 kB 1 03-Dec-2006 01:24 patch against to support java1.4
« This page (revision-53) was last changed on 23-Dec-2009 22:55 by Rolf Schumacher