import React, { useState } from 'react'; import { CursorClickIcon } from '@heroicons/react/outline'; import 'maplibre-gl/dist/maplibre-gl.css'; import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css'; import type { FeatureCollection } from 'geojson'; import { MapLibre } from '../shared/maplibre/MapLibre'; import { useFeatureCollection } from './hooks'; import { DrawLayer } from './components/DrawLayer'; import { CadastreLayer } from './components/CadastreLayer'; import { AddressInput } from './components/AddressInput'; import { PointInput } from './components/PointInput'; import { ImportFileInput } from './components/ImportFileInput'; import { FlashMessage } from '../shared/FlashMessage'; import { ComboSearchProps } from '../ComboSearch'; export default function MapEditor({ featureCollection: initialFeatureCollection, url, options, autocompleteAnnounceTemplateId, autocompleteScreenReaderInstructions }: { featureCollection: FeatureCollection; url: string; options: { layers: string[] }; autocompleteAnnounceTemplateId: ComboSearchProps['announceTemplateId']; autocompleteScreenReaderInstructions: ComboSearchProps['screenReaderInstructions']; }) { const [cadastreEnabled, setCadastreEnabled] = useState(false); const { featureCollection, error, ...actions } = useFeatureCollection( initialFeatureCollection, { url } ); return ( <>
Besoin d'aide ? consulter les tutoriels video
{error &&