Skip to content

Commit

Permalink
Argenmap v1.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalitoar committed Mar 31, 2023
2 parents 08c1f83 + 99269c4 commit 96a7710
Show file tree
Hide file tree
Showing 31 changed files with 911 additions and 949 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@
</nav>
<div class="container-fluid">
<div class="row">
<nav id="sidebar-container" class="col-xs-12 col-12 col-sm-3 col-md-2 collapse sidebar _panel-group"
<nav id="sidebar-container" class="col-xs-12 col-12 col-sm-3 col-md-3 collapse sidebar _panel-group"
aria-expanded="false">
<div class="loading"><img alt="loading..." src="src/styles/images/loading.svg"></div>
<div id="sidebar" class="nav nav-sidebar panel panel-default"></div>
</nav>
<div class="map-container">
<div id="mapa" class="col-xs-12 col-12 col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"></div>
<div id="mapa" class="col-xs-12 col-12 col-sm-9 col-sm-offset-3 col-md-9 col-md-offset-3 main"></div>
</div>
</div>
</div>
Expand Down
19 changes: 18 additions & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const impresorItemCapaBase = new ImpresorItemCapaBaseHTML(),
setLogin(app.login.isActive);
}

if (app.hasOwnProperty("mainPopup")) {
setMainPopup(app.mainPopup.isActive);
}

if (app.hasOwnProperty("layer_options")) {
setLayerOptions(app.layer_options.isActive);
}
Expand Down Expand Up @@ -562,13 +566,15 @@ async function loadTemplate(data, isDefaultTemplate) {

//setProperStyleToCtrlBtns();

/*
let bm = document.getElementById("collapseBaseMapLayers");
bm.addEventListener("dblclick", function () {
event.stopPropagation();
});
bm.addEventListener("click", function () {
event.stopPropagation();
});
});
*/

}
}, 100);
Expand All @@ -590,6 +596,17 @@ async function loadTemplate(data, isDefaultTemplate) {
});
}

if (mainPopup) {
$("head").append(
'<link rel="stylesheet" type="text/css" href="src/js/components/main-popup/mainPopup.css">'
);
$.getScript("src/js/components/main-popup/mainPopup.js").done(function () {
mainPopup = new mainPopup();
mainPopup.check();
mainPopup._addPopupWrapper();
});
}

