Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
d2a5fcb6
Commit
d2a5fcb6
authored
Nov 15, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
descripcion reportes
parent
fa2b0e32
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
75 deletions
+129
-75
minimap.js
reports/static/reports/js/minimap.js
+118
-25
reportImg.js
reports/static/reports/js/reportImg.js
+1
-1
aside.html
reports/templates/aside.html
+7
-7
sclData.html
reports/templates/sclData.html
+1
-42
views.py
reports/views.py
+2
-0
No files found.
reports/static/reports/js/minimap.js
View file @
d2a5fcb6
...
...
@@ -11,6 +11,36 @@ const polygonFeature = wktFormat.readFeature(polygon, {
});
// 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
({
name
:
'mapbox'
,
source
:
new
ol
.
source
.
XYZ
({
...
...
@@ -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
({
name
:
'polygon'
,
source
:
new
ol
.
source
.
Vector
({
...
...
@@ -52,7 +91,7 @@ const layers = new Map();
// create map
const
map
=
new
ol
.
Map
({
target
:
'minimap'
,
layers
:
[
l
ight
,
polygonLayer
],
layers
:
[
l
ayers2
[
x
]
,
polygonLayer
],
view
:
new
ol
.
View
({
center
:
ol
.
proj
.
fromLonLat
([
-
99.19
,
19.61
]),
zoom
:
4
,
...
...
@@ -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
map
.
getView
().
fit
(
polygonFeature
.
getGeometry
());
...
...
@@ -116,7 +207,7 @@ function changeLayers(especific_layerName) {
}
layers
.
set
(
layerName
,
xyz
);
sessionStorage
.
setItem
(
layerName
,
layerName
);
// replace
sessionStorage
.
setItem
(
layerName
,
layerName
);
// replace
});
}
...
...
@@ -142,7 +233,11 @@ function setOpacity(value) {
layer
.
setOpacity
(
value
)
}
})
sessionStorage
.
layerOpacity
=
value
;
if
(
sessionStorage
.
layerOpacity
!=
value
){
sessionStorage
.
layerOpacity
=
value
;
}
}
...
...
@@ -175,25 +270,23 @@ function compare(labels) {
$
(
".showChart"
).
show
();
$
(
".hideChart"
).
hide
();
//desactiva el botón de mostrar la gráfica
$
(
'#showGraph'
).
attr
(
'disabled'
,
true
);
$
(
'#chartType'
).
attr
(
'disabled'
,
true
);
//quita todas las capas SCL y deja sólo TCI
removeLayer
();
changeLayers
(
'TCI'
);
$
(
"#tcicheck"
).
prop
(
"checked"
,
true
);
$
(
"#check-no-data"
).
prop
(
"checked"
,
false
);
$
(
"#check-saturated"
).
prop
(
"checked"
,
false
);
$
(
"#check-shadows"
).
prop
(
"checked"
,
false
);
$
(
"#check-cloud-shadows"
).
prop
(
"checked"
,
false
);
$
(
"#check-vegetation"
).
prop
(
"checked"
,
false
);
$
(
"#check-not-vegetated"
).
prop
(
"checked"
,
false
);
$
(
"#check-water"
).
prop
(
"checked"
,
false
);
$
(
"#check-unclassified"
).
prop
(
"checked"
,
false
);
$
(
"#check-clouds"
).
prop
(
"checked"
,
false
);
$
(
"#check-snow"
).
prop
(
"checked"
,
false
);
$
(
'#showGraph'
).
attr
(
'disabled'
,
true
);
$
(
'#chartType'
).
attr
(
'disabled'
,
true
);
//quita todas las capas SCL y deja sólo TCI
removeLayer
();
changeLayers
(
'TCI'
);
$
(
"#tcicheck"
).
prop
(
"checked"
,
true
);
$
(
"#check-no-data"
).
prop
(
"checked"
,
false
);
$
(
"#check-saturated"
).
prop
(
"checked"
,
false
);
$
(
"#check-shadows"
).
prop
(
"checked"
,
false
);
$
(
"#check-cloud-shadows"
).
prop
(
"checked"
,
false
);
$
(
"#check-vegetation"
).
prop
(
"checked"
,
false
);
$
(
"#check-not-vegetated"
).
prop
(
"checked"
,
false
);
$
(
"#check-water"
).
prop
(
"checked"
,
false
);
$
(
"#check-unclassified"
).
prop
(
"checked"
,
false
);
$
(
"#check-clouds"
).
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
...
...
@@ -251,8 +344,8 @@ function exitCompare() {
document
.
getElementById
(
"timeLine"
).
style
.
display
=
"block"
;
//activa el boton de la grafica
$
(
'#showGraph'
).
attr
(
'disabled'
,
false
);
$
(
'#chartType'
).
attr
(
'disabled'
,
false
);
$
(
'#showGraph'
).
attr
(
'disabled'
,
false
);
$
(
'#chartType'
).
attr
(
'disabled'
,
false
);
}
...
...
@@ -322,7 +415,7 @@ function setCompareDirection(direction) {
function
changeMap
(
selectedMap
)
{
sessionStorage
.
selecte
p
Map
=
selectedMap
;
sessionStorage
.
selecte
d
Map
=
selectedMap
;
map
.
getLayers
().
getArray
().
forEach
(
function
(
layer
)
{
if
(
layer
.
values_
.
name
==
"mapbox"
)
{
map
.
removeLayer
(
layer
)
...
...
reports/static/reports/js/reportImg.js
View file @
d2a5fcb6
...
...
@@ -189,7 +189,7 @@ function change(newType) {
}
myChart
=
new
Chart
(
ctx
,
temp
);
//
showGraph(true)
showGraph
(
true
)
};
let
img
,
imgWidth
=
0
,
slider
=
false
,
clicked
=
0
;
...
...
reports/templates/aside.html
View file @
d2a5fcb6
...
...
@@ -89,7 +89,7 @@
</a>
<ul
class=
"treeview-menu sidebar-form"
>
<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>
<span>
Line Chart
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -98,7 +98,7 @@
</a>
</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>
<span>
Bar Chart
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -107,7 +107,7 @@
</a>
</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>
<span>
Stacked Bar Chart
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -116,7 +116,7 @@
</a>
</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>
<span>
Polar Area Chart
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -125,7 +125,7 @@
</a>
</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>
<span>
Doughnut Chart
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -134,7 +134,7 @@
</a>
</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>
<span>
Pie Chart
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -143,7 +143,7 @@
</a>
</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>
<span>
Radar Chart
</span>
<span
class=
"pull-right-container"
>
...
...
reports/templates/sclData.html
View file @
d2a5fcb6
...
...
@@ -370,6 +370,7 @@
{% endblock %}
{% block scripts %}
<script
id=
"rendered-js"
>
$
(
'input[id="inputRange"]'
).
on
(
'input'
,
function
()
{
let
control
=
$
(
this
);
let
controlMin
=
control
.
attr
(
'min'
);
...
...
@@ -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'
)
}
});
...
...
reports/views.py
View file @
d2a5fcb6
...
...
@@ -44,6 +44,8 @@ USERS_PATH = config['PATHS']['PATH_USERS']
###########################################################
def
report_L2ASCL
(
request
,
purchase_id
):
template
=
"sclData.html"
reporteDir
=
'mask'
folders
=
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment