diff --git a/controller/tileservers.php b/controller/tileservers.php index 8a2c19a..9b31997 100644 --- a/controller/tileservers.php +++ b/controller/tileservers.php @@ -9,6 +9,17 @@ $baseTileServers = [ // 'minzoom' => '', // 'maxzoom' => '' //), + //Array( + // 'name' => 'tilewms', + // 'type' => 'tilewms|overlaywms', + // 'url' => '', + // 'layers' => '', + // 'version' => '', + // 'attribution' => '', + // 'format' => '', + // 'opacity' => '0-1', + // 'transparent' => 'true|false' + //), Array( 'name' => 'OpenStreetMap', 'type' => 'tile', diff --git a/js/gpxedit.js b/js/gpxedit.js index 5145acf..79b8b04 100644 --- a/js/gpxedit.js +++ b/js/gpxedit.js @@ -209,6 +209,17 @@ var sattrib = $(this).attr('attribution'); baseLayers[sname] = new L.TileLayer(surl, {minZoom: minz, maxZoom: maxz, attribution: sattrib}); }); + $('#basetileservers li[type=tilewms]').each(function() { + var sname = $(this).attr('name'); + var surl = $(this).attr('url'); + var slayers = $(this).attr('layers') || ''; + var sversion = $(this).attr('version') || '1.1.1'; + var stransparent = ($(this).attr('transparent') === 'true'); + var sformat = $(this).attr('format') || 'image/png'; + var sopacity = $(this).attr('opacity') || 1; + var sattrib = $(this).attr('attribution') || ''; + baseLayers[sname] = new L.tileLayer.wms(surl, {layers: slayers, version: sversion, transparent: stransparent, opacity: sopacity, format: sformat, attribution: sattrib}); + }); // add custom layers $('#tileserverlist li').each(function() { var sname = $(this).attr('name'); @@ -229,6 +240,17 @@ var sattrib = $(this).attr('attribution'); baseOverlays[sname] = new L.TileLayer(surl, {minZoom: minz, maxZoom: maxz, attribution: sattrib}); }); + $('#basetileservers li[type=overlaywms]').each(function() { + var sname = $(this).attr('name'); + var surl = $(this).attr('url'); + var slayers = $(this).attr('layers') || ''; + var sversion = $(this).attr('version') || '1.1.1'; + var stransparent = ($(this).attr('transparent') === 'true'); + var sformat = $(this).attr('format') || 'image/png'; + var sopacity = $(this).attr('opacity') || 1; + var sattrib = $(this).attr('attribution') || ''; + baseOverlays[sname] = new L.tileLayer.wms(surl, {layers: slayers, version: sversion, transparent: stransparent, opacity: sopacity, format: sformat, attribution: sattrib}); + }); // add custom overlays $('#overlayserverlist li').each(function() { var sname = $(this).attr('name'); diff --git a/templates/gpxcontent.php b/templates/gpxcontent.php index 7fa7b2b..575f9b7 100644 --- a/templates/gpxcontent.php +++ b/templates/gpxcontent.php @@ -87,6 +87,16 @@ foreach($_['basetileservers'] as $ts){ p($ts['type']); echo '" url="'; p($ts['url']); + echo '" layers="'; + p($ts['layers']); + echo '" version="'; + p($ts['version']); + echo '" format="'; + p($ts['format']); + echo '" opacity="'; + p($ts['opacity']); + echo '" transparent="'; + p($ts['transparent']); echo '" minzoom="'; p($ts['minzoom']); echo '" maxzoom="';