plugin:openlayersmap
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:openlayersmap [2012-02-17 01:31] – solution for cropped background images ach | plugin:openlayersmap [2025-04-06 13:28] (current) – [Demonstration] mprins | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | ---- pluginnews ---- | + | |
- | headline: Plugins by same author | + | |
- | style: sameauthor | + | |
- | ---- | + | |
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
- | author | + | author |
- | email : mc.prins@gmail.com | + | email : mprins@users.sf.net |
- | type : syntax | + | type : syntax, action |
- | lastupdate : 2012-02-16 | + | lastupdate : 2025-04-02 |
- | compatible : 2008-05-05, 2009-02-14, Lemming, Anteater, Rincewind, Angua | + | compatible : Hogfather, Igor, Jack Jackrum, Kaos |
- | depends | + | depends |
conflicts | conflicts | ||
similar | similar | ||
- | tags : media, maps, embed | + | tags : media maps embed geo spatial |
- | downloadurl: | + | downloadurl: |
- | sourcerepo : http://sourceforge.net/svn/? | + | sourcerepo : https://github.com/mprins/ |
- | bugtracker : http://sourceforge.net/tracker2/? | + | bugtracker : https:// |
+ | donationurl: | ||
---- | ---- | ||
+ | |||
===== Description ===== | ===== Description ===== | ||
- | A map rendering plugin that will put an [[http:// | + | |
- | 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:// | + | A map rendering plugin that will put an [[https:// |
- | It can also be configured to use non-open data (Google, Virtual Earth, Yahoo Maps) providers. | + | The component enables users to put GPS data (currently |
+ | It can also be configured to use non-open data (eg. Bing) 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. | 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. | ||
+ | |||
+ | ===== Upgrading to 2022-06-14 or later ===== | ||
+ | After upgrading the plugin and removing/ | ||
+ | * if you have used olmap_agslayer you need to change the url; remove the ''/ | ||
+ | * if you have used olmap_osmlayer you need to remove the '' | ||
===== Download and Installation ===== | ===== Download and Installation ===== | ||
- | **NOTE: for Angua you currently | + | :!: Note: for old releases (2008-05-05, |
- | + | ||
- | Download and install the plugin using the [[plugin: | + | |
- | * http:// | + | Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[: |
- | {{rss> | + | Alternate locations for the plugin and older version are available at: https:// |
- | Source code can be found on the [[http:// | + | :!: When you choose to use the local background rendering engine (option '' |
- | use the following command | + | |
- | < | + | |
- | svn co https:// | + | |
- | </ | + | |
- | === News & Updates === | ||
- | [[http://sourceforge.net/export/rss2_keepsake.php? | + | ==== Change Log ==== |
- | {{rss>http://sourceforge.net/export/rss2_keepsake.php? | + | |
+ | The [[https://github.com/mprins/dokuwiki-plugin-openlayersmap/commits/master|complete changelog is available]] on GitHub | ||
+ | |||
+ | |||
+ | {{rss>https://github.com/mprins/dokuwiki-plugin-openlayersmap/ | ||
- | == 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:// | ||
- | Version 1.0 brings the following changes: | ||
- | - Yahoo was removed; they are shutting down their maps api ([[http:// | ||
- | - switched to Google Maps v3 ([[http:// | ||
- | - Add support for ReST access of the Bing layers (bing road, bing sat, bing hybrid) and deprecated Virtual Earth (ve) [[https:// | ||
- | - 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' | ||
- | - :!: 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:// | ||
===== Configuration ===== | ===== Configuration ===== | ||
Currently the following options can/need to be configured (see conf/ | Currently the following options can/need to be configured (see conf/ | ||
- | * **olScriptUrl** (required) the URL for the Openlayers API (default: '/ | + | |
- | * **googleScriptUrl** (deprecated, | + | * **enableOSM** Enable the use of OpenStreetMap base layers |
- | * **veScriptUrl** (optional) the URL for the Virtual Earth Maps API (e.g. ' | + | * **enableStadia** Enable the use of Stadia Maps as basemap provider |
- | * **yahooScriptUrl** (optional) the URL for the Yahoo Maps API (e.g. ' | + | |
- | * **enableGoogle** Enable the use of Google | + | |
- | * **enableMapQuest** Enable the use of MapQuest as basemap provider | + | |
- | * **enableOSM** Enable the use of OpenStreetMap | + | |
* **enableBing** Enable the use of Bing as basemap provider | * **enableBing** Enable the use of Bing as basemap provider | ||
- | * **bingAPIKey** Bing requires an API key, get yours at https:// | + | * **bingAPIKey** Bing requires an API key, get yours at: https:// |
- | * **iconUrlOverload** URL for map icons when using static maps on a non-internet | + | * **tfAPIKey** Thunderforest (cyclemap, |
- | * **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 | + | * **iconUrlOverload** URL for map icons when using static maps on a non-public access |
+ | * **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/ | ||
+ | * **autoZoomMap** Enable auto zoom for the map, makes the map zoom to the extent of the POI and KML/GPX | ||
===== Icons ===== | ===== Icons ===== | ||
If you want to add (or change) to the available icons for display on the map you can drop them into the directory " | If you want to add (or change) to the available icons for display on the map you can drop them into the directory " | ||
Nice icons are available from: | Nice icons are available from: | ||
+ | * https:// | ||
+ | * https:// | ||
* http:// | * http:// | ||
- | * http:// | ||
* http:// | * http:// | ||
- | * http:// | ||
===== Demonstration ===== | ===== Demonstration ===== | ||
- | A small site with the plugin showing various samples is available on [[http:// | + | A small site with the plugin showing various samples is available on [[https:// |
The plugin is used on the following pages/ | The plugin is used on the following pages/ | ||
- | * http:// | + | * https:// |
- | * http:// | + | * https:// |
- | * http://www.westwijkinfo.nl/dokuwiki/ | + | * http://www.vegan-in-halle.de/wiki/ |
- | * http://www.hooidonksekanoclub.nl/dokuwiki/informatie/routebeschrijving | + | * [[https://www.heemkundekringblariacum.nl/p/beeldbank/map_overview_1920-1929]] \\ => Links to an OpenStreetMap page on the website of // |
- | * http://www.hotspot-muenchen.de/doku.php? | + | |
===== Syntax/ Usage ===== | ===== Syntax/ Usage ===== | ||
< | < | ||
- | <olmap id=" | + | <olmap id=" |
52.1, | 52.1, | ||
</ | </ | ||
</ | </ | ||
- | * 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) | + | |
- | * height | + | |
- | * zoom ? integer, | + | |
- | * controls | + | |
- | * toolbar ? values | + | * **lat** The latitude of map centre |
- | * statusbar ? values 1 | 0. default | + | * **lon** The longitude of map centre |
- | * poihoverstyle - values 1 | 0. default 1 (on). specifies POI feature select behaviour (hover or click) | + | |
- | | + | |
- | * lon ? values -180.0 - 180.0; longitude of map centre, negative values are west. (WGS84) | + | |
- | * baselyr | + | * **geojsonfile** any [[WP> |
- | * gpxfile | + | * **summary** A description of the map. |
- | * kmlfile | + | |
+ | If the values for latitude and longitude differ from the default values lat=" | ||
+ | The page is therefore added to the spatial index (and the KML and GeoRSS sitemaps) then. | ||
The Points of Interest are formatted: | The Points of Interest are formatted: | ||
- | < | + | < |
- | 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# | + | The map will zoom in to the extent of the POI which must be given in decimal degrees according to [[WP> |
- | ===== Known Limitations | + | ===== Overlays |
- | This is currently a work in progress; please check the [[http:// | + | ==== XYZ (tiled) ==== |
- | * there are some issues | + | To add a XYZ style (eg. OpenStreetMap tiling scheme) layer to a map use the following syntax: |
+ | < | ||
+ | |||
+ | Where '' | ||
+ | |||
+ | ==== WMS ==== | ||
+ | To add a WMS layer to a map use the following syntax: | ||
+ | < | ||
+ | |||
+ | Where '' | ||
+ | |||
+ | ==== ArcGIS REST ==== | ||
+ | To add an ArcGIS REST image layer to a map use the following syntax: | ||
+ | < | ||
+ | |||
+ | Where '' | ||
+ | |||
+ | ==== WTMS ==== | ||
+ | To add a WTMS layer to a map use the following syntax: | ||
+ | < | ||
+ | |||
+ | Where '' | ||
| | ||
- | ===== Discussion ===== | + | ===== Discussion |
- | > The Popup looks weird in my wiki, is this a bug or an error on my side? i' | + | > I' |
- | > keep up the good work | + | >> Google |
- | > -Jonas | + | |
- | >> | + | |
- | >> --- [[user> | + | |
- | >>> | + | |
- | >>>> | + | |
- | >>>>> | + | |
- | >>>>> | + | |
- | >>> | + | |
- | >>> | + | |
- | >>> | + | |
- | >>>> | + | |
- | Jason: I refreshed snapshot2 to work around the google maps popup. | ||
- | As for the other thing, I'm still looking at it, I have some observations though, it seems your website is not being rendererd as xhtml 4 (dokuwiki' | ||
- | Maybe you could try loading the typekit css before loading the dokuwiki css? I also see Less and Modernizr, they tend to modify css quite a bit as well. | ||
- | > This is caused by ''img { max-width: 100%; }'' | + | > I'm trying to disable " |
- | .olContainer img { | + | >> |
- | | + | |
- | } | + | |
- | </code> --- [[user>ach|Anika Henke]] // | + | |
- | > I like the looks of this plugin. | ||
- | > | ||
- | >Thanks for the plugin. | ||
- | >> [[user> | + | > Would it be possible to generate a map where the POI's are geotagged pages from a certain namespace in the wiki? |
+ | >> | ||
+ | |||
+ | |||
+ | > 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 http:// | ||
+ | >> 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& | ||
+ | >> this may be possible in the future | ||
+ | |||
+ | |||
+ | > I like the looks of this plugin. I am currently using google_maps and while it works fairly well, it is a bit lacking. | ||
+ | >> There are currently no specific | ||
>> < | >> < | ||
<olmap id=" | <olmap id=" | ||
Line 165: | Line 162: | ||
</ | </ | ||
</ | </ | ||
- | >>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. | + | >>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' | ||
+ | >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' | ||
>> this is unlikely to happen; see [[https:// | >> this is unlikely to happen; see [[https:// | ||
- | >> --- [[user> | ||
- | >< | ||
- | 51.8795, | ||
- | </ | ||
- | >With this Code I see no marker and " | ||
- | >> <del> I suspect this is the same issue as described in [[http:// | ||
- | >>> | + | 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 " |
+ | |||
+ | <code> | ||
+ | <olmap id=" | ||
+ | 49.9780098, | ||
+ | 50.0117497, | ||
+ | </olmap> | ||
+ | </ | ||
+ | |||
+ | The width will be calculated if '' | ||
+ | |||
+ | I've done my work only in the file '' | ||
+ | |||
+ | <code javascript> | ||
+ | Element.prototype.getElementWidth = function() { | ||
+ | if (typeof this.clip !== " | ||
+ | return this.clip.width; | ||
+ | } else { | ||
+ | if (this.style.pixelWidth) { | ||
+ | return this.style.pixelWidth; | ||
+ | } else { | ||
+ | return this.offsetWidth; | ||
+ | } | ||
+ | } | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | And then I've made the following extension to the method '' | ||
+ | |||
+ | <code javascript> | ||
+ | // find map element location | ||
+ | var cleartag = document.getElementById(mapOpts.id + ' | ||
+ | if (cleartag === null) { | ||
+ | return; | ||
+ | } | ||
+ | |||
+ | // ====== START OF INSERTED CODE ====== | ||
+ | |||
+ | // calculate dynamic width and height | ||
+ | var dynamicWidth = 0; | ||
+ | if (mapOpts.width == ' | ||
+ | var contentWidth = 0; | ||
+ | var asideWidth = 0; | ||
+ | var elementContent = document.getElementById(' | ||
+ | if (elementContent === null) { | ||
+ | } else { | ||
+ | contentWidth = elementContent.getElementWidth(); | ||
+ | } | ||
+ | var elementAside = document.getElementById(' | ||
+ | if (elementAside === null) { | ||
+ | } else { | ||
+ | asideWidth = elementAside.getElementWidth(); | ||
+ | } | ||
+ | if (contentWidth > asideWidth) { | ||
+ | dynamicWidth = contentWidth - asideWidth - 60; | ||
+ | } else { | ||
+ | dynamicWidth = contentWidth - 20; | ||
+ | } | ||
+ | if (dynamicWidth > 0) { | ||
+ | mapOpts.width = dynamicWidth + ' | ||
+ | } else { | ||
+ | mapOpts.width = ' | ||
+ | } | ||
+ | } | ||
+ | if (mapOpts.height == ' | ||
+ | if (dynamicWidth > 0) { | ||
+ | var dynamicHeight = dynamicWidth * 0.66; | ||
+ | mapOpts.height = dynamicHeight + ' | ||
+ | } else { | ||
+ | mapOpts.height = ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ====== END OF INSERTED CODE ====== | ||
+ | |||
+ | // create map element and add to document | ||
+ | var fragment = olCreateMaptag(mapOpts.id, | ||
+ | cleartag.parentNode.insertBefore(fragment, | ||
+ | </ | ||
+ | |||
+ | 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 | ||
+ | |||
+ | [[user> | ||
+ | >> @Werner this patch will give you problem as the width is also used for the fallback image and ' | ||
+ | |||
+ | >I just installed this wonderful plugin | ||
+ | >> 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've found the font size to be a little too small on the maps, you can easily change this by editing the script.js file, and changing the pixel size in the | ||
+ | <code javascript> | ||
+ | styleMap : new OpenLayers.StyleMap({ </ | ||
+ | \\ and change | ||
+ | <code javascript> | ||
+ | fontSize : " | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | Windows Defender reacts to the archive saying thereis an Trojan: | ||
+ | --- [[user> | ||
+ | |||
+ | ---- | ||
- | >>>> | + | Can it support getting points from sqlite database made with [[struct|struct Plugin]]? |
- | < | + | --- [[user> |
plugin/openlayersmap.1329438681.txt.gz · Last modified: by ach