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
c251da4d
Commit
c251da4d
authored
Apr 02, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix timeline undefined and variables in minimap
parent
e0272d7b
Changes
2
Hide 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 @
c251da4d
...
@@ -55,16 +55,15 @@ function addImageLayer(labelDate) {
...
@@ -55,16 +55,15 @@ function addImageLayer(labelDate) {
data
:
{
'purchase_id'
:
purchase_id
,
'report'
:
zone
,
'date'
:
labelDate
},
data
:
{
'purchase_id'
:
purchase_id
,
'report'
:
zone
,
'date'
:
labelDate
},
url
:
'/reports/tiles/tileinfo'
,
url
:
'/reports/tiles/tileinfo'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
const
layer_types
=
getSelectedCheckbox
();
currentDate
=
labelDate
;
currentDate
=
labelDate
;
removeImageLayers
()
removeImageLayers
()
// add layer
// add layer
layer_types
.
forEach
(
layer_type
=>
{
getSelectedCheckboxes
()
.
forEach
(
layer_type
=>
{
const
xyz
=
new
ol
.
layer
.
Tile
({
const
xyz
=
new
ol
.
layer
.
Tile
({
name
:
layer_type
,
name
:
layer_type
,
opacity
:
currentOpacity
,
opacity
:
(
layer_type
==
'TCI'
)
?
1
:
currentOpacity
,
source
:
new
ol
.
source
.
XYZ
({
source
:
new
ol
.
source
.
XYZ
({
projection
:
'EPSG:3857'
,
projection
:
'EPSG:3857'
,
url
:
'/reports/tiles/'
+
purchase_id
+
'/'
+
zone
+
'/'
+
layer_type
+
'/'
+
labelDate
+
'/{z}/{x}/{-y}.png'
,
url
:
'/reports/tiles/'
+
purchase_id
+
'/'
+
zone
+
'/'
+
layer_type
+
'/'
+
labelDate
+
'/{z}/{x}/{-y}.png'
,
...
@@ -74,10 +73,6 @@ function addImageLayer(labelDate) {
...
@@ -74,10 +73,6 @@ function addImageLayer(labelDate) {
})
})
});
});
if
(
layer_type
==
'TCI'
)
{
xyz
.
setOpacity
(
1
)
}
map
.
addLayer
(
xyz
);
map
.
addLayer
(
xyz
);
})
})
...
@@ -89,8 +84,7 @@ function addImageLayer(labelDate) {
...
@@ -89,8 +84,7 @@ function addImageLayer(labelDate) {
}
}
function
removeImageLayers
()
{
function
removeImageLayers
()
{
var
imageLayers
=
map
.
getLayers
().
getArray
().
slice
();
map
.
getLayers
().
getArray
().
slice
().
forEach
(
layer
=>
{
imageLayers
.
forEach
(
layer
=>
{
if
(
layer
.
get
(
'name'
)
!=
'mapbox'
&&
layer
.
get
(
'name'
)
!=
'polygon'
)
{
if
(
layer
.
get
(
'name'
)
!=
'mapbox'
&&
layer
.
get
(
'name'
)
!=
'polygon'
)
{
map
.
removeLayer
(
layer
)
map
.
removeLayer
(
layer
)
}
}
...
@@ -98,17 +92,15 @@ function removeImageLayers() {
...
@@ -98,17 +92,15 @@ function removeImageLayers() {
}
}
function
setOpacity
(
value
)
{
function
setOpacity
(
value
)
{
var
imageLayers
=
map
.
getLayers
().
getArray
().
slice
();
currentOpacity
=
value
;
currentOpacity
=
value
;
imageLayers
.
forEach
(
layer
=>
{
map
.
getLayers
().
getArray
().
slice
()
.
forEach
(
layer
=>
{
if
(
layer
.
get
(
'name'
)
!=
'mapbox'
&&
layer
.
get
(
'name'
)
!=
'polygon'
&&
layer
.
get
(
'name'
)
!=
'TCI'
)
{
if
(
layer
.
get
(
'name'
)
!=
'mapbox'
&&
layer
.
get
(
'name'
)
!=
'polygon'
&&
layer
.
get
(
'name'
)
!=
'TCI'
)
{
layer
.
setOpacity
(
value
)
layer
.
setOpacity
(
value
)
}
}
})
})
}
}
function
getSelectedCheckbox
()
{
function
getSelectedCheckbox
es
()
{
const
inputs
=
$
(
"input[name=layer_type]:checked"
);
const
inputs
=
$
(
"input[name=layer_type]:checked"
);
let
values
=
[]
let
values
=
[]
...
@@ -120,10 +112,10 @@ function getSelectedCheckbox() {
...
@@ -120,10 +112,10 @@ function getSelectedCheckbox() {
return
values
;
return
values
;
}
}
function
get
DataIndexByCheckboxId
(
dataset
,
id
)
{
function
get
ChartDataIndex
(
id
)
{
let
foundIndex
;
let
foundIndex
;
dataset
.
forEach
(
function
(
data
,
index
)
{
myChart
.
config
.
data
.
datasets
.
forEach
(
function
(
data
,
index
)
{
let
label
=
'sclcheck-'
+
data
.
label
.
toLowerCase
().
replace
(
' '
,
'-'
);
let
label
=
'sclcheck-'
+
data
.
label
.
toLowerCase
().
replace
(
' '
,
'-'
);
if
(
label
===
id
)
{
if
(
label
===
id
)
{
foundIndex
=
index
;
foundIndex
=
index
;
...
@@ -135,8 +127,7 @@ function getDataIndexByCheckboxId(dataset, id) {
...
@@ -135,8 +127,7 @@ function getDataIndexByCheckboxId(dataset, id) {
$
(
'input[name=layer_type]'
).
on
(
'click'
,
function
(){
$
(
'input[name=layer_type]'
).
on
(
'click'
,
function
(){
const
input
=
$
(
this
);
const
input
=
$
(
this
);
const
dataset
=
myChart
.
config
.
data
.
datasets
;
const
index
=
getChartDataIndex
(
input
.
parent
().
attr
(
'id'
));
const
index
=
getDataIndexByCheckboxId
(
dataset
,
input
.
parent
().
attr
(
'id'
));
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
myChart
.
getDatasetMeta
(
index
).
hidden
=!
input
.
prop
(
"checked"
);
myChart
.
getDatasetMeta
(
index
).
hidden
=!
input
.
prop
(
"checked"
);
...
...
reports/templates/sclData.html
View file @
c251da4d
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
<div
class=
"container floating-panel"
style=
"position:absolute; bottom: 40px; left: 12%; width: 500px; z-index: 1000"
>
<div
class=
"container floating-panel"
style=
"position:absolute; bottom: 40px; left: 12%; width: 500px; z-index: 1000"
>
<div
class=
"range-control"
id=
"rangecontrol"
>
<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>
<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"
>
<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