Browse Source

improvements

master
o.moresis 2 years ago
parent
commit
41dc83be4c
  1. 17
      public/js/extras.js
  2. 2
      src/Data/descriptors.php

17
public/js/extras.js

@ -355,28 +355,29 @@ function initializeLayerTree() {
function getWFD(layer) { function getWFD(layer) {
var wmsGroup = L.layerGroup(); var wmsGroup = L.layerGroup();
const layerName = layer.code; const layerCode = layer.code;
const layerTitle = layer.title; const layerTitle = layer.name;
const legendName = layerName.split('_').slice(1,3).join('_'); const legendName = layerCode.split('_').slice(1,3).join('_');
const lgndUrl = BASE_URL + "/img/legends/" + legendName + ".png"; const lgndUrl = BASE_URL + "/img/legends/" + legendName + ".png";
let l; let l;
console.debug('layer: : : ', layer);
l = L.tileLayer.wms(BASE_URL + '/geoserver/wms', { transparent: true, layers: layerName + layer.minSuffix, format: 'image/png'}); l = L.tileLayer.wms(BASE_URL + '/geoserver/wms', { transparent: true, layers: layerCode + layer.minSuffix, format: 'image/png'});
wmsGroup.addLayer(l); wmsGroup.addLayer(l);
layerControls[layerName] = L.control.slider(value => { layerControls[layerCode] = L.control.slider(value => {
wmsGroup.removeLayer(l); wmsGroup.removeLayer(l);
l = L.tileLayer.wms(BASE_URL + '/geoserver/wms', { transparent: true, layers: layerName + value, format: 'image/png'}); l = L.tileLayer.wms(BASE_URL + '/geoserver/wms', { transparent: true, layers: layerCode + value, format: 'image/png'});
wmsGroup.addLayer(l); wmsGroup.addLayer(l);
},{ },{
min: layer.minSuffix, min: layer.minSuffix,
max: layer.maxSuffix, max: layer.maxSuffix,
step: 1, step: 1,
value: layer.minSuffix, value: layer.minSuffix,
logo: 'Year Selector', logo: 'Year Selector ' + layerTitle,
}).addTo(mapL); }).addTo(mapL);
legends[layerName] = L.control.Legend({ legends[layerCode] = L.control.Legend({
position: "bottomright", position: "bottomright",
title: layerTitle, title: layerTitle,
symbolWidth: 90, symbolWidth: 90,

2
src/Data/descriptors.php

@ -34,6 +34,8 @@ if (!empty($cellcode)) {
JOIN criterias c on cps.criteria_id = c.id JOIN criterias c on cps.criteria_id = c.id
JOIN descriptors d on c.parent_id = d.id JOIN descriptors d on c.parent_id = d.id
WHERE station_reference_id = {$entity_id}"; WHERE station_reference_id = {$entity_id}";
echo $query;
exit();
} }
} }

Loading…
Cancel
Save