Skip to content

Commit

Permalink
🔥 [open-formulieren/open-forms#2177] Removing old map marker function…
Browse files Browse the repository at this point in the history
…ality
  • Loading branch information
robinmolen committed Dec 10, 2024
1 parent a2907b8 commit 1bf3f6f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/components/Map/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {GeoSearchControl} from 'leaflet-geosearch';
import isEqual from 'lodash/isEqual';
import PropTypes from 'prop-types';
import React, {useCallback, useContext, useEffect} from 'react';
import {defineMessages, useIntl} from 'react-intl';
Expand Down Expand Up @@ -71,12 +70,6 @@ const LeaftletMap = ({
const defaultCoordinates = useDefaultCoordinates();
const coordinates = markerCoordinates || defaultCoordinates;

const onWrapperMarkerSet = coordinates => {
const coordinatesChanged = !isEqual(markerCoordinates, coordinates);
if (!coordinatesChanged) return;
onMarkerSet(coordinates);
};

const modifiers = disabled ? ['disabled'] : [];
const className = getBEMClassName('leaflet-map', modifiers);

Expand All @@ -103,7 +96,6 @@ const LeaftletMap = ({
{coordinates ? (
<>
<MapView coordinates={coordinates} />
<MarkerWrapper position={coordinates} onMarkerSet={onWrapperMarkerSet} />
</>
) : null}
<SearchControl
Expand All @@ -120,7 +112,7 @@ const LeaftletMap = ({
notFoundMessage: intl.formatMessage(searchControlMessages.notFound),
}}
/>
{disabled ? <DisabledMapControls /> : <CaptureClick setMarker={onMarkerSet} />}
{/*{disabled ? <DisabledMapControls /> : <CaptureClick setMarker={onMarkerSet} />}*/}
</MapContainer>
{markerCoordinates && markerCoordinates.length && (
<NearestAddress coordinates={markerCoordinates} />
Expand Down

0 comments on commit 1bf3f6f

Please sign in to comment.