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
8ef1753a
Commit
8ef1753a
authored
Mar 21, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opacity bug
parent
38c7a6a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
minimap.js
reports/static/reports/js/minimap.js
+10
-2
No files found.
reports/static/reports/js/minimap.js
View file @
8ef1753a
...
...
@@ -35,6 +35,8 @@ const map = new ol.Map({
// show first date and current date
let
currentDate
;
let
currentOpacity
=
1
;
if
(
labels
&&
labels
.
length
>
0
)
{
currentDate
=
labels
[
0
];
addImageLayer
(
currentDate
)
...
...
@@ -49,15 +51,15 @@ function addImageLayer(labelDate) {
url
:
'/reports/tiles/tileinfo'
,
success
:
function
(
data
)
{
const
layer_types
=
getSelectedCheckbox
();
currentDate
=
labelDate
;
currentDate
=
labelDate
;
removeImageLayers
()
// add layer
layer_types
.
forEach
(
layer_type
=>
{
const
xyz
=
new
ol
.
layer
.
Tile
({
opacity
:
1
,
name
:
layer_type
,
opacity
:
currentOpacity
,
source
:
new
ol
.
source
.
XYZ
({
projection
:
'EPSG:3857'
,
url
:
'/reports/tiles/'
+
purchase_id
+
'/'
+
zone
+
'/'
+
layer_type
+
'/'
+
labelDate
+
'/{z}/{x}/{-y}.png'
,
...
...
@@ -67,6 +69,10 @@ function addImageLayer(labelDate) {
})
});
if
(
layer_type
==
'TCI'
)
{
xyz
.
setOpacity
(
1
)
}
map
.
addLayer
(
xyz
);
})
...
...
@@ -89,6 +95,8 @@ function removeImageLayers() {
function
setOpacity
(
value
)
{
var
imageLayers
=
map
.
getLayers
().
getArray
().
slice
();
currentOpacity
=
value
;
imageLayers
.
forEach
(
layer
=>
{
if
(
layer
.
get
(
'name'
)
!=
'mapbox'
&&
layer
.
get
(
'name'
)
!=
'polygon'
&&
layer
.
get
(
'name'
)
!=
'TCI'
)
{
console
.
log
(
layer
.
get
(
'name'
),
layer
);
...
...
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