add hedges layer

This commit is contained in:
Max Tobias Weber
2026-03-24 08:47:46 +01:00
parent bdce7274e4
commit 4ab605d471
2 changed files with 107461 additions and 0 deletions

107426
public/assets/hedges.geojson Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
import { useEffect, useState } from "react";
import { MlGeoJsonLayer } from "@mapcomponents/react-maplibre";
import type { FeatureCollection } from "geojson";
export default function HedgeLayer() {
const [geojson, setGeojson] = useState<FeatureCollection | null>(null);
useEffect(() => {
fetch("/assets/hedges.geojson")
.then((res) => res.json())
.then(setGeojson);
}, []);
if (!geojson) return null;
return (
<MlGeoJsonLayer
layerId="hedge"
geojson={geojson}
type="line"
insertBeforeLayer="waterway-name"
paint={{
"line-color": "#4caf50",
"line-width": 6,
"line-opacity": 0.9,
}}
options={{
layout: {
"line-cap": "round",
"line-join": "round",
},
}}
/>
);
}