refs #22 almost finished WMS support for user custom servers

merge-requests/2/head
Julien Veyssier 2017-06-13 16:46:37 +02:00
parent 8c76f7e3c3
commit 61d055d4bd
4 changed files with 115 additions and 85 deletions

View File

@ -872,26 +872,26 @@ div#ho button {
margin-top: 3px; margin-top: 3px;
margin-bottom: 3px; margin-bottom: 3px;
} }
#overlayserveradd, #tileserveradd, #tileserverwmsadd, #overlayserverwmsadd { #overlayserveradd, #tileserveradd, #tilewmsserveradd, #overlaywmsserveradd {
display: grid; display: grid;
grid-template-columns: 35% 65%; grid-template-columns: 35% 65%;
} }
#tileserveradd p, #tileserveradd p,
#tileserverwmsadd p, #tilewmsserveradd p,
#overlayserverwmsadd p, #overlaywmsserveradd p,
#overlayserveradd p{ #overlayserveradd p{
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
} }
#tileserveradd input[type=checkbox], #tileserveradd input[type=checkbox],
#tileserverwmsadd input[type=checkbox], #tilewmsserveradd input[type=checkbox],
#overlayserverwmsadd input[type=checkbox], #overlaywmsserveradd input[type=checkbox],
#overlayserveradd input[type=checkbox]{ #overlayserveradd input[type=checkbox]{
margin-right: auto; margin-right: auto;
} }
#tileserveradd input[type=text], #tileserveradd input[type=text],
#tileserverwmsadd input[type=text], #tilewmsserveradd input[type=text],
#overlayserverwmsadd input[type=text], #overlaywmsserveradd input[type=text],
#overlayserveradd input[type=text]{ #overlayserveradd input[type=text]{
width:100%; width:100%;
} }

View File

