import { GeoJsonObject } from 'geojson'; import React, { useEffect, useState } from 'react'; import { GeoJSON } from 'react-leaflet'; import { apiGet } from '../../apiHelpers'; import { useDisplayPreferences } from '../../displayPreferences-context'; export function HousingBoundaryLayer() { const [boundaryGeojson, setBoundaryGeojson] = useState(null); const { housing } = useDisplayPreferences(); useEffect(() => { apiGet('/geometries/housing_zones.geojson') .then(data => setBoundaryGeojson(data as GeoJsonObject)); }, []); if(housing == "enabled") { return boundaryGeojson && ; } else if (housing == "disabled") { return
} }