import { GeoJsonObject } from 'geojson'; import React, { useEffect, useState } from 'react'; import { GeoJSON } from 'react-leaflet'; import { ParcelEnablementState } from '../../config/map-config'; import { apiGet } from '../../apiHelpers'; export function ParcelBoundaryLayer({enablement}: {enablement: ParcelEnablementState}) { const [boundaryGeojson, setBoundaryGeojson] = useState(null); useEffect(() => { apiGet('/geometries/parcels_city_of_london.geojson') .then(data => setBoundaryGeojson(data as GeoJsonObject)); }, []); if(enablement == "enabled") { return boundaryGeojson && ; } else if (enablement == "disabled") { return
// do not display anything return boundaryGeojson && } else { return boundaryGeojson && ; } }