Skip to content

Commit

Permalink
refactor: removing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonlunn committed Sep 15, 2024
1 parent 61402ec commit 2b34491
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/components/maps/CoordinatePickerMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ export const CoordinatePickerMap: React.FC<CoordinatePickerMapProps> = ({
showFullscreenControl = true, initialCenter, onCoordinateConfirmed
}) => {
const initialZoom = 14
// const [viewState, setViewState] = useState<Pick<ViewState, 'longitude' | 'latitude' | 'zoom'>>({
// longitude: (initialCenter != null) ? initialCenter[0] : 0,
// latitude: (initialCenter != null) ? initialCenter[1] : 0,
// zoom: initialZoom
// })

const defaultCoords = { lng: 0, lat: 0 }
const [newSelectedCoord, setNewSelectedCoord] = useState<{ lng: number, lat: number }>(defaultCoords)
const [cursor, setCursor] = useState<string>('default')
Expand Down Expand Up @@ -80,14 +74,8 @@ export const CoordinatePickerMap: React.FC<CoordinatePickerMapProps> = ({
}
}, [updateCoordinates])

// const onMove = useCallback(({ viewState }: { viewState: ViewState }) => {
// setViewState(viewState)
// // updateCoordinates(viewState.longitude, viewState.latitude)
// }, [])

const handleClick = (event: any): void => {
const { lng, lat } = event.lngLat
// setNewSelectedCoord({ lng, lat })
updateCoordinates(lng, lat)
if (triggerButtonRef.current != null) {
triggerButtonRef.current.click()
Expand All @@ -114,7 +102,6 @@ export const CoordinatePickerMap: React.FC<CoordinatePickerMapProps> = ({
onDragEnd={() => {
setCursor('default')
}}
// onMove={onMove}
onClick={handleClick}
mapStyle={mapStyle}
cursor={cursor}
Expand Down

0 comments on commit 2b34491

Please sign in to comment.