demarches-normaliennes/app/javascript/components/MapReader/index.tsx
2022-02-09 10:29:00 +01:00

24 lines
658 B
TypeScript

import React from 'react';
import 'maplibre-gl/dist/maplibre-gl.css';
import type { FeatureCollection } from 'geojson';
import { MapLibre } from '../shared/maplibre/MapLibre';
import { CadastreLayer } from './components/CadastreLayer';
import { GeoJSONLayer } from './components/GeoJSONLayer';
const MapReader = ({
featureCollection,
options
}: {
featureCollection: FeatureCollection;
options: { layers: string[] };
}) => {
return (
<MapLibre layers={options.layers}>
<GeoJSONLayer featureCollection={featureCollection} />
<CadastreLayer featureCollection={featureCollection} />
</MapLibre>
);
};
export default MapReader;