Browse Source

improvements in legends

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

16
public/js/extras.js

@ -165,9 +165,10 @@ function getBathymetry() { @@ -165,9 +165,10 @@ function getBathymetry() {
legends['DPTH'] = L.control.Legend({
position: "bottomright",
title: 'Bathymetry',
symbolWidth: 150,
symbolHeight: 208,
collapsed: true,
collapsed: false,
legends: [{
type: "image",
label: ' ',
@ -282,7 +283,7 @@ function getHabitat(layerCode) { @@ -282,7 +283,7 @@ function getHabitat(layerCode) {
position: "bottomright",
symbolWidth: 400,
symbolHeight: 600,
collapsed: true,
collapsed: false,
title: 'Habitat Type',
legends: [{
type: "image",
@ -376,7 +377,7 @@ function getProduct(layer) { @@ -376,7 +377,7 @@ function getProduct(layer) {
position: "bottomright",
symbolWidth: 100,
symbolHeight: 200,
collapsed: true,
collapsed: false,
title: 'Probability of habitat presence',
legends: [{
type: "image",
@ -435,9 +436,9 @@ function initializeLayerTree() { @@ -435,9 +436,9 @@ function initializeLayerTree() {
}
function getWFD(layerName) {
function getWFD(layerName, layerTitle) {
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);
let l;
@ -445,12 +446,13 @@ function getWFD(layerName) { @@ -445,12 +446,13 @@ function getWFD(layerName) {
legends[layerName] = L.control.Legend({
position: "bottomright",
title: layerTitle,
symbolWidth: 90,
symbolHeight: 130,
collapsed: true,
collapsed: false,
legends: [{
type: "image",
label: ' ',
label: '',
url: lgndUrl
}]
}).addTo(mapL);

2
public/js/layers.js

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

9
public/js/treeview.js

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

Loading…
Cancel
Save