descripcion reportes

parent fa2b0e32
...@@ -11,6 +11,36 @@ const polygonFeature = wktFormat.readFeature(polygon, { ...@@ -11,6 +11,36 @@ const polygonFeature = wktFormat.readFeature(polygon, {
}); });
// Create layers // Create layers
const layers2 = {
light: new ol.layer.Tile({
name: 'mapbox',
source: new ol.source.XYZ({
url: 'https://api.tiles.mapbox.com/v4/mapbox.light/{z}/{x}/{y}.png?access_token=' + MAPBOX_ACCESS_TOKEN
})
}),
streets: new ol.layer.Tile({
name: 'mapbox',
source: new ol.source.XYZ({
url: 'http://tile.openstreetmap.org/{z}/{x}/{y}.png'
})
}),
night: new ol.layer.Tile({
name: 'mapbox',
source: new ol.source.XYZ({
url: 'https://api.mapbox.com/styles/v1/mapbox/navigation-guidance-night-v2/tiles/256/{z}/{x}/{y}?access_token=' + MAPBOX_ACCESS_TOKEN
})
}),
cycle: new ol.layer.Tile({
name: 'mapbox',
source: new ol.source.XYZ({
url: 'https://api.tiles.mapbox.com/v4/mapbox.outdoors/{z}/{x}/{y}.png?access_token=' + MAPBOX_ACCESS_TOKEN
}),
})
}
const light = new ol.layer.Tile({ const light = new ol.layer.Tile({
name: 'mapbox', name: 'mapbox',
source: new ol.source.XYZ({ source: new ol.source.XYZ({
...@@ -39,7 +69,16 @@ const cycle = new ol.layer.Tile({ ...@@ -39,7 +69,16 @@ const cycle = new ol.layer.Tile({
}), }),
}); });
let x = '';
if (sessionStorage.selectedMap) {
x = sessionStorage.selectedMap;
console.log({x})
}
else {
x = 'light';
console.log({x})
}
const polygonLayer = new ol.layer.Vector({ const polygonLayer = new ol.layer.Vector({
name: 'polygon', name: 'polygon',
source: new ol.source.Vector({ source: new ol.source.Vector({
...@@ -52,7 +91,7 @@ const layers = new Map(); ...@@ -52,7 +91,7 @@ const layers = new Map();
// create map // create map
const map = new ol.Map({ const map = new ol.Map({
target: 'minimap', target: 'minimap',
layers: [light, polygonLayer], layers: [layers2[x], polygonLayer],
view: new ol.View({ view: new ol.View({
center: ol.proj.fromLonLat([-99.19, 19.61]), center: ol.proj.fromLonLat([-99.19, 19.61]),
zoom: 4, zoom: 4,
...@@ -60,6 +99,58 @@ const map = new ol.Map({ ...@@ -60,6 +99,58 @@ const map = new ol.Map({
}) })
}); });
map.once('postrender', function (event) {
if (sessionStorage.showChart === "true") {
showGraph(true)
}
if (sessionStorage.selectedMap) {
currentMap = sessionStorage.selectedMap;
}
if (sessionStorage.TCI) {
$('#tcicheck').prop('checked', true);
}
if (sessionStorage.SCL_0) {
$('#check-no-data').prop('checked', true);
}
if (sessionStorage.SCL_1) {
$('#check-saturated').prop('checked', true);
}
if (sessionStorage.SCL_2) {
$('#check-shadows').prop('checked', true);
}
if (sessionStorage.SCL_3) {
$('#check-cloud-shadows').prop('checked', true);
}
if (sessionStorage.SCL_4) {
$('#check-vegetation').prop('checked', true);
}
if (sessionStorage.SCL_5) {
$('#check-not-vegetated').prop('checked', true);
}
if (sessionStorage.SCL_6) {
$('#check-water').prop('checked', true);
}
if (sessionStorage.SCL_7) {
$('#check-unclassified').prop('checked', true);
}
if (sessionStorage.SCL_8) {
$('#check-clouds').prop('checked', true);
}
if (sessionStorage.SCL_9) {
$('#check-snow').prop('checked', true);
}
if (sessionStorage.layerOpacity){
$('#opacitySlide').val(sessionStorage.layerOpacity)
setOpacity(sessionStorage.layerOpacity);
}
console.log(sessionStorage)
if (sessionStorage.charttype) {
change(sessionStorage.charttype);
}
});
// fit (zoom) to polygon // fit (zoom) to polygon
map.getView().fit(polygonFeature.getGeometry()); map.getView().fit(polygonFeature.getGeometry());
...@@ -116,7 +207,7 @@ function changeLayers(especific_layerName) { ...@@ -116,7 +207,7 @@ function changeLayers(especific_layerName) {
} }
layers.set(layerName, xyz); layers.set(layerName, xyz);
sessionStorage.setItem(layerName,layerName); // replace sessionStorage.setItem(layerName, layerName); // replace
}); });
} }
...@@ -142,7 +233,11 @@ function setOpacity(value) { ...@@ -142,7 +233,11 @@ function setOpacity(value) {
layer.setOpacity(value) layer.setOpacity(value)
} }
}) })
if(sessionStorage.layerOpacity != value){
sessionStorage.layerOpacity = value; sessionStorage.layerOpacity = value;
}
} }
...@@ -175,8 +270,8 @@ function compare(labels) { ...@@ -175,8 +270,8 @@ function compare(labels) {
$(".showChart").show(); $(".showChart").show();
$(".hideChart").hide(); $(".hideChart").hide();
//desactiva el botón de mostrar la gráfica //desactiva el botón de mostrar la gráfica
$('#showGraph').attr('disabled',true); $('#showGraph').attr('disabled', true);
$('#chartType').attr('disabled',true); $('#chartType').attr('disabled', true);
//quita todas las capas SCL y deja sólo TCI //quita todas las capas SCL y deja sólo TCI
removeLayer(); removeLayer();
...@@ -194,8 +289,6 @@ function compare(labels) { ...@@ -194,8 +289,6 @@ function compare(labels) {
$("#check-snow").prop("checked", false); $("#check-snow").prop("checked", false);
map.getControls().forEach(function (control) { //checa si ya se añadio el control de comparacion (swipe), si no lo tiene, lo agrega map.getControls().forEach(function (control) { //checa si ya se añadio el control de comparacion (swipe), si no lo tiene, lo agrega
if (control instanceof ol.control.Swipe) { //si ya tiene el control agregado if (control instanceof ol.control.Swipe) { //si ya tiene el control agregado
swipeControl = true; swipeControl = true;
...@@ -251,8 +344,8 @@ function exitCompare() { ...@@ -251,8 +344,8 @@ function exitCompare() {
document.getElementById("timeLine").style.display = "block"; document.getElementById("timeLine").style.display = "block";
//activa el boton de la grafica //activa el boton de la grafica
$('#showGraph').attr('disabled',false); $('#showGraph').attr('disabled', false);
$('#chartType').attr('disabled',false); $('#chartType').attr('disabled', false);
} }
...@@ -322,7 +415,7 @@ function setCompareDirection(direction) { ...@@ -322,7 +415,7 @@ function setCompareDirection(direction) {
function changeMap(selectedMap) { function changeMap(selectedMap) {
sessionStorage.selectepMap = selectedMap; sessionStorage.selectedMap = selectedMap;
map.getLayers().getArray().forEach(function (layer) { map.getLayers().getArray().forEach(function (layer) {
if (layer.values_.name == "mapbox") { if (layer.values_.name == "mapbox") {
map.removeLayer(layer) map.removeLayer(layer)
......
...@@ -189,7 +189,7 @@ function change(newType) { ...@@ -189,7 +189,7 @@ function change(newType) {
} }
myChart = new Chart(ctx, temp); myChart = new Chart(ctx, temp);
//showGraph(true) showGraph(true)
}; };
let img, imgWidth = 0, slider = false, clicked = 0; let img, imgWidth = 0, slider = false, clicked = 0;
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</a> </a>
<ul class="treeview-menu sidebar-form"> <ul class="treeview-menu sidebar-form">
<li> <li>
<a class="treeview submenu" href="#" onclick="change('line')"> <a class="treeview submenu" href="#" onclick="change('line');showGraph(true)">
<i class="fa fa-bar-chart"></i> <i class="fa fa-bar-chart"></i>
<span>Line Chart</span> <span>Line Chart</span>
<span class="pull-right-container"> <span class="pull-right-container">
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</a> </a>
</li> </li>
<li> <li>
<a class="treeview submenu" href="#" onclick="change('bar')"> <a class="treeview submenu" href="#" onclick="change('bar');showGraph(true)">
<i class="fa fa-bar-chart"></i> <i class="fa fa-bar-chart"></i>
<span>Bar Chart</span> <span>Bar Chart</span>
<span class="pull-right-container"> <span class="pull-right-container">
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
</a> </a>
</li> </li>
<li> <li>
<a class="treeview submenu" href="#" onclick="change('stackedBar')"> <a class="treeview submenu" href="#" onclick="change('stackedBar');showGraph(true)">
<i class="fa fa-bar-chart"></i> <i class="fa fa-bar-chart"></i>
<span>Stacked Bar Chart</span> <span>Stacked Bar Chart</span>
<span class="pull-right-container"> <span class="pull-right-container">
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
</a> </a>
</li> </li>
<li> <li>
<a class="treeview submenu" href="#" onclick="change('polarArea')"> <a class="treeview submenu" href="#" onclick="change('polarArea');showGraph(true)">
<i class="fa fa-bar-chart"></i> <i class="fa fa-bar-chart"></i>
<span>Polar Area Chart</span> <span>Polar Area Chart</span>
<span class="pull-right-container"> <span class="pull-right-container">
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
</a> </a>
</li> </li>
<li> <li>
<a class="treeview submenu" href="#" onclick="change('doughnut')"> <a class="treeview submenu" href="#" onclick="change('doughnut');showGraph(true)">
<i class="fa fa-bar-chart"></i> <i class="fa fa-bar-chart"></i>
<span>Doughnut Chart</span> <span>Doughnut Chart</span>
<span class="pull-right-container"> <span class="pull-right-container">
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
</a> </a>
</li> </li>
<li> <li>
<a class="treeview submenu" href="#" onclick="change('pie')"> <a class="treeview submenu" href="#" onclick="change('pie');showGraph(true)">
<i class="fa fa-bar-chart"></i> <i class="fa fa-bar-chart"></i>
<span>Pie Chart</span> <span>Pie Chart</span>
<span class="pull-right-container"> <span class="pull-right-container">
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
</a> </a>
</li> </li>
<li> <li>
<a class="treeview submenu" href="#" onclick="change('radar')"> <a class="treeview submenu" href="#" onclick="change('radar');showGraph(true)">
<i class="fa fa-bar-chart"></i> <i class="fa fa-bar-chart"></i>
<span>Radar Chart</span> <span>Radar Chart</span>
<span class="pull-right-container"> <span class="pull-right-container">
......
...@@ -370,6 +370,7 @@ ...@@ -370,6 +370,7 @@
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script id="rendered-js"> <script id="rendered-js">
$('input[id="inputRange"]').on('input', function () { $('input[id="inputRange"]').on('input', function () {
let control = $(this); let control = $(this);
let controlMin = control.attr('min'); let controlMin = control.attr('min');
...@@ -593,49 +594,7 @@ ...@@ -593,49 +594,7 @@
} }
$(document).ready(function(){
console.log(sessionStorage)
if (sessionStorage.showChart==="true"){
showGraph(true)
}
if (sessionStorage.charttype){
change(sessionStorage.charttype);
}
if(sessionStorage.selectedMap){
currentMap = sessionStorage.selectedMap;
}
if(sessionStorage.SCL_0){
$('#SCL_0').prop('checked', true);
}
if(sessionStorage.SCL_2){
$('#SCL_2').prop('checked', true);
}
if(sessionStorage.SCL_3){
$('#SCL_3').prop('checked', true);
}
if(sessionStorage.SCL_4){
$('#SCL_4').prop('checked', true);
}
if(sessionStorage.SCL_5){
$('#SCL_5').prop('checked', true);
}
if(sessionStorage.SCL_6){
$('#SCL_6').prop('checked', true);
}
if(sessionStorage.SCL_7){
$('#SCL_7').prop('checked', true);
}
if(sessionStorage.SCL_8){
$('#SCL_8').prop('checked', true);
}
if (sessionStorage.selectedMap==='night'){
changeMap('night')
}
});
......
...@@ -44,6 +44,8 @@ USERS_PATH = config['PATHS']['PATH_USERS'] ...@@ -44,6 +44,8 @@ USERS_PATH = config['PATHS']['PATH_USERS']
########################################################### ###########################################################
def report_L2ASCL(request, purchase_id): def report_L2ASCL(request, purchase_id):
template = "sclData.html" template = "sclData.html"
reporteDir = 'mask' reporteDir = 'mask'
folders = "" folders = ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment