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
3ad33431
Commit
3ad33431
authored
Aug 31, 2020
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update color scheme
parent
000ab706
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
evolucion_urbana.js
public/js/evolucion_urbana.js
+13
-10
No files found.
public/js/evolucion_urbana.js
View file @
3ad33431
...
@@ -133,9 +133,9 @@ const setupMap = (dates) => {
...
@@ -133,9 +133,9 @@ const setupMap = (dates) => {
}
}
const
populateMap
=
async
(
mapData
)
=>
{
const
populateMap
=
async
(
mapData
)
=>
{
tiles
=
mapboxLayer
(
"urbanization_year"
);
tiles
=
mapboxLayer
(
"urbanization_year"
);
let
map
=
mapData
.
map
;
let
map
=
mapData
.
map
;
glmap
=
L
.
mapboxGL
({
glmap
=
L
.
mapboxGL
({
accessToken
:
"no-token"
,
accessToken
:
"no-token"
,
...
@@ -151,7 +151,7 @@ const populateMap = async(mapData) => {
...
@@ -151,7 +151,7 @@ const populateMap = async(mapData) => {
glmap
.
getMapboxMap
().
addLayer
(
tiles
);
glmap
.
getMapboxMap
().
addLayer
(
tiles
);
//glmap.getMapboxMap().setPaintProperty(tiles, "fill-opacity", 0.7)
//glmap.getMapboxMap().setPaintProperty(tiles, "fill-opacity", 0.7)
timeDimensionControl
.
addTo
(
map
);
timeDimensionControl
.
addTo
(
map
);
// Pass dummy geojson layer to timeDimension in order to register and sync
// Pass dummy geojson layer to timeDimension in order to register and sync
timeLayer
=
L
.
timeDimension
.
layer
.
Tile
(
L
.
geoJSON
(),
{
timeLayer
=
L
.
timeDimension
.
layer
.
Tile
(
L
.
geoJSON
(),
{
...
@@ -162,7 +162,7 @@ const populateMap = async(mapData) => {
...
@@ -162,7 +162,7 @@ const populateMap = async(mapData) => {
});
});
timeLayer
.
addTo
(
map
);
timeLayer
.
addTo
(
map
);
// FIX: comment out to avoid DB calls
// FIX: comment out to avoid DB calls
// style currentTiles
// style currentTiles
/*let option = $("#indicatorSelect").val(); // option selected from dropdrown
/*let option = $("#indicatorSelect").val(); // option selected from dropdrown
styleTiles(option, minIndicators, maxIndicators)
styleTiles(option, minIndicators, maxIndicators)
...
@@ -180,9 +180,9 @@ const populateMap = async(mapData) => {
...
@@ -180,9 +180,9 @@ const populateMap = async(mapData) => {
layerControl
=
L
.
control
.
layers
(
baseLayers
,
overlays
).
addTo
(
map
);
layerControl
=
L
.
control
.
layers
(
baseLayers
,
overlays
).
addTo
(
map
);
//legend.addTo(map);
//legend.addTo(map);
// fix for leaflet-mapbox-gl v. 0.0.11 that adds map's to tile pane:
// fix for leaflet-mapbox-gl v. 0.0.11 that adds map's to tile pane:
// get children of map tile pane, create array from it and iterate
// get children of map tile pane, create array from it and iterate
// setting their z-index
// setting their z-index
let
glmapChildren
=
map
.
getPanes
().
tilePane
.
children
,
let
glmapChildren
=
map
.
getPanes
().
tilePane
.
children
,
children
=
Array
.
from
(
glmapChildren
);
children
=
Array
.
from
(
glmapChildren
);
...
@@ -209,8 +209,11 @@ const mapboxLayer = (table) => {
...
@@ -209,8 +209,11 @@ const mapboxLayer = (table) => {
"interpolate"
,
"interpolate"
,
[
"linear"
],
[
"linear"
],
[
"get"
,
"yeartrimes"
],
[
"get"
,
"yeartrimes"
],
2014
,
"rgba(0, 255, 0, 0.5)"
,
// green
2014
,
"rgb(49,54,149)"
,
2019
,
"rgba(255, 0, 0, 0.5)"
,
// red
2016
,
"rgb(255,255,191)"
,
2019
,
"rgb(158,1,66)"
/*2014, "rgba(0, 255, 0, 0.5)", // green
2019, "rgba(255, 0, 0, 0.5)", // red*/
],
/*
],
/*
"fill-outline-color": [
"fill-outline-color": [
"interpolate",
"interpolate",
...
@@ -366,5 +369,5 @@ $("#mexmap").show();
...
@@ -366,5 +369,5 @@ $("#mexmap").show();
setupTimeDimensionControl
();
setupTimeDimensionControl
();
getMinMax
(
"urbanization_year"
)
// get minmax year.Q values to popoulate timeDimension
getMinMax
(
"urbanization_year"
)
// get minmax year.Q values to popoulate timeDimension
.
then
(
dates
=>
setupMap
(
dates
))
.
then
(
dates
=>
setupMap
(
dates
))
.
then
(
map
=>
populateMap
(
map
));
.
then
(
map
=>
populateMap
(
map
));
\ No newline at end of file
\ No newline at end of file
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