refs #22 support of normal and overlay WMS tile servers in tileservers.php

merge-requests/2/head
Julien Veyssier 2017-06-12 18:28:34 +02:00
parent 0698a7faf2
commit 17effd1d77
3 changed files with 43 additions and 0 deletions

View File

@ -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',

View File

@ -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');

View File

@ -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="';