@ -237,23 +237,23 @@
// add custom layers // add custom layers
$('#tileserverlist li').each(function() { $('#tileserverlist li').each(function() {
var sname = $(this).attr('servername'); var sname = $(this).attr('servername');
var surl = $(this).attr('title'); var surl = $(this).attr('url');
var sminzoom = $(this).attr('minzoom') || '1'; var sminzoom = $(this).attr('minzoom') || '1';
var smaxzoom = $(this).attr('maxzoom') || '20'; var smaxzoom = $(this).attr('maxzoom') || '20';
var sattrib = $(this).attr('attribution') || ''; var sattrib = $(this).attr('attribution') || '';
baseLayers[sname] = new L.TileLayer(surl, baseLayers[sname] = new L.TileLayer(surl,
{minZoom: sminzoom, maxZoom: smaxzoom, attribution: sattrib}); {minZoom: sminzoom, maxZoom: smaxzoom, attribution: sattrib});
}); });
$('#tileserverwmslist li').each(function() { $('#tilewmsserverlist li').each(function() {
var sname = $(this).attr('servername'); var sname = $(this).attr('servername');
var surl = $(this).attr('title'); var surl = $(this).attr('url');
var sminzoom = $(this).attr('minzoom') || '1'; var sminzoom = $(this).attr('minzoom') || '1';
var smaxzoom = $(this).attr('maxzoom') || '20'; var smaxzoom = $(this).attr('maxzoom') || '20';
var slayers = $(this).attr('layers') || ''; var slayers = $(this).attr('layers') || '';
var sversion = $(this).attr('version') || '1.1.1'; var sversion = $(this).attr('version') || '1.1.1';
var sformat = $(this).attr('format') || 'image/png'; var sformat = $(this).attr('format') || 'image/png';
var sattrib = $(this).attr('attribution') || ''; var sattrib = $(this).attr('attribution') || '';
baseLayers[sname] = new L.tilelayer.wms(surl, baseLayers[sname] = new L.tileLayer.wms(surl,
{format: sformat, version: sversion, layers: slayers, minZoom: sminzoom, maxZoom: smaxzoom, attribution: sattrib}); {format: sformat, version: sversion, layers: slayers, minZoom: sminzoom, maxZoom: smaxzoom, attribution: sattrib});
}); });
gpxedit.baseLayers = baseLayers; gpxedit.baseLayers = baseLayers;
@ -309,7 +309,7 @@
// add custom overlays // add custom overlays
$('#overlayserverlist li').each(function() { $('#overlayserverlist li').each(function() {
var sname = $(this).attr('servername'); var sname = $(this).attr('servername');
var surl = $(this).attr('title'); var surl = $(this).attr('url');
var sminzoom = $(this).attr('minzoom') || '1'; var sminzoom = $(this).attr('minzoom') || '1';
var smaxzoom = $(this).attr('maxzoom') || '20'; var smaxzoom = $(this).attr('maxzoom') || '20';
var stransparent; var stransparent;
@ -330,9 +330,9 @@
baseOverlays[sname] = new L.TileLayer(surl, baseOverlays[sname] = new L.TileLayer(surl,
{minZoom: sminzoom, maxZoom: smaxzoom, transparent: stransparent, opcacity: sopacity, attribution: sattrib}); {minZoom: sminzoom, maxZoom: smaxzoom, transparent: stransparent, opcacity: sopacity, attribution: sattrib});
}); });
$('#overlayserverwmslist li').each(function() { $('#overlaywmsserverlist li').each(function() {
var sname = $(this).attr('servername'); var sname = $(this).attr('servername');
var surl = $(this).attr('title'); var surl = $(this).attr('url');
var sminzoom = $(this).attr('minzoom') || '1'; var sminzoom = $(this).attr('minzoom') || '1';
var smaxzoom = $(this).attr('maxzoom') || '20'; var smaxzoom = $(this).attr('maxzoom') || '20';
var slayers = $(this).attr('layers') || ''; var slayers = $(this).attr('layers') || '';
@ -461,25 +461,27 @@
// so, the content is lost when it's closed // so, the content is lost when it's closed
gpxedit.map.on('popupopen', function(e) { gpxedit.map.on('popupopen', function(e) {
var id = e.popup._source.gpxedit_id; var id = e.popup._source.gpxedit_id;
//var id = parseInt(e.popup.getContent().match(/layerid="(\d+)"/)[1]); if (id !== undefined && gpxedit.layersData.hasOwnProperty(id)) {
var buttonParent = $('button.popupOkButton[layerid=' + id + ']').parent(); //var id = parseInt(e.popup.getContent().match(/layerid="(\d+)"/)[1]);
buttonParent.find('input.layerName').val(gpxedit.layersData[id].name); var buttonParent = $('button.popupOkButton[layerid=' + id + ']').parent();
buttonParent.find('textarea.layerDesc').val(gpxedit.layersData[id].description); buttonParent.find('input.layerName').val(gpxedit.layersData[id].name);
buttonParent.find('textarea.layerCmt').val(gpxedit.layersData[id].comment); buttonParent.find('textarea.layerDesc').val(gpxedit.layersData[id].description);
if (gpxedit.layersData[id].layer.type === 'marker') { buttonParent.find('textarea.layerCmt').val(gpxedit.layersData[id].comment);
if (symbolIcons.hasOwnProperty(gpxedit.layersData[id].symbol)) { if (gpxedit.layersData[id].layer.type === 'marker') {
buttonParent.find('select[role=symbol]').val(gpxedit.layersData[id].symbol); if (symbolIcons.hasOwnProperty(gpxedit.layersData[id].symbol)) {
buttonParent.find('select[role=symbol]').val(gpxedit.layersData[id].symbol);
}
else if(gpxedit.layersData[id].symbol === '') {
buttonParent.find('select[role=symbol]').val('');
}
else{
buttonParent.find('select[role=symbol]').val('unknown');
}
buttonParent.find('select[role=symbol]').change();
var latlng = gpxedit.layersData[id].layer.getLatLng();
buttonParent.find('input.layerLat').val(latlng.lat.toFixed(6));
buttonParent.find('input.layerLon').val(latlng.lng.toFixed(6));
} }
else if(gpxedit.layersData[id].symbol === '') {
buttonParent.find('select[role=symbol]').val('');
}
else{
buttonParent.find('select[role=symbol]').val('unknown');
}
buttonParent.find('select[role=symbol]').change();
var latlng = gpxedit.layersData[id].layer.getLatLng();
buttonParent.find('input.layerLat').val(latlng.lat.toFixed(6));
buttonParent.find('input.layerLon').val(latlng.lng.toFixed(6));
} }
}); });
@ -1208,7 +1210,7 @@
var surl = $('#'+type+'serverurl').val(); var surl = $('#'+type+'serverurl').val();
var sminzoom = $('#'+type+'minzoom').val(); var sminzoom = $('#'+type+'minzoom').val();
var smaxzoom = $('#'+type+'maxzoom').val(); var smaxzoom = $('#'+type+'maxzoom').val();
var stransparent = $('#'+type+'transparent').val() || ''; var stransparent = $('#'+type+'transparent').is(':checked');
var sopacity = $('#'+type+'opacity').val() || ''; var sopacity = $('#'+type+'opacity').val() || '';
var sformat = $('#'+type+'format').val() || ''; var sformat = $('#'+type+'format').val() || '';
var sversion = $('#'+type+'version').val() || ''; var sversion = $('#'+type+'version').val() || '';
@ -1260,14 +1262,28 @@
if (type === 'tile') { if (type === 'tile') {
// add tile server in leaflet control // add tile server in leaflet control
var newlayer = new L.TileLayer(surl, var newlayer = new L.TileLayer(surl,
{maxZoom: 18, attribution: 'custom '+type+' server'}); {minZoom: sminzoom, maxZoom: smaxzoom, attribution: ''});
gpxedit.activeLayers.addBaseLayer(newlayer, sname); gpxedit.activeLayers.addBaseLayer(newlayer, sname);
gpxedit.baseLayers[sname] = newlayer; gpxedit.baseLayers[sname] = newlayer;
} }
else { else if (type === 'tilewms'){
// add tile server in leaflet control
var newlayer = new L.tileLayer.wms(surl,
{format: sformat, version: sversion, layers: slayers, minZoom: sminzoom, maxZoom: smaxzoom, attribution: ''});
gpxedit.activeLayers.addBaseLayer(newlayer, sname);
gpxedit.overlayLayers[sname] = newlayer;
}
if (type === 'overlay') {
// add tile server in leaflet control // add tile server in leaflet control
var newlayer = new L.TileLayer(surl, var newlayer = new L.TileLayer(surl,
{maxZoom: 18, attribution: 'custom '+type+' server'}); {minZoom: sminzoom, maxZoom: smaxzoom, transparent: stransparent, opcacity: sopacity, attribution: ''});
gpxedit.activeLayers.addOverlay(newlayer, sname);
gpxedit.baseLayers[sname] = newlayer;
}
else if (type === 'overlaywms'){
// add tile server in leaflet control
var newlayer = new L.tileLayer.wms(surl,
{layers: slayers, version: sversion, transparent: stransparent, opacity: sopacity, format: sformat, attribution: '', minZoom: sminzoom, maxZoom: smaxzoom});
gpxedit.activeLayers.addOverlay(newlayer, sname); gpxedit.activeLayers.addOverlay(newlayer, sname);
gpxedit.overlayLayers[sname] = newlayer; gpxedit.overlayLayers[sname] = newlayer;
} }
@ -1652,13 +1668,13 @@
addTileServer('overlay'); addTileServer('overlay');
}); });
$('body').on('click', '#tileserverwmslist button', function(e) { $('body').on('click', '#tilewmsserverlist button', function(e) {
deleteTileServer($(this).parent(), 'tilewms'); deleteTileServer($(this).parent(), 'tilewms');
}); });
$('#addtileserverwms').click(function() { $('#addtileserverwms').click(function() {
addTileServer('tilewms'); addTileServer('tilewms');
}); });
$('body').on('click', '#overlayserverwmslist button', function(e) { $('body').on('click', '#overlaywmsserverlist button', function(e) {
deleteTileServer($(this).parent(), 'overlaywms'); deleteTileServer($(this).parent(), 'overlaywms');
}); });
$('#addoverlayserverwms').click(function() { $('#addoverlayserverwms').click(function() {

View File

@ -28,12 +28,12 @@
"Use defined symbols instead of default symbol" : "Utilise les symboles définis au lieu du symbole par défaut", "Use defined symbols instead of default symbol" : "Utilise les symboles définis au lieu du symbole par défaut",
"Use defined symbols" : "Utiliser les symboles définis", "Use defined symbols" : "Utiliser les symboles définis",
"Custom tile servers" : "Serveurs de tuiles personnels", "Custom tile servers" : "Serveurs de tuiles personnels",
"Custom overlay servers" : "Serveurs de revêtements personnels", "Server name" : "Nom du serveur",
"Server name (for example 'my custom server')" : "Nom du serveur ('mon super serveur' par exemple)", "For example : my custom server" : "Par exemple : mon super serveur",
"Server url ('http://tile.server.org/cycle/{z}/{x}/{y}.png')" : "URL du serveur ('http://tile.server.org/cycle/{z}/{x}/{y}.png')", "Server url" : "URL du serveur",
"Server url ('http://overlay.server.org/cycle/{z}/{x}/{y}.png')" : "URL du serveur ('http://overlay.server.org/cycle/{z}/{x}/{y}.png')", "For example : http://tile.server.org/cycle/{z}/{x}/{y}.png" : "Par exemple : http://tile.server.org/cycle/{z}/{x}/{y}.png",
"For example : http://overlay.server.org/cycle/{z}/{x}/{y}.png" : "Par exemple : http://overlay.server.org/cycle/{z}/{x}/{y}.png",
"Add" : "Ajouter", "Add" : "Ajouter",
"Your servers" : "Vos serveurs",
"Delete" : "Supprimer", "Delete" : "Supprimer",
"Default symbol for waypoints when value is not set" : "Symbole par défaut pour les étapes si non défini", "Default symbol for waypoints when value is not set" : "Symbole par défaut pour les étapes si non défini",
"Clear map before loading" : "Vider la carte avant de charger", "Clear map before loading" : "Vider la carte avant de charger",
@ -54,6 +54,20 @@
"Accepted image format : png" : "Format d'image accepté : png", "Accepted image format : png" : "Format d'image accepté : png",
"New symbol name" : "Nom du nouveau symbole", "New symbol name" : "Nom du nouveau symbole",
"Approximate new points elevations" : "Approximer l'altitude des nouveaux points", "Approximate new points elevations" : "Approximer l'altitude des nouveaux points",
"Min zoom (1-20)" : "Zoom mini (1-20)",
"Opacity (0.0-1.0)" : "Opacité (0.0-1.0)",
"Format" : "Format",
"Custom overlay tile servers" : "Serveurs de revêtement personnels",
"Your tile servers" : "Vos serveurs de tuiles personnels",
"WMS version" : "Version de WMS",
"Your WMS tile servers" : "Vos serveurs de tuiles WMS personnels",
"Max zoom (1-20)" : "Zoom maxi (1-20)",
"Custom WMS overlay servers" : "Serveurs de revêtement WMS",
"Layers to display" : "Layers à afficher",
"Custom WMS tile servers" : "Serveurs de tuiles WMS personnels",
"Your overlay tile servers" : "Vos serveurs de revêtements personnels",
"Your WMS overlay tile servers" : "Vos serveurs de revêtements WMS personnels",
"Transparent" : "Transparent",
"Upload new symbol image" : "Téléverser une nouvelle image de symbole" "Upload new symbol image" : "Téléverser une nouvelle image de symbole"
},"pluralForm" :"nplurals=2; plural=(n > 1);" },"pluralForm" :"nplurals=2; plural=(n > 1);"
} }

