finished designing the list and mobile view of the field list

This commit is contained in:
csawatzky 2025-08-26 14:33:57 -06:00
parent 3567190c3a
commit 4db21a3d0c
9 changed files with 287 additions and 113 deletions

View file

@ -6,7 +6,7 @@ interface Props {
objectCollection: FeatureCollection;
measurementCollection?: FeatureCollection;
showTitle?: boolean;
setInteractiveLayers: (layers: string[]) => void;
setInteractiveLayers?: (layers: string[]) => void;
}
export default function GeoMapLayer(props: Props) {
@ -18,7 +18,9 @@ export default function GeoMapLayer(props: Props) {
// }, [measurementCollection, objectCollection]);
useEffect(() => {
setInteractiveLayers(["shapefill", "shapeborder", "measurementBorder"]);
if(setInteractiveLayers){
setInteractiveLayers(["shapefill", "shapeborder", "measurementBorder"]);
}
}, []); // eslint-disable-line react-hooks/exhaustive-deps
return (
@ -60,6 +62,7 @@ export default function GeoMapLayer(props: Props) {
/>
)}
</Source>
{measurementCollection &&
<Source type="geojson" data={measurementCollection} id={"measurements"}>
<Layer
id="measurementBorder"
@ -90,6 +93,7 @@ export default function GeoMapLayer(props: Props) {
}}
/>
</Source>
}
</React.Fragment>
);
}