-
Notifications
You must be signed in to change notification settings - Fork 16
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
Changes from all commits
0c2b7dd
a47f218
fedd24e
002597c
ee01bed
539fb74
f528f62
35a792f
daf607f
2b9425a
3b5641e
4d81418
ce313c4
2a5bdaf
0537105
48e27c9
ecf7b5d
10c380b
0318f5d
f737bca
0baca5c
f2b07a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const MapContainer = ({ children }) => <div data-testid="MapContainer">{children}</div>; | ||
|
||
const useMap = () => ({ fitBounds: () => {} }); | ||
|
||
const TileLayer = () => <div data-testid="TileLayer" />; | ||
|
||
const Marker = ({ children }) => <div data-testid="Marker">{children}</div>; | ||
|
||
const Popup = () => <div data-testid="Popup" />; | ||
|
||
export { MapContainer, TileLayer, Marker, Popup, useMap }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
import MapContainer from 'components/Map/SearchMap/MapContainer'; | ||
import MoveHandler from 'components/Map/SearchMap/MoveHandler'; | ||
import SearchMapChildrens from 'components/Map/SearchMap/SearchMapChildrens'; | ||
import { LatLngBounds } from 'leaflet'; | ||
import React from 'react'; | ||
import { ScaleControl } from 'react-leaflet'; | ||
import 'leaflet/dist/leaflet.css'; | ||
|
||
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'; | ||
|
||
Comment on lines
+5
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes maybe 👀 😅 |
||
export type PropsType = { | ||
segments?: { x: number; y: number }[]; | ||
|
@@ -41,7 +40,7 @@ const SearchMap: React.FC<PropsType> = props => { | |
<MapContainer whenCreated={setMapInstance} hasZoomControl={props.hasZoomControl}> | ||
{props.onMove && <MoveHandler onMove={props.onMove} />} | ||
<TileLayerManager /> | ||
<BackButton icon={<ArrowLeft size={24} />} onClick={hideMap} /> | ||
<BackButton icon={<ArrowLeft size={18} />} onClick={hideMap} /> | ||
<FilterButton openFilterMenu={props.openFilterMenu} /> | ||
{props.hasZoomControl === true && <FullscreenControl />} | ||
<ResetView /> | ||
|
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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 bywhenReady
but it's not really the same callback function.When React-leaflet shipped version 4, the release note explicitly wrote: