Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DENUE tiles
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodrigo Tapia-McClung
DENUE tiles
Commits
e2441e39
Commit
e2441e39
authored
Jan 06, 2021
by
Rodrigo Tapia-McClung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style denue with sector_nombre. Fix circle geojson location
parent
bed95d02
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
16 deletions
+39
-16
functions.js
public/js/functions.js
+39
-16
No files found.
public/js/functions.js
View file @
e2441e39
...
...
@@ -138,12 +138,35 @@ map.on("style.load", async () => {
22
,
4
],
"circle-color"
:
[
"interpolate"
,
/*
"interpolate",
["linear"],
["get", "sector"],
10, "rgb(49,54,149)",
50, "rgb(255,255,191)",
100
,
"rgb(158,1,66)"
100, "rgb(158,1,66)"*/
"match"
,
[
"get"
,
"sector_nombre"
],
"Apoyo a negocios y manejo de residuos"
,
"#0292b7"
,
"Actividades legistalivas y gubernamentales"
,
"#1ac8db"
,
"Agricultura, ganadería y pesca"
,
"#8c756a"
,
"Alojamiento y alimentación"
,
"#dee2ec"
,
"Comercio al por mayor"
,
"#fa26a0"
,
"Comercio al por menor"
,
"#f51720"
,
"Construcción"
,
"#f8d210"
,
"Corporativos"
,
"#2ff3e0"
,
"Industria manufacturera"
,
"#d8a7b1"
,
"Información en medios masivos"
,
"#b6e2d3"
,
"Minería"
,
"#fae8e0"
,
"Otros servicios"
,
"#ef7c8e"
,
"Servicios de salud y asistencia social"
,
"#ffaebc"
,
"Servicios educativos"
,
"#a0e7e5"
,
"Servicios financieros y de seguros"
,
"#b4f8c8"
,
"Servicios inmobiliarios"
,
"#fbe7c6"
,
"Servicios profesionales, científicos y técnicos"
,
"#81b622"
,
"Servicios públicos"
,
"#0000ff"
,
"Servicios recreativos"
,
"#ecf87f"
,
"Transportes, correo y almacenamiento"
,
"#b68d40"
,
/* other values */
"#ccc"
]
}
});
...
...
@@ -158,24 +181,24 @@ map.on("style.load", async () => {
});
});
map
.
addSource
(
'circle'
,
{
'type'
:
'geojson'
,
'data'
:
'http://localhost:8090/circle.geojson'
map
.
addSource
(
"circle"
,
{
"type"
:
"geojson"
,
//"data": "http://localhost:8090/circle.geojson"
"data"
:
new
URL
(
`/circle.geojson`
,
window
.
location
.
href
).
href
});
map
.
addLayer
({
'id'
:
'circle'
,
'type'
:
'fill'
,
'source'
:
'circle'
,
'layout'
:
{},
'paint'
:
{
'fill-color'
:
'#088'
,
'fill-opacity'
:
0.56
"id"
:
"circle"
,
"type"
:
"fill"
,
"source"
:
"circle"
,
"layout"
:
{},
"paint"
:
{
"fill-color"
:
"#088"
,
"fill-opacity"
:
0.56
}
});
});
let
muniID
=
null
,
intersects
=
null
,
let
muniID
=
null
muniGeoms
=
[];
map
.
on
(
"click"
,
"denue"
,
async
e
=>
{
...
...
@@ -250,7 +273,7 @@ map.on("click", "muni_polygon", e => {
selectedIDs2
.
length
>
0
?
selectedIDs2
:
[
"sin-clave"
],
true
,
false
],
[
'within'
,
circleGeom
]
],
[
"within"
,
circleGeom
]
]
);
}
else
if
(
selectedIDs
.
length
>
0
)
{
// if no circle intersection but only selected polygons
...
...
@@ -280,7 +303,7 @@ map.on("click", "muni_polygon", e => {
});
// Change the cursor to a pointer when the mouse is over the denue layer.
map
.
on
(
"mouseenter"
,
"denue"
,
e
=>
{
map
.
on
(
"mouseenter"
,
"denue"
,
()
=>
{
map
.
getCanvas
().
style
.
cursor
=
"pointer"
;
//}
});
...
...
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