====== openlayersmap plugin ====== ---- pluginnews ---- headline: Plugins by same author style: sameauthor ---- ---- plugin ---- description: Add maps (OpenStreetMap, Google, Virtual Earth, Yahoo and your own data) to your wiki pages using the OpenLayers toolkit author : Mark C. Prins email : mc.prins@gmail.com type : syntax lastupdate : 2012-01-29 compatible : 2008-05-05, 2009-02-14, Lemming, Anteater, Rincewind, Angua depends : conflicts : similar : googlemaps, osm tags : media, maps, embed downloadurl: http://sourceforge.net/projects/dokuwikispatial/files/openlayersmap/openlayersmap.zip/download sourcerepo : http://sourceforge.net/svn/?group_id=239475 bugtracker : http://sourceforge.net/tracker2/?group_id=239475 ---- ===== Description ===== A map rendering plugin that will put an [[http://openlayers.org|OpenLayers]] based map on the wiki page. The component enables users to put GPS data (currently GPX and KML format are supported) and other geographic services on the map in configurable layout and uses open source components and data ([[http://www.openstreetmap.org/|OSM]]). It can also be configured to use non-open data (Google, Virtual Earth, Yahoo Maps) 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 Angua you currently need to get version [https://sourceforge.net/projects/dokuwikispatial/files/openlayersmap/|2.0-SNAPSHOT]; I will finalize this into a 2.0 release an update the auto update version in the coming weeks, I just want to do some more testing before I release.** Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the given URL((or directly using http://surfnet.dl.sourceforge.net/project/dokuwikispatial/openlayersmap/openlayersmap.zip)). Refer to [[:Plugins]] on how to install plugins manually. Alternate locations for the plugin and older version are given below. * http://sourceforge.net/projects/dokuwikispatial/files/openlayersmap/ snapshots and releases {{rss>http://sourceforge.net/api/file/index/project-id/239475/rss 8 date}} Source code can be found on the [[http://sourceforge.net/svn/?group_id=239475|Sourceforge.net Subversion]] site. use the following command to check out everything: svn co https://dokuwikispatial.svn.sourceforge.net/svnroot/dokuwikispatial/trunk dokuwikispatial === News & Updates === [[http://sourceforge.net/export/rss2_keepsake.php?group_id=239475|{{http://img529.imageshack.us/img529/5725/feedm.png|RSS feed}}]] {{rss>http://sourceforge.net/export/rss2_keepsake.php?group_id=239475 date }} == changes== Version 2.0 (a snapshot is available on the download site) brings the following changes: - support for “Angua RC1” - fix a negative coordinates bug ([[http://sourceforge.net/tracker/?func=detail&aid=3399949&group_id=239475&atid=1110186|3399949]]) Version 1.0 brings the following changes: - Yahoo was removed; they are shutting down their maps api ([[http://sourceforge.net/tracker/?func=detail&aid=3322552&group_id=239475&atid=1110189|3322552]]) - switched to Google Maps v3 ([[http://sourceforge.net/tracker/?func=detail&aid=3035248&group_id=239475&atid=1110189|3035248]]) - Add support for ReST access of the Bing layers (bing road, bing sat, bing hybrid) and deprecated Virtual Earth (ve) [[https://sourceforge.net/tracker/?func=detail&aid=3356282&group_id=239475&atid=1110189|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 page((this option may be disabled)) * a table with the points of interest((this option may be disabled)) * a description can be entered for the map * better styling - theme's for some of the controls [[https://sourceforge.net/tracker/?func=detail&aid=3354326&group_id=239475&atid=1110189|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. - use [[http://openlayers.org|OpenLayers 2.11]] ===== Configuration ===== Currently the following options can/need to be configured (see conf/default.php): * **olScriptUrl** (required) the URL for the Openlayers API (default: '/lib/plugins/openlayersmap/lib/OpenLayers.js') This may need adjusting to point to your plugin directory path. * **googleScriptUrl** (deprecated, replaced by enableGoogle) the URL for the Google Maps API (e.g. 'http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGe') * **veScriptUrl** (optional) the URL for the Virtual Earth Maps API (e.g. 'http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1') * **yahooScriptUrl** (optional) the URL for the Yahoo Maps API (e.g. 'http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzu') * **enableGoogle** Enable the use of Google as basemap provider * **enableMapQuest** Enable the use of MapQuest as basemap provider * **enableOSM** Enable the use of OpenStreetMap as basemap provider * **enableBing** Enable the use of Bing as basemap provider * **bingAPIKey** Bing requires an API key, get yours at https://www.bingmapsportal.com/application * **iconUrlOverload** URL for map icons when using static maps on a non-internet host * **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 ===== Icons ===== 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 ''/lib/plugins/openlayersmap/icons/'' ((eg. http://dokuwikispatial.sourceforge.net/dokuwiki/lib/plugins/openlayersmap/icons/index.php)) Nice icons are available from: * http://www.sjjb.co.uk/mapicons/contactsheet/ * http://code.google.com/p/google-maps-icons/ * http://projects.opengeo.org/geosilk * http://www.gpsdrive.de/development/map-icons/overview.en.shtml ===== Demonstration ===== A small site with the plugin showing various samples is available on [[http://dokuwikispatial.sourceforge.net/dokuwiki/doku.php|SourceForge]] The plugin is used on the following pages/sites: * http://dokuwikispatial.sourceforge.net/dokuwiki/openlayersmap various live samples of the development version * http://wild-water.nl/dokuwiki/ * http://www.westwijkinfo.nl/dokuwiki/doku.php?id=sssst_-_geheime_plekjes_in_de_wijk * http://www.hooidonksekanoclub.nl/dokuwiki/informatie/routebeschrijving * http://www.hotspot-muenchen.de/doku.php?id=hotspot_karte ===== Syntax/ Usage ===== 52.1,5.1,60,.8,marker-green.png,Just a spot * id - div id of the map (this needs to be a valid CSS identifier as well as a valid JavaScript variable) * width ? 999px (e.g. 500px) width of the Google map, default is 400px. * height ? 999px (e.g. 500px) height of the Google map, default is 300px. * zoom ? integer, zoom level, default value 5. Valid values depend on the map and location. * controls ? values on | off. default on. Whether or not to show controls for zooming and panning on the map. * toolbar ? values 1 | 0. default 1 (on). defines if the toolbar is built * statusbar ? values 1 | 0. default 1 (on). defines if the statusbar is built * poihoverstyle - values 1 | 0. default 1 (on). specifies POI feature select behaviour (hover or click) * lat ? values -90.0 - 90.0; latitude of map centre, negative values are south. (WGS84) * lon ? values -180.0 - 180.0; longitude of map centre, negative values are west. (WGS84) * baselyr ? values OpenStreetMap | t@h | cloudmade map | cycle map | google relief | google sat | google hybrid | google normal | yahoo | ve (note that for the non-open maps you need the 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 The Points of Interest are formatted: lat, lon, rotationangle, opacity, image, textforpopup The map will zoom in to the extent of the POI. The text for the popup can be formatted using regular DokuWiki syntax and may contain links as well. (see [[openlayersmap#discussion]] below for enhanced sample) ===== Known Limitations ===== This is currently a work in progress; please check the [[http://sourceforge.net/tracker2/?group_id=239475|Tracker]] on the SourceForge.net site. * there are some issues when the wiki site runs on HTTPS because all of the mapservices used (OSM, Google,Yahoo, etc) run on plain HTTP, this will present your viewers with warning messages. (cross domain warning) ===== Discussion ===== > The Popup looks weird in my wiki, is this a bug or an error on my side? i'm using the latest snapshot. here's an example: [[http://imageshack.us/photo/my-images/31/bildschirmfoto20120130u.png/]] > keep up the good work > -Jonas >> that is weird, I've never seen that before. Did you purge the cache (at least the css and js should be purged after an upgrade) or do you have a very small map? in that case the div element holding the popup might not fit. >> --- [[user>mprins|Mark]] //2012/01/31 13:54// >>> i tried to purge everything but the popup still looks the same way. when i checked the map i also got this: [[http://imageshack.us/photo/my-images/402/bildschirmfoto20120210u.png/]] this notice >>> won't go away :(. never seen this befor, no clue what the reason is > 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. >> [[user>mprins|Mark]] you're welcome :-). there are currently no provisions to parse wiki text or URLs (link tags works e.g. [[http://test.com|test]] you probably want to set poihoverstyle="0"). see sample below, it does links, line breaks an formatting. >> 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: [[http://test.com|test.com]] \\ 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. >> this is unlikely to happen; see [[https://sourceforge.net/tracker/?func=detail&aid=2928736&group_id=239475&atid=1110189]] why. >> --- [[user>mprins|Mark]] > 51.8795,8.506751,30,.5,marker-gold.png,Start;Start >With this Code I see no marker and "Goggle Hybrid" is not displayed. Why? See in Action at http://www.jan-hendrikbade.de/doku.php/wiki:plugins#openlayers_map >> I suspect this is the same issue as described in [[http://sourceforge.net/tracker/?func=detail&aid=2896534&group_id=239475&atid=1110186|2896534]]. The case of the layername is converted to lowercase (the "G" ends up as a "g") causing this behaviour. ((this has been fixed)) As for the marker; I have no idea, I ran your page through Firebug and that gives me a "too much recursion" error (I've never seen that yet), maybe you can give it a try with most extensions disabled? Also I don't see the toolbar!? --[[mc.prins@gmail.com|Mark]] >>> I installed the Version from 31.1(VERSION File) but nothing changes... See: http://www.jan-hendrikbade.de/doku.php/playground:playground Now I deactivated all the plugins and... IT WORKS Thank You! I found the mad add-on: http://www.inetsoftware.de/other-products/dokuwiki-plugins/miniajax it is used by ImageFlow >>>>I guess miniajax redefines the builtin "$" >>> But now the zoom is always set to 18, see http://www.jan-hendrikbade.de/doku.php/playground:playground >>>>Yes, the map automatically zooms to the extent of all the POI within the allowed range of zoomlevels, so when you have one POI, or a couple that are really close the map zooms in to the highest resolution, effectively ignoring the scale. >>>>A workaround for this is to have some POI that you give a transparency of 1 and that are a few hundred meters apart… see: [[http://sourceforge.net/tracker/?func=detail&aid=2949057&group_id=239475&atid=1110189|2949057]] This has now been fixed properly