It's better when it's simple

User Tools

Site Tools


OpenLayersMap Plugin

Compatible with DokuWiki

  • 2020-07-29 "Hogfather" yes
  • 2018-04-22 "Greebo" yes
  • 2017-02-19 "Frusterick Manners" yes
  • 2016-06-26 "Elenor Of Tsort" yes

plugin Add maps (OpenStreetMap, Google, Bing and your own data) to your wiki pages using the OpenLayers toolkit

Last updated on
Syntax, Action

Similar to googlemaps, osm

Tagged with embed, geo, maps, media, spatial


A map rendering plugin that will put an OpenLayers based map on the wiki page. The component enables users to put GPS data (currently GeoJSON, GPX and KML format are supported) and other geographic services on the map in configurable layout and uses open source components and data (OSM). It can also be configured to use non-open data (Google, Virtual Earth) providers. The plugin dynamically loads the OpenLayers API on demand, depending on the API license keys that are entered in the configuration section various base map layers are available.

Download and Installation

:!: Note: for old releases (2008-05-05, 2009-02-14, Lemming, Anteater, Rincewind) you need version 1.0

Search and install the plugin using the Extension Manager or manually with the download from the SourceForge Mirror. Refer to Plugins on how to install plugins manually.

Alternate locations for the plugin and older version are available at:

:!: This plugin needs the server to have PHP GD extension, that in some Linux is not installed by default, but it's the package php5-gd or alike. Check your phpinfo() before installing this plugin. If it's not installed you will run into a PHP Fatal error Call to undefined function imagecreatetruecolor() …. but only if you use the local background rendering engine

Change Log

version 4.15

  • load inline javascript deferred

version 4.14

  • some small fixes

version 4.13

  • Russian language files providd by Aleksej Kozlov
  • some small bugfixes
  • many more configuration options provided by Aleksej Kozlov

version 4.12

  • use EPSG:3857 as basemap projection
  • add a geo: uri to the header of popup to open the location in your satnav
  • react to page resize

version 4.11

  • fix hike and bike static map url
  • update google maps api to 3.29
  • allow to add Thunderforest API key

version 4.10

  • add french translation by Digitalin
  • use latest version of OpenLayers 2.14-dev

version 4.9

  • some PHP 7 fixes

version 4.8

  • drop support for MapQuest; their tile service was discontinued
  • add support for Stamen maps (terrain and toner-lite)
  • disable hillshading layer; it is no longer available

version 4.7

  • PHP 7 compatibility fixes

version 4.6

  • use latest version of OpenLayers 2.14-dev
  • update google maps api to 3.22 release

version 4.5

  • use latest version of OpenLayers 2.14-dev

version 4.4

  • use latest version of OpenLayers 2.14-dev

version 4.3

  • some small bugfixes
  • update google maps api to 3.17 release

version 4.2

  • add background to map
  • display Point of Interest coordinates in popups
  • allow coordinate display in decimal degrees or degrees, minutes, seconds

version 4.1

  • add a fullscreen option for the map
  • fix an IE8 bug
  • fix static map generation, different maptypes were not respected
  • add configuration option for a MapQuest API key (needed for remote static map generation) and Google API key
  • semi-responsive map rendering (on page load only); prevent maps that are larger than the page width

version 4.0

  • use OpenLayers 2.14-dev
  • keyboard accessible zoom control replacing the pan/zoom bar
  • keyboard accessible layer switcher control
  • keyboard accessible feature info control
  • removed the toolbar
  • remove the Cloudmade layers; Cloudmade went “enterprise only”
  • removed the option to set openlayers library, this is no longer possible
  • remove styling admin option and remove associated images, use the wiki styling from now on
  • add help pages (en, nl)
deleted files
  • controlbar images:
    • lib/classic/*
    • lib/dark/*
    • lib/orange/*
    • lib/grey/*
    • lib/neutral/*
    • lib/theme/*
  • img/navigation_history.png
  • img/icon_*.png
  • logo/cloudmade_logo.png

version 3.1

  • use OpenLayers 2.13
  • improvements and bugfixes in the static map generator
  • upgrade the google api
  • add orange style
  • drop cUrl requirement by enabling fall-back to file_get_contents
  • add support for GeoJSON
  • remove permalink from the map
  • some accessibility enhancements
deleted files
  • overview-switcher-minimize.png
  • overview-switcher-maximize.png

version 3.0

  • A local static map generator was added. Note that this requires php-curl and the geophp plugin.
  • A management interface for the static map generator was added

Version 2.1

Version 2.0

brings the following changes:

  • support for “Angua” and jQuery
  • fix a negative coordinates bug (3399949)
  • Spanish translation
  • small fixes and enhancements
  • updated the OpenLayers build to 2.12
  • more icons
  • add some more open base layers (transport, landscape,.. )
  • accessibility improvements
  • remove the depercated t@h base layer
  • using v3.8 of the Google api for Goole maps
  • various small enhancements and fixes

Version 1.0

brings the following changes:

  • Yahoo was removed; they are shutting down their maps api (3322552)
  • switched to Google Maps v3 (3035248)
  • Add support for ReST access of the Bing layers (bing road, bing sat, bing hybrid) and deprecated Virtual Earth (ve) 3356282
  • option to disable OSM base layers
  • option to disable MapQuest Open layers
  • Accessibility and printing enhancements:
    • enhancements to show a static fallback map for users that do not have javascript or css which is also used as the print page1)
    • a table with the points of interest2)
    • a description can be entered for the map
    • better styling
  • theme's for some of the controls 3354326
  • :!: dimensions for map width and heigth must be in pixels [px]; previously other units such as % and em may have worked. This is to make sure that the static fallback map works properly.


Currently the following options can/need to be configured (see conf/default.php):

  • enableOSM Enable the use of OpenStreetMap base layers as basemap provider
  • enableMapQuest Enable the use of MapQuest Open as basemap provider (removed in current versions)
  • enableGoogle Enable the use of Google as basemap provider (removed in current versions)
  • enableBing Enable the use of Bing as basemap provider
  • bingAPIKey Bing requires an API key, get yours at:
  • tfAPIKey Thunderforest (cyclemap,transport, landscape and outdoors) requires an API key, get yours at:
  • mapquestAPIKey MapQuest Static Maps API key, get yours at:
  • googleAPIkey Google Static Maps API key, get yours at: (removed in current versions)
  • iconUrlOverload URL for map icons when using static maps on a non-public access host such as with DokuWiki on a Stick or DokuWikiStickNG
  • enableA11y Enable a11y/print output (static map, legend table). If you use maps with a lot of POI you will want to turn this off
  • optionStaticMapGenerator use the local a11y/print map renderer or remote services. Commercial/non-open providers always use their own, remote, service. NB 'local' requires internet access for you webserver.
  • autoZoomMap Enable auto zoom for the map, makes the map zoom to the extent of the POI and KML/GPX


If you want to add (or change) to the available icons for display on the map you can drop them into the directory “icons” in this plugin's directory. They should be about 16px in size. There is a contact sheet available after installing the plugin at <yourbaseurl>/lib/plugins/openlayersmap/icons/ 3) Nice icons are available from:


A small site with the plugin showing various samples is available on SourceForge

The plugin is used on the following pages/sites:

Syntax/ Usage

<olmap id="olMap" width="600px" height="400px" lat="52.0" lon="5.1" zoom="12" statusbar="1" toolbar="1" controls="1" poihoverstyle="1" baselyr="OpenStreetMap" gpxfile=":playground:hardlopen_gpx.gpx" geojsonfile=":playground:test.gsojson" kmlfile=":playground:mtb.kml" summary="This map shows a gpx trace, a kml trace and a dot">
52.1,5.1,60,.8,marker-green.png,Just a spot
  • id The identifyer of the map (this needs to be a valid CSS/XHTML identifier as well as a valid JavaScript variable) eg. olmap.
  • width The width of the map, default is 400px.
  • height The height of the map, default is 300px.
  • zoom The zoom level, default value 12. Valid values depend on the map and location and must be integer.
  • controls Whether or not to show controls for zooming and panning on the map. Valid values are on and off, default on.
  • statusbar Defines if the statusbar is shown. Valid values are 1 or 0, default 1 (on).
  • poihoverstyle Specifies POI feature select behaviour (hover or click). Valid values are 1 or 0, default 0 (click), for reasons of accessibility using hover is dicouraged.
  • lat The latitude of map centre in decimal degrees (WGS84), negative values are south of the equator, valid values range from -90.0 to 90.0.
  • lon The longitude of map centre in decimal degrees (WGS84), negative values are west of Greenwich, valid values range from -180.0 to 180.0.
  • baselyr The basemap layer that is shown when the map opens. Valid values are: OpenStreetMap, transport, landscape, cycle map, hike and bike map, mapquest road, mapquest sat, google relief, google sat, google hybrid, google road, bing road, bing sat or bing hybrid. (note that for some of the non-open maps you need the API key/URL as well)
  • gpxfile any GPX file, use the media manager to retrieve the location
  • kmlfile any KML file, use the media manager to retrieve the location
  • geojsonfile any GeoJSON file, use the media manager to retrieve the location
  • summary A description of the map.

The Points of Interest are formatted:

lat, lon, rotation-angle, opacity, image, textforpopup

The map will zoom in to the extent of the POI which must be given in decimal degrees according to EPSG:4326 (most GPS use this). The text for the popup can be formatted using regular DokuWiki syntax and may contain links as well. (see discussion below or the sample website for more examples)

Known Limitations

  • there may be some issues when the wiki site runs on HTTPS because most of the mapservices used run on plain HTTP, this may present your viewers with warning messages. (cross domain warning).


Hello, I'm trying to build a Wiki where addresses of venues, rehearsal studios, recording studios, supply stores etc. for musicians are collected and this plugin is perfect for that. Embedding OSM works beautifully, but with my newly generated google API key I see an error in the JavaScript Console saying that API versions up to 3.27 have been retired and the request should be sent to version 3.28 instead. I think the new version accepts an additional google security key along with the API key. Are you planning to adapt the openlayersmap extension to the new API? Thank you! —Axel

I'm trying to disable “autoZoomMap” option, but it seems do not work. How to use it? When I put some distant POIs, the map still zooms to include all of them. There is no difference if I use single POIs or kml/geoJSON file. I need to use one geoJSON file for all maps, but each single map should show only required part of area. Please help, how to fix it?
It is not possible to set an area of interest
Would it be possible to generate a map where the POI's are geotagged pages from a certain namespace in the wiki?
this will be available as part of spatialhelper

Am I able to add my own map (image of a landscape.gif) show it on a page and point onto this image to insert a POI? Goal is to create a map like

no this is not possible

I can not force my users to figure out the lat/lon by hand so something like “set marker with point&click” is necessary.
Greetings - Jos

this may be possible in the future
Thanks for your answers
I like the looks of this plugin. I am currently using google_maps and while it works fairly well, it is a bit lacking. With this plugin, can the dimensions of the locational marker pop-ups be fixed/changed? Is wiki text parsed within said pop-ups? I like to write short descriptions with each marker, so I need to format the text and text box to avoid stretching across the screen.

Thanks for the plugin.
Mark you're welcome :-). there are currently no provisions to parse wiki text or URLs (link tags works e.g.

you probably want to set poihoverstyle=“0”). see sample below, it does links, line breaks an formatting.

<olmap id="olmap" width="600px" height="400px" lat="50.0" lon="5.1" zoom="8" statusbar="1" toolbar="1" controls="1" poihoverstyle="0">
49.9780098,5.1839387,270,.7,marker-gold.png,Faux Mayaux; Maissin \\ ** Watch out crossing the street **
50.0117497,5.1287857,60,.8,marker-green.png,Pont de Barbouillons; Daverdisse \\ external link: [[|]] \\ internal link: [[::start]]

The size of the markers is fixed, so even if you use larger bitmaps they will be scaled down, this in part has to do with the hover area and is just how things work in OL.

Hi Mark, I like your plugin too, it's well written. I've left a request on your tracker, suggesting the possibility of pulling the coordinates from a database instead of hard-coding them on the page. If using the PEAR library like one of the MySQL plugins, it shouldn't be too complex ? This would make for a powerful way of displaying multiple real-time coordinates.

==== problem with Binky ==== i've make dokuwiki-update to rc2013-10-28 “Binky”. now my map looks strange: :-( do exist a nightly-build which works with “Binky”? –Kristjan

You are running a plugin (either a very old version of openlayersmap or something different) that uses the addInitEvent() function; this is no longer available in DokuWiki; see jqueryfaq This causes a nonrecoverable error. What you are seeing is an expected result. My best guess is that you are running an out of date plugin (which is probaby not openlayersmap as i have several Binky RC instances that work just fine).
i already use the actual version of openlayersmap-plugin. so i have updated all other plugins and now the map looks fine again :-) thanks for the hint! i don't know which plugin causes the problem. –Kristjan

Hi to all!

I like this plugin very much, but there was one thing that was not perfect for my needs. The width of the map must be specified absolutely in pixel. The map is much too wide on my mobile phone. For that I stumbled through the code of the plugin (don't call me an expert :-)) and tried to find out what to do.

Here's my solution, which will work now for my desktop and my mobile phone. At first a sample of the “new” insert syntax.

<olmap id="olmap" width="auto" height="auto" lat="50.0" lon="5.1" zoom="8" statusbar="1" toolbar="1" controls="1" poihoverstyle="0">
49.9780098,5.1839387,270,.7,marker-gold.png,Faux Mayaux; Maissin \\ ** Watch out crossing the street **
50.0117497,5.1287857,60,.8,marker-green.png,Pont de Barbouillons; Daverdisse \\ external link: [[|]] \\ internal link: [[::start]]

The width will be calculated if auto is specified for it. And if auto is also specified for the height, then the height will be 2/3 of the width.

I've done my work only in the file script.js of the plugin. I've added the following function to the file (which I've found using Google).

Element.prototype.getElementWidth = function() {
   if (typeof this.clip !== "undefined") {
	  return this.clip.width;
   } else {
	  if ( {
	  } else {
		 return this.offsetWidth;

And then I've made the following extension to the method createMap. In the following sample there's some of the original code at the beginning and the end so you can find the position where to insert the new lines.

// find map element location
var cleartag = document.getElementById( + '-clearer');
if (cleartag === null) {
// ====== START OF INSERTED CODE ======
// calculate dynamic width and height
var dynamicWidth = 0;
if (mapOpts.width == 'auto') {
	var contentWidth = 0;
	var asideWidth = 0;
	var elementContent = document.getElementById('dokuwiki__content');
	if (elementContent === null) {
	} else {
		contentWidth = elementContent.getElementWidth();
	var elementAside = document.getElementById('dokuwiki__aside');
	if (elementAside === null) {
	} else {
		asideWidth = elementAside.getElementWidth();
	if (contentWidth > asideWidth) {
		dynamicWidth = contentWidth - asideWidth - 60;
	} else {
		dynamicWidth = contentWidth - 20;
	if (dynamicWidth > 0) {
		mapOpts.width = dynamicWidth + 'px';
	} else {
		mapOpts.width = '500px';
if (mapOpts.height == 'auto') {
	if (dynamicWidth > 0) {
		var dynamicHeight = dynamicWidth * 0.66;
		mapOpts.height = dynamicHeight + 'px';
	} else {
		mapOpts.height = '500px';
// ====== END OF INSERTED CODE ======
// create map element and add to document
var fragment = olCreateMaptag(, mapOpts.width, mapOpts.height);
cleartag.parentNode.insertBefore(fragment, cleartag);

Well, as I've mentioned above: It works for me. The hardcoded values (60, 20) are not nice, really. And generally I do think that there could be a better solution. Maybe someone feels inspirated now to make it better (and to make me happy).


@Werner this patch will give you problem as the width is also used for the fallback image and 'auto' is not a valid value for the width attribute of an img element

I just installed this wonderful plugin to embed an OpenStreetMap to my website. However, I found that the map is placed on top of all the other elements of the page so that it covers the (fixed) header DIV when I scroll down. Any hint, what I can do to prevent that?

this issue is probably caused by your template; you may need to fix the template

How to find out why rendering of print map fails? Gd2 installed, using local renderer.

look at the logfile of your webserver, turn on debugging for the wiki and check that logfile, maybe turn on debug logging for php

I like this plugin, are there plans to make it compatible with Frusterick Manners (2017-02-19) any time soon?

The plugin works successfully with this version. — Wirbel78 2017-05-08 09:54

if i use the example code from above i just get a blank page! no sidebar, no wiki header, just a blank page. i'm using latest dokuwiki frusterik manners… or should i call it now “frustration matters” instead?

2017-09-23 21:25
Page will not by saved (endless loop?) if to add same lat/lon in map and point of interest.

Warning: Division by zero in .../lib/plugins/openlayersmap/StaticMap.php on line 639
<olmap lat="52.0" lon="5.1" ...>
52.0,5.1 ...

Just need to create map with one point of interest in a middle of map.
Can you fix it?
Thank you for a useful plugin
Found out this happens only if “autoZoomMap” is enabled.


I'm getting this error message when trying to install/update the plugin:

Impossible de télécharger le fichier :

Zbf 2020-01-27 10:17

Hi, I am experiencing a strange behavior with geojson file. The coordinates used to center the map are working well (45.172223,28.326278 which is somewhere in Romania), but when I put the same coordinates in a geojson file it displays the point somewhere in Saudi Arabia. I cannot get to the bottom of this. Any idea?

LE: Never mind, I found the problem. It was quite stupid, the longitude and latitude I was using were reversed in the data source I was importing from.

Also, it would be nice to change the order of loading layers in script.js and put the POI layer last, just before controls and toolbar. Otherwise a KML polygon will cover the POIs and the user is unable to click on them.

Btw, I am using 2018-04-22c “Greebo” version and the latest version of this plugin.

Thanks, — sorinsfirlogea 2020-06-12 09:43

I've started running a new DokuWiki installation local in an XAMPP environment, using version rc-2020-06-09 “Hogfather” RC3. As I always do when starting something new. And I've spent hours finding out why the OpenLayers map plugin is not working. It only shows a static image and a table. Even when I'm using the samples from the plugin documentation. Now tired from searching all around, I tried to start from the beginning again, but with DokuWiki version 2017-02-19g “Frusterick Manners”. I did the same than before, only those things that are necessary, running install.php, installing geoPHP plugin and OpenLayers map plugin. And - TADAAA - it's working !!! Looks like there's something different in the current version of DokuWiki. But how to fix this, either in DokuWiki or in the plugin ?!?

Werner 2020-06-29 20:25

plugin/openlayersmap.txt · Last modified: 2020-10-29 16:22 by mprins