Skip to content

Commit

Permalink
fix: update mapsdata loading
Browse files Browse the repository at this point in the history
cilasmarques committed Oct 7, 2024
1 parent d6ecc5e commit c6263f0
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/MapTiff/MapTiff.tsx
Original file line number Diff line number Diff line change
@@ -3,33 +3,33 @@
import maplibregl from "maplibre-gl";
import "maplibre-gl/dist/maplibre-gl.css";
import { createRoot } from "react-dom/client";
import { useCallback, useContext, useEffect, useRef, useState } from "react";
import { useCallback, useEffect, useRef, useState } from "react";
import { MapContainer, Loading, LoadingText } from "./MapTiff.styles";
import { IMapInfo } from "@/utils/interfaces";
import { IEEInfo, IMapInfo } from "@/utils/interfaces";
import {
MAP_TIFF_STYLE,
MAP_TIFF_BRAZIL_STATES,
MAP_TIFF_BRAZIL_CITIES,
} from "@/utils/constants";
import { CMSContext } from "@/contexts/ContentProvider";
import MapPopup from "../MapPopup/MapPopup";

const HOST_URL = process.env.NEXT_PUBLIC_HOST_URL;

const MapTiff = ({
mapsData,
data,
loading,
setLoading,
onClick,
...props
}: {
mapsData: { fields: IEEInfo }[];
data: IMapInfo;
loading: boolean;
setLoading: (e: boolean) => void;
onClick?: (e: any) => void;
}) => {
const { name, year } = data;
const { mapsData } = useContext(CMSContext);
const [map, setMap] = useState<maplibregl.Map | null>(null);
const mapContainer = useRef<HTMLDivElement>(null);
const popupRef = useRef(
1 change: 1 addition & 0 deletions src/components/MapTiff/Section/MapSection.tsx
Original file line number Diff line number Diff line change
@@ -101,6 +101,7 @@ const MapSection = ({ mapsData }: { mapsData: { fields: IEEInfo }[] }) => {
<MapTemplate>
<MapContainer>
<MapTiff
mapsData={mapsData}
data={imageData}
onClick={handleMapClick}
loading={loadingMap}

0 comments on commit c6263f0

Please sign in to comment.