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
21d61983
Commit
21d61983
authored
Apr 02, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.geoint.mx/mario.chirinos/GeoInt_SIDT
into dev
parents
7a37815c
c251da4d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
minimap.js
reports/static/reports/js/minimap.js
+8
-17
sclData.html
reports/templates/sclData.html
+1
-1
No files found.
reports/static/reports/js/minimap.js
View file @
21d61983
...
...
@@ -55,16 +55,15 @@ function addImageLayer(labelDate) {
data
:
{
'purchase_id'
:
purchase_id
,
'report'
:
zone
,
'date'
:
labelDate
},
url
:
'/reports/tiles/tileinfo'
,
success
:
function
(
data
)
{
const
layer_types
=
getSelectedCheckbox
();
currentDate
=
labelDate
;
removeImageLayers
()
// add layer
layer_types
.
forEach
(
layer_type
=>
{
getSelectedCheckboxes
()
.
forEach
(
layer_type
=>
{
const
xyz
=
new
ol
.
layer
.
Tile
({
name
:
layer_type
,
opacity
:
currentOpacity
,
opacity
:
(
layer_type
==
'TCI'
)
?
1
:
currentOpacity
,
source
:
new
ol
.
source
.
XYZ
({
projection
:
'EPSG:3857'
,
url
:
'/reports/tiles/'
+
purchase_id
+
'/'
+
zone
+
'/'
+
layer_type
+
'/'
+
labelDate
+
'/{z}/{x}/{-y}.png'
,
...
...
@@ -74,10 +73,6 @@ function addImageLayer(labelDate) {
})
});
if
(
layer_type
==
'TCI'
)
{
xyz
.
setOpacity
(
1
)
}
map
.
addLayer
(
xyz
);
})
...
...
@@ -89,8 +84,7 @@ function addImageLayer(labelDate) {
}
function
removeImageLayers
()
{
var
imageLayers
=
map
.
getLayers
().
getArray
().
slice
();
imageLayers
.
forEach
(
layer
=>
{
map
.
getLayers
().
getArray
().
slice
().
forEach
(
layer
=>
{
if
(
layer
.
get
(
'name'
)
!=
'mapbox'
&&
layer
.
get
(
'name'
)
!=
'polygon'
)
{
map
.
removeLayer
(
layer
)
}
...
...
@@ -98,17 +92,15 @@ function removeImageLayers() {
}
function
setOpacity
(
value
)
{
var
imageLayers
=
map
.
getLayers
().
getArray
().
slice
();
currentOpacity
=
value
;
imageLayers
.
forEach
(
layer
=>
{
map
.
getLayers
().
getArray
().
slice
()
.
forEach
(
layer
=>
{
if
(
layer
.
get
(
'name'
)
!=
'mapbox'
&&
layer
.
get
(
'name'
)
!=
'polygon'
&&
layer
.
get
(
'name'
)
!=
'TCI'
)
{
layer
.
setOpacity
(
value
)
}
})
}
function
getSelectedCheckbox
()
{
function
getSelectedCheckbox
es
()
{
const
inputs
=
$
(
"input[name=layer_type]:checked"
);
let
values
=
[]
...
...
@@ -120,10 +112,10 @@ function getSelectedCheckbox() {
return
values
;
}
function
get
DataIndexByCheckboxId
(
dataset
,
id
)
{
function
get
ChartDataIndex
(
id
)
{
let
foundIndex
;
dataset
.
forEach
(
function
(
data
,
index
)
{
myChart
.
config
.
data
.
datasets
.
forEach
(
function
(
data
,
index
)
{
let
label
=
'sclcheck-'
+
data
.
label
.
toLowerCase
().
replace
(
' '
,
'-'
);
if
(
label
===
id
)
{
foundIndex
=
index
;
...
...
@@ -135,8 +127,7 @@ function getDataIndexByCheckboxId(dataset, id) {
$
(
'input[name=layer_type]'
).
on
(
'click'
,
function
(){
const
input
=
$
(
this
);
const
dataset
=
myChart
.
config
.
data
.
datasets
;
const
index
=
getDataIndexByCheckboxId
(
dataset
,
input
.
parent
().
attr
(
'id'
));
const
index
=
getChartDataIndex
(
input
.
parent
().
attr
(
'id'
));
if
(
index
>
-
1
)
{
myChart
.
getDatasetMeta
(
index
).
hidden
=!
input
.
prop
(
"checked"
);
...
...
reports/templates/sclData.html
View file @
21d61983
...
...
@@ -120,7 +120,7 @@
<div
class=
"container floating-panel"
style=
"position:absolute; bottom: 40px; left: 12%; width: 500px; z-index: 1000"
>
<div
class=
"range-control"
id=
"rangecontrol"
>
<span
id=
"tooltiptext"
>
{{ labels|first|slice:"6:8" }}/{{ labels|first|slice:"4:6" }}/{{ labels|first|slice:"0:4" }}
</span>
<input
class=
"cross-range"
id=
"inputRange"
type=
"range"
min=
"
1"
max=
"{{ labels|length }}"
step=
"1"
value=
"1
"
data-thumbwidth=
"20"
style=
"background: transparent;"
>
<input
class=
"cross-range"
id=
"inputRange"
type=
"range"
min=
"
0"
max=
"{{ labels|length|add:'-1' }}"
step=
"1"
value=
"0
"
data-thumbwidth=
"20"
style=
"background: transparent;"
>
<datalist
class=
"range__list"
id=
"number"
>
...
...
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