Commit e2441e39 authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

Style denue with sector_nombre. Fix circle geojson location

parent bed95d02
...@@ -138,12 +138,35 @@ map.on("style.load", async () => { ...@@ -138,12 +138,35 @@ map.on("style.load", async () => {
22, 4 22, 4
], ],
"circle-color": [ "circle-color": [
"interpolate", /*"interpolate",
["linear"], ["linear"],
["get", "sector"], ["get", "sector"],
10, "rgb(49,54,149)", 10, "rgb(49,54,149)",
50, "rgb(255,255,191)", 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 () => { ...@@ -158,24 +181,24 @@ map.on("style.load", async () => {
}); });
}); });
map.addSource('circle', { map.addSource("circle", {
'type': 'geojson', "type": "geojson",
'data': 'http://localhost:8090/circle.geojson' //"data": "http://localhost:8090/circle.geojson"
"data": new URL(`/circle.geojson`, window.location.href).href
}); });
map.addLayer({ map.addLayer({
'id': 'circle', "id": "circle",
'type': 'fill', "type": "fill",
'source': 'circle', "source": "circle",
'layout': {}, "layout": {},
'paint': { "paint": {
'fill-color': '#088', "fill-color": "#088",
'fill-opacity': 0.56 "fill-opacity": 0.56
} }
}); });
}); });
let muniID = null, let muniID = null
intersects = null,
muniGeoms = []; muniGeoms = [];
map.on("click", "denue", async e => { map.on("click", "denue", async e => {
...@@ -250,7 +273,7 @@ map.on("click", "muni_polygon", e => { ...@@ -250,7 +273,7 @@ map.on("click", "muni_polygon", e => {
selectedIDs2.length > 0 ? selectedIDs2 : ["sin-clave"], selectedIDs2.length > 0 ? selectedIDs2 : ["sin-clave"],
true, true,
false false
], ['within', circleGeom] ], ["within", circleGeom]
] ]
); );
} else if (selectedIDs.length > 0) { // if no circle intersection but only selected polygons } else if (selectedIDs.length > 0) { // if no circle intersection but only selected polygons
...@@ -280,7 +303,7 @@ map.on("click", "muni_polygon", e => { ...@@ -280,7 +303,7 @@ map.on("click", "muni_polygon", e => {
}); });
// Change the cursor to a pointer when the mouse is over the denue layer. // 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"; map.getCanvas().style.cursor = "pointer";
//} //}
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment