diff --git a/src/components/Map/index.jsx b/src/components/Map/index.jsx index 9b27e6b04..07a7753ce 100644 --- a/src/components/Map/index.jsx +++ b/src/components/Map/index.jsx @@ -69,7 +69,7 @@ const LeaftletMap = ({ defaultCenter = DEFAULT_LAT_LNG, defaultZoomLevel = DEFAULT_ZOOM, disabled = false, - interactions, + interactions = {marker: true}, }) => { const ref = useRef(); const intl = useIntl(); @@ -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;