//load elevationProfile
if (loadElevationProfile) {
$.getScript("https://code.highcharts.com/highcharts.js").done(() => {
Expand Down
5 changes: 0 additions & 5 deletions src/js/components/fullscreen/fullscreen.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#fullscreen :hover {
background-color: #f5f4f4;
cursor: pointer;
}

#fullscreen :active {
background-color: grey;
}

#iconFS {
font-size: 18px;
line-height: inherit;
Expand Down
3 changes: 2 additions & 1 deletion src/js/components/fullscreen/fullscreen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Fullscreen {
constructor() {
this.component = `
<a id="iconFS-container" title="Pantalla Completa" onclick=toggleFullScreen()>
<a id="iconFS-container" title="Pantalla Completa">
<i id="iconFS" class="fas fa-expand" aria-hidden="true"></i>
</a>
`;
Expand All @@ -12,6 +12,7 @@ class Fullscreen {
elem.className = "leaflet-bar leaflet-control";
elem.id = "fullscreen";
elem.innerHTML = this.component;
elem.onclick = toggleFullScreen;
document.querySelector(".leaflet-top.leaflet-left").append(elem);
}
}
Expand Down
80 changes: 58 additions & 22 deletions src/js/components/geoprocessing/geoprocessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,15 @@ class Geoprocessing {

let selectedRectangle = mapa.editableLayers.rectangle.at(-1);
selectedRectangle._uneditable = true; //aux to disallow editing the layer
selectedRectangle.process = layername; //aux to relate contour with waterRise
mapa.groupLayers[layername].push(selectedRectangle.name); // hack for including rectangle in contour lines layer

addedLayers.push({
id: layername,
layer: result,
name: layername,
file_name: layername,
rectangle: selectedRectangle,
//rectangle: selectedRectangle,
type: layerType,
isActive: true,
section: sectionName
Expand Down Expand Up @@ -223,9 +224,9 @@ class Geoprocessing {
counterHeight++;

let selectedRectangle;
addedLayers.forEach(lyr => {
if (lyr.id === this.getCapaValue()) {
selectedRectangle = lyr.rectangle
mapa.editableLayers.rectangle.forEach(rect => {
if (rect.process === this.getCapaValue()) {
selectedRectangle = rect;
}
});

Expand Down Expand Up @@ -399,7 +400,7 @@ class Geoprocessing {
document.getElementById("sliderValue").classList.remove("hidden");
let arraySlider = []; //Array that contains all unique values
sliderLayer.layer.features.forEach((element) => {
if (!arraySlider.includes(element.properties.value)) {
if (!arraySlider.includes(element.properties.value) && element.geometry.type == "LineString") {
arraySlider.push(element.properties.value);
}
});
Expand All @@ -426,7 +427,7 @@ class Geoprocessing {
let arraySlider = []; //Array that contains all unique values

sliderLayer.layer.features.forEach((element) => {
if (!arraySlider.includes(element.properties.value)) {
if (!arraySlider.includes(element.properties.value) && element.geometry.type == "LineString") {
arraySlider.push(element.properties.value);
}
});
Expand Down Expand Up @@ -604,17 +605,26 @@ class Geoprocessing {


checkLayersForBuffer() {
let isBuffer = false;
gestorMenu.getActiveLayersWithoutBasemap().forEach((layer) => {
if (layer) {
$("#msgNoLayer").addClass("hidden");
isBuffer = true;
}
});
addedLayers.forEach(lyr => {
if (lyr.type === "WMS") {
isBuffer = true;
}
})
if (isBuffer) {
$("#msgNoLayer").addClass("hidden");
$("#msgRectangle").removeClass("hidden");
//$("#drawRectangleBtn").removeClass("disabledbutton");
$('label[for="input-equidistancia"]').show();
document
.getElementById("input-equidistancia")
.classList.remove("hidden");
}
});
}
}

buildOptionFormMessages(sliderLayer) {
Expand Down Expand Up @@ -742,6 +752,14 @@ class Geoprocessing {
});
}
});
addedLayers.forEach(lyr => {
if (lyr.type === "WMS") {
options.push({
value: lyr.name,
text: lyr.layer.title,
});
}
});
} else if (this.geoprocessId === "elevationProfile") {
const polylines = mapa.editableLayers.polyline;
if (polylines.length > 0) {
Expand Down Expand Up @@ -773,7 +791,7 @@ class Geoprocessing {
return;
}
addedLayers.forEach((lyr) => {
lyr.file_name == element.value
lyr.id == element.value
? (selectedLayer = lyr)
: null;
});
Expand All @@ -790,6 +808,7 @@ class Geoprocessing {
$("#drawRectangleBtn").addClass("disabledbutton");
$("#ejec_gp").addClass("disabledbutton");
} else {
this.checkLayersForBuffer()
$("#drawRectangleBtn").removeClass("disabledbutton");
}
} else if (this.geoprocessId === "elevationProfile") {
Expand Down Expand Up @@ -926,12 +945,29 @@ class Geoprocessing {
drawnRectangle = lyr;
});
let layerSelected;
gestorMenu.getActiveLayersWithoutBasemap().forEach((layer) => {
let selctedLayerName = document.getElementById("select-capa").value;
layer.name === selctedLayerName
? (layerSelected = layer)
: console.info("Layer not found.");
});
// gestorMenu.getActiveLayersWithoutBasemap().forEach((layer) => {
// let selctedLayerName = document.getElementById("select-capa").value;
// layer.name === selctedLayerName
// ? (layerSelected = layer)
// : 0;
// });

// addedLayers.forEach(lyr => {
// if (lyr.type === "WMS") {
// let selctedLayerName = document.getElementById("select-capa").value;
// lyr.name === selctedLayerName
// ? (layerSelected = lyr.layer)
// : 0;
// }
// });

let allLayers = getAllActiveLayers();
let selctedLayerName = document.getElementById("select-capa").value;
allLayers.forEach(lyr => {
if (lyr.name === selctedLayerName ) {
layerSelected = lyr.layer;
}
})

let coords = getGeometryCoords(drawnRectangle);

Expand Down Expand Up @@ -985,17 +1021,17 @@ class Geoprocessing {
break;
}
case "waterRise": {
addedLayers.forEach((layer) => {
if (layer.id == document.getElementById("select-capa").value) {
layer.rectangle._latlngs[0].forEach((coord) => {
mapa.editableLayers.rectangle.forEach(rect => {
if (rect.process === document.getElementById("select-capa").value) {
rect._latlngs[0].forEach((coord) => {
arrayWaterRise += coord.lng + " " + coord.lat + ",";
});
arrayWaterRise +=
layer.rectangle._latlngs[0][0].lng +
rect._latlngs[0][0].lng +
" " +
layer.rectangle._latlngs[0][0].lat;
rect._latlngs[0][0].lat;
}
});
})

let waterRiseValue =
document.getElementById("sliderValue").innerHTML;
Expand Down
8 changes: 8 additions & 0 deletions src/js/components/groupLayerSelector/groupLayerSelector.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#groupLayerSelector :hover {
cursor: pointer;
}

#iconGS {
font-size: 17px;
line-height: inherit;
}
Loading

0 comments on commit 96a7710

Please sign in to comment.