DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:openlayersmap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:openlayersmap [2021-04-24 13:42] mprinsplugin:openlayersmap [2024-04-08 15:51] (current) – version upped mprins
Line 6: Line 6:
 email      : mprins@users.sf.net email      : mprins@users.sf.net
 type       : syntax, action type       : syntax, action
-lastupdate : 2021-04-24 +lastupdate : 2024-04-08 
-compatible : Angua2012-10-13WeatherwaxBinky, Ponder Stibbons, Hrun, Detritus, 2016-06-26, 2017-02-19, Greebo,Hogfather+compatible : HogfatherIgorJack JackrumKaos
 depends    : geophp depends    : geophp
 conflicts  conflicts 
Line 16: Line 16:
 sourcerepo : https://github.com/mprins/dokuwiki-plugin-openlayersmap/ sourcerepo : https://github.com/mprins/dokuwiki-plugin-openlayersmap/
 bugtracker : https://github.com/mprins/dokuwiki-plugin-openlayersmap/issues/ bugtracker : https://github.com/mprins/dokuwiki-plugin-openlayersmap/issues/
 +donationurl: https://github.com/sponsors/mprins
 ---- ----
 +
 ===== Description ===== ===== Description =====
-A map rendering plugin that will put an [[https://openlayers.org/two/|OpenLayers 2]] based map on the wiki page. + 
 +A map rendering plugin that will put an [[https://openlayers.org/|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 ([[https://www.openstreetmap.org/|OSM]]).  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 ([[https://www.openstreetmap.org/|OSM]]). 
-It can also be configured to use non-open data (Google, Virtual Earth) providers.+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/uninstalling [[openlayersmapoverlays]]:
 +  * if you have used olmap_agslayer you need to change the url; remove the ''/export'' part. eg ''%%https://geoservices2.wallonie.be/arcgis/rest/services/APP_KAYAK/KAYAK/MapServer/export%%'' becomes ''%%https://geoservices2.wallonie.be/arcgis/rest/services/APP_KAYAK/KAYAK/MapServer%%''
 +  * if you have used olmap_osmlayer you need to remove the ''$'' from the url. eg. ''%%https://tiles.openseamap.org/seemark/${z}/${x}/${y}.png%%'' becomes ''%%https://tiles.openseamap.org/seemark/{z}/{x}/{y}.png%%''
  
 ===== Download and Installation ===== ===== Download and Installation =====
Line 30: Line 38:
 Alternate locations for the plugin and older version are available at: https://sourceforge.net/projects/dokuwikispatial/files/openlayersmap/ Alternate locations for the plugin and older version are available at: https://sourceforge.net/projects/dokuwikispatial/files/openlayersmap/
  
-:!: This plugin needs the server to have [[phpfn>book.image|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+:!: When you choose to use the local background rendering engine (option ''optionStaticMapGenerator'') this plugin needs the [[phpfn>book.image|PHP GD extension]]. In some environments this is not installed by default, but it's the package ''php8-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() ...''.
  
  
Line 46: Line 54:
  
   * **enableOSM** Enable the use of OpenStreetMap base layers as basemap provider   * **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) +  * **enableStadia** Enable the use of Stadia Maps as basemap provider
-  * **enableGoogle** Enable the use of Google as basemap provider (removed in current versions)+
   * **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://www.bingmapsportal.com/application   * **bingAPIKey** Bing requires an API key, get yours at: https://www.bingmapsportal.com/application
   * **tfAPIKey** Thunderforest (cyclemap,transport, landscape and outdoors) requires an API key, get yours at: https://www.bingmapsportal.com/application   * **tfAPIKey** Thunderforest (cyclemap,transport, landscape and outdoors) requires an API key, get yours at: https://www.bingmapsportal.com/application
-  * **mapquestAPIKey** MapQuest Static Maps API key, get yours at: http://developer.mapquest.com/ 
-  * **googleAPIkey** Google Static Maps API key, get yours at: https://code.google.com/apis/console  (removed in current versions) 
   * **iconUrlOverload** URL for map icons when using static maps on a non-public access host such as with [[install:dokuwiki_on_a_stick|DokuWiki on a Stick]] or [[https://sourceforge.net/projects/dokuwikispatial/files/DokuWiki%20portable/|DokuWikiStickNG]]   * **iconUrlOverload** URL for map icons when using static maps on a non-public access host such as with [[install:dokuwiki_on_a_stick|DokuWiki on a Stick]] or [[https://sourceforge.net/projects/dokuwikispatial/files/DokuWiki%20portable/|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   * **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.+  * **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 your webserver as well as the GD PHP extension.
   * **autoZoomMap** Enable auto zoom for the map, makes the map zoom to the extent of the POI and KML/GPX   * **autoZoomMap** Enable auto zoom for the map, makes the map zoom to the extent of the POI and KML/GPX
  
Line 61: Line 66:
 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/'' ((eg. http://dokuwikispatial.sourceforge.net/dokuwiki/lib/plugins/openlayersmap/icons/index.php)) 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/'' ((eg. http://dokuwikispatial.sourceforge.net/dokuwiki/lib/plugins/openlayersmap/icons/index.php))
 Nice icons are available from: Nice icons are available from:
-  * https://mapicons.mapsmarker.com +  * https://mapicons.mapsmarker.com/ 
-  * http://www.gpsdrive.de/development/map-icons/overview.en.shtml +  * https://labs.mapbox.com/maki-icons/
-  * http://mapbox.com/maki/+
   * http://www.sjjb.co.uk/mapicons/contactsheet/   * http://www.sjjb.co.uk/mapicons/contactsheet/
   * http://projects.opengeo.org/geosilk   * http://projects.opengeo.org/geosilk
  
 ===== Demonstration ===== ===== Demonstration =====
-A small site with the plugin showing various samples is available on [[http://dokuwikispatial.sourceforge.net/dokuwiki/doku.php|SourceForge]]+A small site with the plugin showing various samples is available on [[https://dokuwikispatial.sourceforge.io/dokuwiki/doku.php|SourceForge]]
  
 The plugin is used on the following pages/sites: The plugin is used on the following pages/sites:
-  * http://dokuwikispatial.sourceforge.net/dokuwiki/openlayersmap:start various live samples of the development version +  * https://dokuwikispatial.sourceforge.io/dokuwiki/openlayersmap:start various live samples of the development version 
-  * http://wild-water.nl/dokuwiki/beschrijvingen/belgie/helle (and many other pages)+  * https://wild-water.nl/dokuwiki/beschrijvingen/belgie/salm#kaart (and many other pages)
   * http://www.vegan-in-halle.de/wiki/doku.php?id=karte   * http://www.vegan-in-halle.de/wiki/doku.php?id=karte
 +  * [[https://www.heemkundekringblariacum.nl/p/beeldbank/map_overview_1920-1929]] \\ => Links to an OpenStreetMap page on the website of //Heemkundekring Blariacum//, an association for the preservation and digitalization of local history in the Netherlands. It shows several pointers with a page title and direct link to that page showing photo's of the 1920's at that location. Other periods can be found at [[https://www.heemkundekringblariacum.nl/p/beeldbank/geografisch_zoeken]].
  
 ===== Syntax/ Usage ===== ===== Syntax/ Usage =====
 <code> <code>
-<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">+<olmap id="olMap" width="600px" height="400px" lat="52.0" lon="5.1" zoom="12" controls="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 52.1,5.1,60,.8,marker-green.png,Just a spot
 </olmap> </olmap>
 </code> </code>
  
-  * **id** The identifyer of the map (this needs to be a valid [[http://www.w3.org/TR/CSS21/syndata.html#characters|CSS]]/[[http://www.w3.org/TR/html4/types.html#type-id|XHTML]] identifier as well as a [[http://mathiasbynens.be/notes/javascript-identifiers|valid JavaScript variable]]) eg. ''olmap''.+  * **id** The identifier of the map (this needs to be a valid [[http://www.w3.org/TR/CSS21/syndata.html#characters|CSS]]/[[http://www.w3.org/TR/html4/types.html#type-id|XHTML]] identifier as well as a [[http://mathiasbynens.be/notes/javascript-identifiers|valid JavaScript variable]]) eg. ''olmap'' and must be unique on the page.
   * **width** The width of the map, default is ''400px''.   * **width** The width of the map, default is ''400px''.
   * **height** The height of the map, default is ''300px''.   * **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.   * **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''.   * **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 ([[WP>WGS84]]), negative values are south of the equator, valid values range from ''-90.0'' to ''90.0''.   * **lat** The latitude of map centre in decimal degrees ([[WP>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 ([[WP>WGS84]]), negative values are west of Greenwich, valid values range from ''-180.0'' to ''180.0''.   * **lon** The longitude of map centre in decimal degrees ([[WP>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)+  * **baselyr** The basemap layer that is shown when the map opens. Valid values are: ''OSM'', ''transport'', ''landscape'', ''outdoors'', ''cycle map'', ''toner'', ''terrain'', ''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 [[WP>GPS_eXchange_Format|GPX]] file, use the media manager to retrieve the location   * **gpxfile** any [[WP>GPS_eXchange_Format|GPX]] file, use the media manager to retrieve the location
   * **kmlfile** any [[WP>KML]] file, use the media manager to retrieve the location   * **kmlfile** any [[WP>KML]] file, use the media manager to retrieve the location
Line 97: Line 100:
   * **summary** A description of the map.   * **summary** A description of the map.
  
 +If the values for latitude and longitude differ from the default values lat="50.0" lon="5.1" a Geotag is added to the metadata of the page.
 +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:
 <code>lat, lon, rotation-angle, opacity, image, textforpopup</code> <code>lat, lon, rotation-angle, opacity, image, textforpopup</code>
 The map will zoom in to the extent of the POI which must be given in decimal degrees according to [[WP>EPSG:4326]] (most GPS use this). The text for the popup can be formatted using regular DokuWiki [[:wiki:syntax|syntax]] and may contain links as well. (see [[openlayersmap#discussion]] below or the [[http://dokuwikispatial.sourceforge.net/dokuwiki/openlayersmap:start|sample website]] for more examples) The map will zoom in to the extent of the POI which must be given in decimal degrees according to [[WP>EPSG:4326]] (most GPS use this). The text for the popup can be formatted using regular DokuWiki [[:wiki:syntax|syntax]] and may contain links as well. (see [[openlayersmap#discussion]] below or the [[http://dokuwikispatial.sourceforge.net/dokuwiki/openlayersmap:start|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).+===== Overlays ===== 
 +==== XYZ (tiled) ==== 
 + 
 +To add a XYZ style (eg. OpenStreetMap tiling scheme) layer to a map use the following syntax:  
 +  <olmap_osmlayer id="olmap" name="piste" url="https://tiles.openpistemap.org/nocontours/{z}/{x}/{y}.png" visible="true" attribution="OpenPisteMap" baselayer="true"></olmap_osmlayer> 
 + 
 +Where ''id'' is the id of the openlayersmap, ''name'' is the name of this map layer, ''url'' is the XYZ layer url, ''visible'' defines whether the layer is visible when the layer is added to the map, ''attribution'' is displayed in the attribution area of the map frame and ''baselayer'' can be set to ''true'' to add the layer as a base map. You can find some providers at: [[https://wiki.openstreetmap.org/wiki/Raster_tile_providers|Raster tile providers]] 
 + 
 +==== WMS ==== 
 +To add a WMS layer to a map use the following syntax: 
 +  <olmap_wmslayer id="olmap" name="rain" url="http://openweathermap.org/t/tile.cgi?SERVICE=WMS" attribution="OpenWeatherMap" visible="true" layers="GLBETA_PR" baselayer="false"></olmap_wmslayer> 
 + 
 +Where ''id'' is the id of the openlayersmap, ''name'' is the name of this map layer, ''url'' is the WMS layer url, ''layers'' are the layers from the map service that you want displayed, ''visible'' defines whether the layer is visible when the layer is added to the map, ''attribution'' is displayed in the attribution area of the map frame and ''baselayer'' can be set to ''true'' to add the layer as a base map. 
 + 
 +==== ArcGIS REST ==== 
 +To add an ArcGIS REST image layer to a map use the following syntax: 
 +  <olmap_agslayer id="olmap" name="Paddle todat" url="https://geoservices2.wallonie.be/arcgis/rest/services/APP_KAYAK/KAYAK/MapServer" attribution="kayak.environnement.wallonie.be" visible="true" layers="show:0,1,2,3,4,7" baselayer="false"></olmap_agslayer> 
 + 
 +Where ''id'' is the id of the openlayersmap, ''name'' is the name of this map layer, ''url'' is the WMS layer url, ''layers'' are the layers from the map service that you want displayed, ''visible'' defines whether the layer is visible when the layer is added to the map, ''attribution'' is displayed in the attribution area of the map frame and ''baselayer'' can be set to ''true'' to add the layer as a base map. 
 + 
 +==== WTMS ==== 
 +To add a WTMS layer to a map use the following syntax: 
 +  <olmap_wmtslayer id="olmap" name="geolandbasemap" url="https://mapsneu.wien.gv.at/basemapneu/1.0.0/WMTSCapabilities.xml" attribution="basemap.at" visible="true" layer="geolandbasemap" matrixSet=google3857 baselayer="true"></olmap_wmtslayer> 
 + 
 +Where ''id'' is the id of the openlayersmap, ''name'' is the name of this map layer, ''url'' is the WMTS capabilities url, ''layer'' is the layer from the map service that you want displayed, ''visible'' defines whether the layer is visible when the layer is added to the map, ''attribution'' is displayed in the attribution area of the map frame and ''baselayer'' can be set to ''true'' to add the layer as a base map.
      
-===== Discussion ===== +===== Discussion & FAQ ===== 
-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 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? 
 +>> Google maps will not be supported, due to licencing requirements 
  
-> Hi!. 
 > 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? > 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 >> 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? > 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 [[plugin:spatialhelper]]+>> this will be available as part of [[plugin:spatialhelper]] which produces a KML file that can be loaded 
 + 
 > 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://dynmap.ruslotro.com/. > 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://dynmap.ruslotro.com/.
 >> no this is not possible >> 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 > 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 >> 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. 
  
->> [[user>mprins|Mark]] you're welcome :-)there are currently no provisions to parse wiki text or URLs (link tags works e.g. <code>[[http://test.com|test]]</code> you probably want to set poihoverstyle="0"). see sample below, it does links, line breaks an formatting. +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. 
 +>> There are currently no specific provisions to parse wiki text or URLs (link tags works e.g. <code>[[http://test.com|test]]</code> you probably want to set poihoverstyle="0"). see sample below, it does links, line breaks an formatting. 
 >> <code> >> <code>
 <olmap id="olmap" width="600px" height="400px" lat="50.0" lon="5.1" zoom="8" statusbar="1" toolbar="1" controls="1" poihoverstyle="0"> <olmap id="olmap" width="600px" height="400px" lat="50.0" lon="5.1" zoom="8" statusbar="1" toolbar="1" controls="1" poihoverstyle="0">
Line 131: Line 162:
 </olmap> </olmap>
 </code> </code>
->>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't be too complex ? This would make for a powerful way of displaying multiple real-time coordinates. >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.  >> this is unlikely to happen; see [[https://sourceforge.net/tracker/?func=detail&aid=2928736&group_id=239475&atid=1110189]] why. 
->> --- [[user>mprins|Mark]] 
- 
-<del>==== problem with Binky ==== 
- 
-i've make dokuwiki-update to rc2013-10-28 "Binky". now my map looks strange: http://vegan-in-halle.de/wiki/doku.php?id=karte :-( do exist a nightly-build which works with "Binky"? --Kristjan</del> 
- 
-> 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 [[:devel:jqueryfaq?s[]=addinitevent]] 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 
  
  
Line 235: Line 257:
  
 [[user>wkaurzinek|Werner]] [[user>wkaurzinek|Werner]]
-> @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+>> @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? +>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+>> 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. +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 +>> 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. --- [[user>Wirbel78|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. +
-<code> +
-Warning: Division by zero in .../lib/plugins/openlayersmap/StaticMap.php on line 639 +
-</code> +
- +
-<code> +
-<olmap lat="52.0" lon="5.1" ...> +
-52.0,5.1 ... +
-</olmap> +
-</code> +
-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. +
- +
------ +
- +
-Hi, +
- +
-I'm getting this error message when trying to install/update the plugin: +
- +
-''Impossible de télécharger le fichier : http://netcologne.dl.sourceforge.net/project/dokuwikispatial/openlayersmap/openlayersmap.zip'' +
- +
- --- [[user>Zbf|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, +
- --- [[user>sorinsfirlogea|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 ?!? +
- +
-[[user>wkaurzinek|Werner]] //2020-06-29 20:25// +
- +
- +
------ +
-After installing the plugin (in Hogfather, DokuwikiStick), when I open a map, I get multiple PHP warnings about address parsing of the OL-tiles and one warningon header information: +
- +
-Warning: file_get_contents(http://tile.openstreetmap.org/12/2108/1391.png): failed to open stream: Failed to parse address ":" in D:\DokuWikiStick\dokuwiki\lib\plugins\openlayersmap\StaticMap.php on line 426 +
- +
-Warning: Cannot modify header information - headers already sent by (output started at D:\DokuWikiStick\dokuwiki\lib\plugins\openlayersmap\StaticMap.php:426) in D:\DokuWikiStick\dokuwiki\inc\actions.php on line 38 +
- +
-Those were clean installs, so I have no idea what could have gone wrong. +
- --- [[user>Wernazuma|wernazuma]] //2020-12-23 15:30// +
- +
------ +
-Like [[user>wkaurzinek|Werner]] I found I //had// to install the [[https://www.dokuwiki.org/plugin:geophp?s[]=geophp|geophp]] plugin, unfortunately the link from the plugin page no longer resolves. To work around this I downloaded the source [[https://geophp.net/|geophp]] from the project page and extracted it to ''lib/plugins/geophp/geoPHP/'' setting ownership appropriately. +
- +
-This allowed some of my maps to render but some didn't throwing an error about a division by zero. +
- +
-<code> +
-2021/04/10 10:05:57 [error] 44968#44968: *78690 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined array key "base" in /srv/http/sheffieldboulder/inc/ +
-xtension/PluginController.php on line 107PHP message: PHP Fatal error:  Uncaught DivisionByZeroError: Division by zero in /srv/http/sheffieldboulder/lib/plugins/ +
-penlayersmap/StaticMap.php:671                                                                                                                                    +
-Stack trace:                                                                                                                                                      +
-#0 /srv/http/sheffieldboulder/lib/plugins/openlayersmap/StaticMap.php(694): StaticMap->autoZoom()                                                                 +
-#1 /srv/http/sheffieldboulder/lib/plugins/openlayersmap/helper/staticmap.php(103): StaticMap->getMap()                                                            +
-#2 /srv/http/sheffieldboulder/lib/plugins/openlayersmap/syntax/olmap.php(684): helper_plugin_openlayersmap_staticmap->getMap()                                    +
-#3 /srv/http/sheffieldboulder/lib/plugins/openlayersmap/syntax/olmap.php(144): syntax_plugin_openlayersmap_olmap->_getStaticOSM()                                 +
-#4 /srv/http/sheffieldboulder/inc/parser/handler.php(279): syntax_plugin_openlayersmap_olmap->handle()                                                            +
-#5 /srv/http/sheffieldboulder/inc/Parsing/Lexer/Lexer.php(270): Doku_Handler->plugin()                                                                            +
-#6 /srv/http/sheffieldboulder/inc/Parsing/Lexer/Lexer.php(197): dokuwiki\Parsing\Lexer\Lexer->invokeHandler()                                                     +
-#7 /srv/http/sheffieldboulder/inc/Parsing/Lexer/Lexer.php(147): dokuwiki\Parsing\Lexer\Le" while reading response header from upstream, client: 13.66.139.29, server: sheffieldboulder.uk, request: "GET /doku.php?id=osgathorpe:osgathorpe HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "sheffieldbouldr.uk"                                                                                                                                                             +
-</code> +
- +
-This only occurred on maps with a single ''geom'' marker and as the above error message shows its a ''division by zero'' on line ''671'' of ''openlayersmap/StaticMap.php'' Looking at the code there is on lines ''657-660'' a clause that exits the ''autoZoom()'' function early if there is one or less geoms.  I don't think this is being entered as the rest of the function is being executed on these maps.  This means that the ''miny'' and ''maxy'' are the same, resulting in ''$vy0'' and ''$vy1'' being the same value and when these are subtracted the differnce is ''0'' and in turn so is denominator in the calculation on line 671 (which tallys with the reported error). +
- +
-If I drop a second independant point/geom on the map this problem doesn't occur. +
- +
-A bit of digging showed that this is because with a single geom listed in the OpenLayersMap entry such as... +
- +
-<code> +
-<olmap id="olMapOne" width="900px" height="500px" lat="53.357647" lon="-1.454227 +
-9" zoom="18" statusbar="1" toolbar="1" controls="1" poihoverstyle="0" baselyr="+
-penStreetMap" gpxfile="" kmlfile=""> +
-~~ More examples: http://dokuwiki.org/plugin:openlayersmap +
-53.357647,-1.4542279,0,0.8,peak.png,Lichfield Road Boulder, Newfield Green \\ in +
-ternal link:[[::lichfield:lichfield|Lichfield Road Boulder, Newfield Green]] +
-</olmap> +
-</code> +
- +
-...the value of '' count ( $geoms )'' is ''2'' rather than ''1'' A simple workaround is to change the clause so that ''autoZoom()'' exits early... +
- +
-<code php> +
-               if (count ( $geoms ) <= 2) {        +
-                        dbglog($geoms,"StaticMap::autoZoom: Skip setting autozoom options"); +
-                        return; +
-                } +
-</code>+
  
-I've reported the issue on SourceForge (see [[https://sourceforge.net/p/dokuwikispatial/issues/73/|here]]) and on review see its the same error as reported in 2017 in this Discussion. 
  
- --- [[user>slackline|slackline]] //2021-04-10 10:08//+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> var markers = new OpenLayers.Layer.Vector("POI",
 +            styleMap : new OpenLayers.StyleMap({ </code> section 
 +\\ and change   
 +<code javascript>fontFamily "monospace", 
 +                    fontSize : "16px", </code> to anything you like
plugin/openlayersmap.1619264557.txt.gz · Last modified: 2021-04-24 13:42 by mprins

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki