Skip to content

Commit

Permalink
🔥 [open-formulieren/open-forms#2177] Removed old components
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmolen committed Dec 10, 2024
1 parent 6ec4582 commit 0099472
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions src/components/Map/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 ? <Marker position={position} {...props} /> : null;
};

MarkerWrapper.propTypes = {
position: PropTypes.arrayOf(PropTypes.number),
onMarkerSet: PropTypes.func,
};

const DisabledMapControls = () => {
const map = useMap();
useEffect(() => {
Expand All @@ -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;

0 comments on commit 0099472

Please sign in to comment.