"use client"; import { MapContainer, TileLayer, GeoJSON } from "react-leaflet"; import L, { LatLng, divIcon } from "leaflet"; import seg from "./seg.json"; import ecomp from "./ecomp.json"; import { FeatureCollection, Geometry } from "geojson"; const GeoJSONMap = ({ height = 350 }: { height?: number }) => { const position: [number, number] = [37.5004851, -96.2261503]; const setColor = () => { return { weight: 1 }; }; const customMarkerIcon = (name: string) => divIcon({ html: name, className: "icon", }); const setIcon = (feature: any, latlng: LatLng) => { return L.marker(latlng, { icon: customMarkerIcon(feature.properties.Name), }); }; return ( } style={setColor} /> } pointToLayer={setIcon} /> ); }; export default GeoJSONMap;