Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the whole leaflet ecosystem #1258

Merged
merged 22 commits into from
Oct 2, 2024
Merged

Update the whole leaflet ecosystem #1258

merged 22 commits into from
Oct 2, 2024

Conversation

dtrucs
Copy link
Collaborator

@dtrucs dtrucs commented Sep 19, 2024

ref #1219

  • Bump react-leaflet from 3.1.0 to 4.2.1
  • Replace react-leaflet-markercluster by next-leaflet-cluster package
  • Bump @types/leaflet from 1.7.5 to 1.9.12
  • Bump @raruto/leaflet-elevation from 1.7.0 to 1.9.0
  • Bump leaflet.offline from 3.0.1 to 3.1.0
  • Bump @20tab/react-leaflet-resetview from 1.0.1 to 1.1.0

@dtrucs dtrucs requested a review from a team September 19, 2024 13:51
@@ -18,7 +18,7 @@ const MapContainer: React.FC<Props> = ({ children, whenCreated, hasZoomControl =
center={mapConfig.searchMapCenter as [number, number]}
zoom={mapConfig.searchMapZoom}
maxZoom={mapConfig.maximumZoomLevel}
whenCreated={whenCreated}
ref={whenCreated}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it kinda weird having a function as ref props?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, since Leaflet 1.9 (I'm not sure of the version), the whenCreated prop has been replaced by whenReady but it's not really the same callback function.
When React-leaflet shipped version 4, the release note explicitly wrote:

Removed whenCreated property from the MapContainer component (a ref callback can be used instead).

Comment on lines +5 to +15
import MapContainer from 'components/Map/SearchMap/MapContainer';
import MoveHandler from 'components/Map/SearchMap/MoveHandler';
import SearchMapChildrens from 'components/Map/SearchMap/SearchMapChildrens';
import { ArrowLeft } from 'components/Icons/ArrowLeft';
import { useTileLayer } from 'hooks/useTileLayer';
import { BackButton } from '../components/BackButton';
import { FilterButton } from '../components/FilterButton';
import { ResetView } from '../components/ResetView';
import TileLayerManager from '../components/TileLayerManager';
import FullscreenControl from '../components/FullScreenControl';
import LocateControl from '../components/LocateControl';
import { BackButton } from 'components/Map/components/BackButton';
import { FilterButton } from 'components/Map/components/FilterButton';
import { ResetView } from 'components/Map/components/ResetView';
import TileLayerManager from 'components/Map/components/TileLayerManager';
import FullscreenControl from 'components/Map/components/FullScreenControl';
import LocateControl from 'components/Map/components/LocateControl';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching from relative paths to aliased path do not seams directly related to "Leaflet ecosystem".
Maybe should it have been done in a another dedicated PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes maybe 👀 😅

@dtrucs dtrucs changed the base branch from main to develop October 2, 2024 07:50
@dtrucs dtrucs merged commit 7ad9bce into develop Oct 2, 2024
2 checks passed
@dtrucs dtrucs deleted the Upgrade-react-leaflet branch October 2, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants