Browse Source

improvements in legends

master
o.moresis 2 years ago
parent
commit
d3226e8ccb
  1. 14
      public/js/extras.js
  2. 2
      public/js/layers.js
  3. 9
      public/js/treeview.js

14
public/js/extras.js

@ -165,9 +165,10 @@ function getBathymetry() {
legends['DPTH'] = L.control.Legend({ legends['DPTH'] = L.control.Legend({
position: "bottomright", position: "bottomright",
title: 'Bathymetry',
symbolWidth: 150, symbolWidth: 150,
symbolHeight: 208, symbolHeight: 208,
collapsed: true, collapsed: false,
legends: [{ legends: [{
type: "image", type: "image",
label: ' ', label: ' ',
@ -282,7 +283,7 @@ function getHabitat(layerCode) {
position: "bottomright", position: "bottomright",
symbolWidth: 400, symbolWidth: 400,
symbolHeight: 600, symbolHeight: 600,
collapsed: true, collapsed: false,
title: 'Habitat Type', title: 'Habitat Type',
legends: [{ legends: [{
type: "image", type: "image",
@ -376,7 +377,7 @@ function getProduct(layer) {
position: "bottomright", position: "bottomright",
symbolWidth: 100, symbolWidth: 100,
symbolHeight: 200, symbolHeight: 200,
collapsed: true, collapsed: false,
title: 'Probability of habitat presence', title: 'Probability of habitat presence',
legends: [{ legends: [{
type: "image", type: "image",
@ -435,9 +436,9 @@ function initializeLayerTree() {
} }
function getWFD(layerName) { function getWFD(layerName, layerTitle) {
const legendName = layerName.split('_').slice(1,3).join('_'); const legendName = layerName.split('_').slice(1,3).join('_');
const lgndUrl = BASE_URL + "/images/legends/" + legendName + ".png"; const lgndUrl = BASE_URL + "/img/legends/" + legendName + ".png";
console.debug(lgndUrl); console.debug(lgndUrl);
let l; let l;
@ -445,9 +446,10 @@ function getWFD(layerName) {
legends[layerName] = L.control.Legend({ legends[layerName] = L.control.Legend({
position: "bottomright", position: "bottomright",
title: layerTitle,
symbolWidth: 90, symbolWidth: 90,
symbolHeight: 130, symbolHeight: 130,
collapsed: true, collapsed: false,
legends: [{ legends: [{
type: "image", type: "image",
label: '', label: '',

2
public/js/layers.js

@ -487,7 +487,7 @@ async function layerTreeSwitch(node) {
} else if (intId === 'PHPL') { } else if (intId === 'PHPL') {
l = getWMSSeries(node.checkStatus); l = getWMSSeries(node.checkStatus);
} else if (intId.substr(0,3) === 'wfd') { } else if (intId.substr(0,3) === 'wfd') {
l = getWFD(intId); l = getWFD(intId, node.title);
} else if (layer.format === 'image') { } else if (layer.format === 'image') {
l = L.tileLayer.betterWms(BASE_URL + '/geoserver/wms', { layers: intId, transparent: true, format: "image/png"}); l = L.tileLayer.betterWms(BASE_URL + '/geoserver/wms', { layers: intId, transparent: true, format: "image/png"});
} else { } else {

9
public/js/treeview.js

@ -28,7 +28,7 @@ let citation = [{
//context button click event //context button click event
onClick : async (node) => { onClick : async (node) => {
//console.log('add - '+node.id); //console.log('add - '+node.id);
window.open(URL, '_blank'); window.open(node.data.n_citation, '_blank');
} }
}]; }];
@ -332,11 +332,12 @@ const myData = [{
n_hyperlink: "http://gis.ices.dk/geonetwork/srv/eng/catalog.search#/metadata/a93cffc8-8f45-47a4-a9bd-c8ffd9ad53fb" n_hyperlink: "http://gis.ices.dk/geonetwork/srv/eng/catalog.search#/metadata/a93cffc8-8f45-47a4-a9bd-c8ffd9ad53fb"
},{ },{
n_id: 327 , n_id: 327 ,
n_title: 'Seagrass Meadows (<a target="_blank" class="is-link has-text-link" href="https://doi.org/10.1515/bot-2022-0011">citation</a>)', n_title: 'Seagrass Meadows',
code: 'greek_seagrass_meadows_v0906_espg3035', code: 'greek_seagrass_meadows_v0906_espg3035',
n_parentid: 32, n_parentid: 32,
n_elements: nodeContext.concat(nodeContextLink), n_elements: nodeContext.concat(nodeContextLink, citation),
n_hyperlink: "https://www.seanoe.org/data/00765/87740/" n_hyperlink: "https://www.seanoe.org/data/00765/87740/",
n_citation: "https://doi.org/10.1515/bot-2022-0011"
},{ },{
n_id: 331, n_id: 331,
n_title: 'Integrated Ecological Status', n_title: 'Integrated Ecological Status',

Loading…
Cancel
Save