From 172ffd02aa09a03732459e2fb3e0e39a6c63a302 Mon Sep 17 00:00:00 2001 From: robinvandermolen Date: Tue, 10 Dec 2024 12:41:02 +0100 Subject: [PATCH] :fire: [open-formulieren/open-forms#2177] Removed old components --- src/components/Map/index.jsx | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/src/components/Map/index.jsx b/src/components/Map/index.jsx index 9b27e6b04..73adf5513 100644 --- a/src/components/Map/index.jsx +++ b/src/components/Map/index.jsx @@ -3,9 +3,9 @@ import 'leaflet-draw/dist/leaflet.draw.css'; import {GeoSearchControl} from 'leaflet-geosearch'; import 'leaflet/dist/leaflet.css'; import PropTypes from 'prop-types'; -import React, {useCallback, useContext, useEffect, useRef} from 'react'; +import React, {useContext, useEffect, useRef} from 'react'; import {defineMessages, useIntl} from 'react-intl'; -import {FeatureGroup, MapContainer, Marker, TileLayer, useMap, useMapEvent} from 'react-leaflet'; +import {FeatureGroup, MapContainer, TileLayer, useMap} from 'react-leaflet'; import {EditControl} from 'react-leaflet-draw'; import {useGeolocation} from 'react-use'; @@ -292,24 +292,6 @@ SearchControl.propTypes = { }), }; -const MarkerWrapper = ({position, onMarkerSet, ...props}) => { - const shouldSetMarker = !!(position && position.length === 2); - - useEffect(() => { - if (!shouldSetMarker) return; - if (!onMarkerSet) return; - onMarkerSet(position); - }); - - // only render a marker if we explicitly have a marker - return shouldSetMarker ? : null; -}; - -MarkerWrapper.propTypes = { - position: PropTypes.arrayOf(PropTypes.number), - onMarkerSet: PropTypes.func, -}; - const DisabledMapControls = () => { const map = useMap(); useEffect(() => { @@ -324,16 +306,4 @@ const DisabledMapControls = () => { return null; }; -const CaptureClick = ({setMarker}) => { - useMapEvent('click', event => { - const newLatLng = [event.latlng.lat, event.latlng.lng]; - setMarker(newLatLng); - }); - return null; -}; - -CaptureClick.propTypes = { - setMarker: PropTypes.func.isRequired, -}; - export default LeaftletMap;