View File

@ -121,10 +121,10 @@ echo '</ul>'."\n";
<hr/><br/> <hr/><br/>
<h3 class="sectiontitle"><?php p($l->t('Custom tile servers')); ?></h3> <h3 class="sectiontitle"><?php p($l->t('Custom tile servers')); ?></h3>
<div id="tileserveradd"> <div id="tileserveradd">
<p><?php p($l->t('Server name (for example \'my custom server\')')); ?> :</p> <p><?php p($l->t('Server name')); ?> :</p>
<input type="text" id="tileservername"/> <input type="text" id="tileservername" title="<?php p($l->t('For example : my custom server')); ?>"/>
<p><?php p($l->t('Server url (\'http://tile.server.org/cycle/{z}/{x}/{y}.png\')')); ?> :</p> <p><?php p($l->t('Server url')); ?> :</p>
<input type="text" id="tileserverurl"/> <input type="text" id="tileserverurl" title="<?php p($l->t('For example : http://tile.server.org/cycle/{z}/{x}/{y}.png')); ?>"/>
<p><?php p($l->t('Min zoom (1-20)')); ?> :</p> <p><?php p($l->t('Min zoom (1-20)')); ?> :</p>
<input type="text" id="tileminzoom" value="1"/> <input type="text" id="tileminzoom" value="1"/>
<p><?php p($l->t('Max zoom (1-20)')); ?> :</p> <p><?php p($l->t('Max zoom (1-20)')); ?> :</p>
@ -137,7 +137,7 @@ echo '</ul>'."\n";
<?php <?php
if (count($_['usertileservers']) > 0){ if (count($_['usertileservers']) > 0){
foreach($_['usertileservers'] as $ts){ foreach($_['usertileservers'] as $ts){
echo '<li'; echo '<li title="'.$ts['url'].'"';
foreach (Array('servername', 'type', 'url', 'layers', 'version', 'format', 'opacity', 'transparent', 'minzoom', 'maxzoom', 'attribution') as $field) { foreach (Array('servername', 'type', 'url', 'layers', 'version', 'format', 'opacity', 'transparent', 'minzoom', 'maxzoom', 'attribution') as $field) {
if (array_key_exists($field, $ts)) { if (array_key_exists($field, $ts)) {
echo ' '.$field.'="'; echo ' '.$field.'="';
@ -158,18 +158,18 @@ if (count($_['usertileservers']) > 0){
<hr/><br/> <hr/><br/>
<h3 class="sectiontitle"><?php p($l->t('Custom overlay tile servers')); ?></h3> <h3 class="sectiontitle"><?php p($l->t('Custom overlay tile servers')); ?></h3>
<div id="overlayserveradd"> <div id="overlayserveradd">
<p><?php p($l->t('Server name (for example \'my custom server\')')); ?> :</p> <p><?php p($l->t('Server name')); ?> :</p>
<input type="text" id="overlayservername"> <input type="text" id="overlayservername" title="<?php p($l->t('For example : my custom server')); ?>"/>
<p><?php p($l->t('Server url (\'http://overlay.server.org/cycle/{z}/{x}/{y}.png\')')); ?> :</p> <p><?php p($l->t('Server url')); ?> :</p>
<input type="text" id="overlayserverurl"> <input type="text" id="overlayserverurl" title="<?php p($l->t('For example : http://overlay.server.org/cycle/{z}/{x}/{y}.png')); ?>"/>
<p><?php p($l->t('Min zoom (1-20)')); ?> :</p> <p><?php p($l->t('Min zoom (1-20)')); ?> :</p>
<input type="text" id="overlayminzoom" value="1"> <input type="text" id="overlayminzoom" value="1"/>
<p><?php p($l->t('Max zoom (1-20)')); ?> :</p> <p><?php p($l->t('Max zoom (1-20)')); ?> :</p>
<input type="text" id="overlaymaxzoom" value="18"> <input type="text" id="overlaymaxzoom" value="18"/>
<label for="overlaytransparent"><?php p($l->t('Transparent')); ?> :</label> <label for="overlaytransparent"><?php p($l->t('Transparent')); ?> :</label>
<input type="checkbox" id="overlaytransparent" checked> <input type="checkbox" id="overlaytransparent" checked/>
<p><?php p($l->t('Opacity (0.0-1.1)')); ?> :</p> <p><?php p($l->t('Opacity (0.0-1.0)')); ?> :</p>
<input type="text" id="overlayopacity" value="0.4"> <input type="text" id="overlayopacity" value="0.4"/>
<button id="addoverlayserver"><i class="fa fa-plus-circle" aria-hidden="true" style="color:green;"></i> <?php p($l->t('Add')); ?></button> <button id="addoverlayserver"><i class="fa fa-plus-circle" aria-hidden="true" style="color:green;"></i> <?php p($l->t('Add')); ?></button>
</div> </div>
<div id="overlayserverlist"> <div id="overlayserverlist">
@ -178,7 +178,7 @@ if (count($_['usertileservers']) > 0){
<?php <?php
if (count($_['useroverlayservers']) > 0){ if (count($_['useroverlayservers']) > 0){
foreach($_['useroverlayservers'] as $ts){ foreach($_['useroverlayservers'] as $ts){
echo '<li'; echo '<li title="'.$ts['url'].'"';
foreach (Array('servername', 'type', 'url', 'layers', 'version', 'format', 'opacity', 'transparent', 'minzoom', 'maxzoom', 'attribution') as $field) { foreach (Array('servername', 'type', 'url', 'layers', 'version', 'format', 'opacity', 'transparent', 'minzoom', 'maxzoom', 'attribution') as $field) {
if (array_key_exists($field, $ts)) { if (array_key_exists($field, $ts)) {
echo ' '.$field.'="'; echo ' '.$field.'="';
@ -198,30 +198,30 @@ if (count($_['useroverlayservers']) > 0){
</div> </div>
<hr/><br/> <hr/><br/>
<h3 class="sectiontitle"><?php p($l->t('Custom WMS tile servers')); ?></h3> <h3 class="sectiontitle"><?php p($l->t('Custom WMS tile servers')); ?></h3>
<div id="tileserverwmsadd"> <div id="tilewmsserveradd">
<p><?php p($l->t('Server name (for example \'my custom server\')')); ?> :</p> <p><?php p($l->t('Server name')); ?> :</p>
<input type="text" id="tilewmsservername"> <input type="text" id="tilewmsservername" title="<?php p($l->t('For example : my custom server')); ?>"/>
<p><?php p($l->t('Server url (\'http://tile.server.org/cycle/{z}/{x}/{y}.png\')')); ?> :</p> <p><?php p($l->t('Server url')); ?> :</p>
<input type="text" id="tilewmsserverurl"> <input type="text" id="tilewmsserverurl" title="<?php p($l->t('For example : http://tile.server.org/cycle/{z}/{x}/{y}.png')); ?>"/>
<p><?php p($l->t('Min zoom (1-20)')); ?> :</p> <p><?php p($l->t('Min zoom (1-20)')); ?> :</p>
<input type="text" id="tilewmsminzoom" value="1"> <input type="text" id="tilewmsminzoom" value="1"/>
<p><?php p($l->t('Max zoom (1-20)')); ?> :</p> <p><?php p($l->t('Max zoom (1-20)')); ?> :</p>
<input type="text" id="tilewmsmaxzoom" value="18"> <input type="text" id="tilewmsmaxzoom" value="18"/>
<p><?php p($l->t('Format')); ?> :</p> <p><?php p($l->t('Format')); ?> :</p>
<input type="text" id="tilewmsformat" value="image/jpeg"> <input type="text" id="tilewmsformat" value="image/jpeg"/>
<p><?php p($l->t('WMS version')); ?> :</p> <p><?php p($l->t('WMS version')); ?> :</p>
<input type="text" id="tilewmsversion" value="1.1.1"> <input type="text" id="tilewmsversion" value="1.1.1"/>
<p><?php p($l->t('Layers to display')); ?> :</p> <p><?php p($l->t('Layers to display')); ?> :</p>
<input type="text" id="tilewmslayers" value=""> <input type="text" id="tilewmslayers" value=""/>
<button id="addtileserverwms"><i class="fa fa-plus-circle" aria-hidden="true" style="color:green;"></i> <?php p($l->t('Add')); ?></button> <button id="addtileserverwms"><i class="fa fa-plus-circle" aria-hidden="true" style="color:green;"></i> <?php p($l->t('Add')); ?></button>
</div> </div>
<div id="tileserverwmslist"> <div id="tilewmsserverlist">
<h3><?php p($l->t('Your WMS tile servers')); ?></h3> <h3><?php p($l->t('Your WMS tile servers')); ?></h3>
<ul class="disclist"> <ul class="disclist">
<?php <?php
if (count($_['usertileserverswms']) > 0){ if (count($_['usertileserverswms']) > 0){
foreach($_['usertileserverswms'] as $ts){ foreach($_['usertileserverswms'] as $ts){
echo '<li'; echo '<li title="'.$ts['url'].'"';
foreach (Array('servername', 'type', 'url', 'layers', 'version', 'format', 'opacity', 'transparent', 'minzoom', 'maxzoom', 'attribution') as $field) { foreach (Array('servername', 'type', 'url', 'layers', 'version', 'format', 'opacity', 'transparent', 'minzoom', 'maxzoom', 'attribution') as $field) {
if (array_key_exists($field, $ts)) { if (array_key_exists($field, $ts)) {
echo ' '.$field.'="'; echo ' '.$field.'="';
@ -241,34 +241,34 @@ if (count($_['usertileserverswms']) > 0){
</div> </div>
<hr/><br/> <hr/><br/>
<h3 class="sectiontitle"><?php p($l->t('Custom WMS overlay servers')); ?></h3> <h3 class="sectiontitle"><?php p($l->t('Custom WMS overlay servers')); ?></h3>
<div id="overlayserverwmsadd"> <div id="overlaywmsserveradd">
<p><?php p($l->t('Server name (for example \'my custom server\')')); ?> :</p> <p><?php p($l->t('Server name')); ?> :</p>
<input type="text" id="overlaywmsservername"> <input type="text" id="overlaywmsservername" title="<?php p($l->t('For example : my custom server')); ?>"/>
<p><?php p($l->t('Server url (\'http://overlay.server.org/cycle/{z}/{x}/{y}.png\')')); ?> :</p> <p><?php p($l->t('Server url')); ?> :</p>
<input type="text" id="overlaywmsserverurl"> <input type="text" id="overlaywmsserverurl" title="<?php p($l->t('For example : http://overlay.server.org/cycle/{z}/{x}/{y}.png')); ?>"/>
<p><?php p($l->t('Min zoom (1-20)')); ?> :</p> <p><?php p($l->t('Min zoom (1-20)')); ?> :</p>
<input type="text" id="overlaywmsminzoom" value="1"> <input type="text" id="overlaywmsminzoom" value="1"/>
<p><?php p($l->t('Max zoom (1-20)')); ?> :</p> <p><?php p($l->t('Max zoom (1-20)')); ?> :</p>
<input type="text" id="overlaywmsmaxzoom" value="18"> <input type="text" id="overlaywmsmaxzoom" value="18"/>
<label for="overlaywmstransparent"><?php p($l->t('Transparent')); ?> :</label> <label for="overlaywmstransparent"><?php p($l->t('Transparent')); ?> :</label>
<input type="checkbox" id="overlaywmstransparent" checked> <input type="checkbox" id="overlaywmstransparent" checked/>
<p><?php p($l->t('Opacity (0.0-1.1)')); ?> :</p> <p><?php p($l->t('Opacity (0.0-1.0)')); ?> :</p>
<input type="text" id="overlaywmsopacity" value="0.4"> <input type="text" id="overlaywmsopacity" value="0.4"/>
<p><?php p($l->t('Format')); ?> :</p> <p><?php p($l->t('Format')); ?> :</p>
<input type="text" id="overlaywmsformat" value="image/jpeg"> <input type="text" id="overlaywmsformat" value="image/jpeg"/>
<p><?php p($l->t('WMS version')); ?> :</p> <p><?php p($l->t('WMS version')); ?> :</p>
<input type="text" id="overlaywmsversion" value="1.1.1"> <input type="text" id="overlaywmsversion" value="1.1.1"/>
<p><?php p($l->t('Layers to display')); ?> :</p> <p><?php p($l->t('Layers to display')); ?> :</p>
<input type="text" id="overlaywmslayers" value=""> <input type="text" id="overlaywmslayers" value=""/>
<button id="addoverlayserverwms"><i class="fa fa-plus-circle" aria-hidden="true" style="color:green;"></i> <?php p($l->t('Add')); ?></button> <button id="addoverlayserverwms"><i class="fa fa-plus-circle" aria-hidden="true" style="color:green;"></i> <?php p($l->t('Add')); ?></button>
</div> </div>
<div id="overlayserverwmslist"> <div id="overlaywmsserverlist">
<h3><?php p($l->t('Your WMS overlay tile servers')); ?></h3> <h3><?php p($l->t('Your WMS overlay tile servers')); ?></h3>
<ul class="disclist"> <ul class="disclist">
<?php <?php
if (count($_['useroverlayserverswms']) > 0){ if (count($_['useroverlayserverswms']) > 0){
foreach($_['useroverlayserverswms'] as $ts){ foreach($_['useroverlayserverswms'] as $ts){
echo '<li'; echo '<li title="'.$ts['url'].'"';
foreach (Array('servername', 'type', 'url', 'layers', 'version', 'format', 'opacity', 'transparent', 'minzoom', 'maxzoom', 'attribution') as $field) { foreach (Array('servername', 'type', 'url', 'layers', 'version', 'format', 'opacity', 'transparent', 'minzoom', 'maxzoom', 'attribution') as $field) {
if (array_key_exists($field, $ts)) { if (array_key_exists($field, $ts)) {
echo ' '.$field.'="'; echo ' '.$field.'="';