Merge branch 'Carlos' of repositorio.acatlan.unam.mx:IO/front-Censo into Lino

This commit is contained in:
2026-03-20 13:48:18 -05:00
3 changed files with 72 additions and 85 deletions
+35 -19
View File
@@ -1,13 +1,14 @@
"use client";
import { MapContainer, ImageOverlay, useMap } from "react-leaflet";
import L from "leaflet";
import L, { LatLngBoundsExpression } from "leaflet";
import "leaflet/dist/leaflet.css";
import "leaflet.heat";
import { useEffect } from "react";
// Ajustar vista automáticamente
function AjustarVista({ bounds }) {
function AjustarVista({ bounds }: { bounds: LatLngBoundsExpression }) {
const map = useMap();
useEffect(() => {
@@ -24,7 +25,7 @@ function HeatLayer() {
// A 4768x3368
const edificios = {
A1: [[1400, 3060], [1470, 3060], [1470, 3360], [1400, 3360]],
A1: [[1407, 3054], [1470, 3054], [1470, 3360], [1407, 3360]],
A2: [[1570, 3130], [1570, 3190], [1850, 3190], [1850, 3130]],
A3: [[1640, 2650], [1705, 2650], [1705, 2950], [1640, 2950]],
A4: [[1268, 2765], [1268, 2830], [1540, 2830], [1540, 2765]],
@@ -32,21 +33,36 @@ function HeatLayer() {
A6: [[1390, 2385], [1450, 2385], [1450, 2655], [1390, 2655]],
A7: [[1234, 2014], [1296, 2014], [1296, 2317], [1234, 2317]],
A8: [[1390, 2055], [1700, 2055], [1700, 2118], [1390, 2118]],
A9: [[1730, 1550], [1980, 1550], [1980, 1640], [1730, 1640]],
A10: [[1580, 1660], [1580, 1960], [1660, 1960], [1580, 1660]],
A11: [[1525, 1370], [1825, 1370], [1825, 1440], [1525, 1440]],
A12: [[1750, 1140], [1750, 1520], [1910, 1520], [1910, 1140]],
A13: [[1380, 680], [1380, 1020], [1480, 1020], [1480, 680]],
A14: [[1320, 480], [1680, 480], [1680, 580], [1320, 580]],
A9: [[1215, 1825], [1480, 1825], [1480, 1890], [1215, 1890]],
A10: [[1570, 1695], [1635, 1695], [1635, 1960], [1570, 1960]],
A11: [[1475, 1510], [1780, 1510], [1780, 1570], [1475, 1570]],
A12: [[1310, 1395], [1375, 1395], [1375, 1700], [1310, 1700]],
A13: [[1780, 810], [1845, 810], [1845, 1020], [1780, 1020]],
A14: [[1505, 775], [1713, 775], [1713, 840], [1505, 840]],
A15: [[2027, 2580], [2087, 2580], [2087, 2900], [2027, 2900]],
CEDTEC: [[900, 2900], [1100, 2900], [1100, 3200], [900, 3200]],
BIBLIOTECA: [[1600, 2200], [1900, 2200], [1900, 2500], [1600, 2500]],
POSGRADO: [[1100, 1525], [860, 1525], [860, 1325], [1100, 1325]]
AEROGRAFIA: [[1157, 3308], [1254, 3308], [1254, 3369], [1157, 3369]],
ALMACEN: [[989, 1523], [1027, 1523], [1027, 1749], [989, 1749]],
APOYO_DOC: [[1115, 1222], [1475, 1222], [1475, 1293], [1115, 1293]],
BIBLIOTECA: [[1579, 2373], [1579, 2199], [1900, 2500], [1600, 2500]],
CEI: [[1570, 990], [1767, 990], [1767, 1155], [1570, 1155]],
INVEST: [[1570, 1240], [1727, 1240], [1727, 1400], [1570, 1400]],
CEDTEC: [[885, 2900], [1080, 2900], [1080, 3200], [885, 3200]],
CEMM: [[2167, 863], [2453, 863], [2453, 1458], [2167, 1458]],
CAFETERIA_Y_LIBRERIA: [[2027, 1483], [2158, 1483], [2158, 1600], [2027, 1600]],
CTED: [[1802, 1063], [1908, 1128], [1888, 1179], [1772, 1151]],
POSGRADO: [[857, 1472], [1004, 1471],[1004, 1327],[1086, 1325],[1086, 1512], [860, 1512],],
UNIDAD_SEMINA: [[1145, 2894], [1320, 2894], [1320, 3070], [1145, 3070]],
TALLS_Y_LAB: [[1085, 3209], [1292, 3209], [1292, 3307], [1085, 3307]],
UNIDAD_DE_TALLERES_MULTIDISC: [[1624, 3244], [1920, 3240], [1954, 3476], [1622, 3477]],
USC: [[992, 2656], [1029, 2656], [1029, 2828], [992, 2828]],
UIM: [[294, 3224], [901, 3257], [899, 3358], [312, 3386]],
GOB: [[950, 2068], [1104, 2068], [1104, 2218], [950, 2218]],
SERV_GRALES: [[1024, 882], [1089, 882], [1089, 1138], [1024, 1138]],
SM: [[893, 1789], [935, 1789], [935, 1891], [893, 1891]]
};
const puntos = [];
const puntos: any[] = [];
Object.entries(edificios).forEach(([nombre, poligono]) => {
for (let i = 0; i < 15; i++) {
@@ -61,7 +77,7 @@ function HeatLayer() {
});
const heat = L.heatLayer(puntos, {
const heat = (L as any).heatLayer(puntos, {
radius: 35,
blur: 25,
maxZoom: 2,
@@ -77,8 +93,8 @@ function HeatLayer() {
heat.addTo(map);
Object.entries(edificios).forEach(([nombre, coords]) => {
L.polygon(coords, {
Object.entries(edificios).forEach(([nombre, coords]: any) => {
L.polygon((coords), {
color: "#77ee9f",
weight: 2,
fillOpacity: 0.25
@@ -103,9 +119,9 @@ function HeatLayer() {
export default function MapaCalor() {
const bounds = [
const bounds: LatLngBoundsExpression = [
[0, 0],
[3368, 4768]
[3368, 4768]
];
return (
+6 -1
View File
@@ -6,7 +6,12 @@ import Cookies from "js-cookie";
import axios from "axios";
import "./pregunta7.css";
import ToggleButton from "../Toggle/ToggleButton";
import MapaCalor from "./MapaCalor";
import dynamic from "next/dynamic";
const MapaCalor = dynamic(
() => import("./MapaCalor"),
{ ssr: false }
);
type AntiguedadItem = {
antiguedad: string | null;