Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fordecyt_2019
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodrigo Tapia-McClung
fordecyt_2019
Commits
90289944
Commit
90289944
authored
Mar 12, 2021
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added map legend
parent
eaef7387
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
centropais_periurbano.js
public/js/centropais_periurbano.js
+22
-0
No files found.
public/js/centropais_periurbano.js
View file @
90289944
...
@@ -362,6 +362,7 @@ const populateMap = async (mapData) => {
...
@@ -362,6 +362,7 @@ const populateMap = async (mapData) => {
duration
:
"P1Y"
duration
:
"P1Y"
});
});
timeLayer
.
addTo
(
map
);
timeLayer
.
addTo
(
map
);
legend
.
addTo
(
map
);
let
baseLayers
=
{
let
baseLayers
=
{
"Carto Dark"
:
cartoDarkLayer
,
"Carto Dark"
:
cartoDarkLayer
,
...
@@ -521,6 +522,27 @@ L.timeDimension.layer.Tile = (layer, options) => {
...
@@ -521,6 +522,27 @@ L.timeDimension.layer.Tile = (layer, options) => {
return
new
L
.
TimeDimension
.
Layer
.
Tile
(
layer
,
options
);
return
new
L
.
TimeDimension
.
Layer
.
Tile
(
layer
,
options
);
};
};
let
legend
=
L
.
control
({
position
:
"bottomright"
});
legend
.
onAdd
=
()
=>
{
let
div
=
L
.
DomUtil
.
create
(
"div"
,
"info legend leaflet-bar"
);
let
html
=
"<h6>Urbanización</h6><ul>"
;
let
colorGrados
=
{
"Baja"
:
"rgb(49,149,54)"
,
"Media"
:
"rgb(255,255,191)"
,
"Alta"
:
"rgb(158,1,66)"
};
Object
.
keys
(
colorGrados
).
forEach
(
grado
=>
{
html
+=
`<li><i style="background:
${
colorGrados
[
grado
]}
"></i>
${
grado
}
</li>`
;
});
html
+=
"</ul>"
;
div
.
innerHTML
=
html
;
return
div
;
};
// hide initial screen and show map
// hide initial screen and show map
$
(
"#startHeader"
).
remove
();
$
(
"#startHeader"
).
remove
();
$
(
"#initial-backdrop"
).
remove
();
$
(
"#initial-backdrop"
).
remove
();
...
...
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