Skip to content

Commit

Permalink
Add OpenTopoMap as an available baselayer
Browse files Browse the repository at this point in the history
close #23
  • Loading branch information
mprins committed Aug 15, 2022
1 parent 5beb66e commit 976e50f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions StaticMap.php
Expand Up @@ -47,6 +47,12 @@ class StaticMap {
'logo' => 'osm_logo.png',
'url' => 'https://tile.openstreetmap.org/{Z}/{X}/{Y}.png'
),
// OpenTopoMap sources
'opentopomap' => array(
'txt' => '(c) OpenStreetMap data/ODbl, SRTM | style: (c) OpenTopoMap',
'logo' => 'osm_logo.png',
'url' => 'https:/tile.opentopomap.org/{Z}/{X}/{Y}.png'
),
// OCM sources
'cycle' => array(
'txt' => '(c) Thunderforest maps',
Expand Down
2 changes: 1 addition & 1 deletion plugin.info.txt
@@ -1,7 +1,7 @@
base openlayersmap
author Mark C. Prins
email mprins@users.sf.net
date 2022-07-19
date 2022-08-20
name OpenLayers map plugin for DokuWiki
desc Provides a syntax for rendering an OpenLayers based map in a wiki page. Uses OpenLayers 6.14.1
url https://www.dokuwiki.org/plugin:openlayersmap
14 changes: 14 additions & 0 deletions script.js
Expand Up @@ -119,6 +119,20 @@ function createMap(mapOpts, poi) {
source: new ol.source.OSM()
}));

baseLyrGroup.getLayers().push(
new ol.layer.Tile({
visible: mapOpts.baselyr === "opentopomap",
title: 'opentopomap',
type: 'base',
source: new ol.source.OSM({
url: 'https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png',
attributions: 'Data &copy;ODbL <a href="https://openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>, '
+ '<a href="http://viewfinderpanoramas.org" target="_blank">SRTM</a>, '
+ 'style &copy;<a href="https://opentopomap.org/" target="_blank">OpenTopoMap</a>'
+ '(<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
})
}));

baseLyrGroup.getLayers().push(
new ol.layer.Tile({
visible: mapOpts.baselyr === "cycle map",
Expand Down

0 comments on commit 976e50f

Please sign in to comment.