@@ -11,7 +11,6 @@ import {
1111 getQueryStore ,
1212 getRouteStore ,
1313 getSettingsStore ,
14- getCurrentLocationStore ,
1514} from '@/stores/Stores'
1615import MapComponent from '@/map/MapComponent'
1716import MapOptions from '@/map/MapOptions'
@@ -23,7 +22,6 @@ import { QueryStoreState, RequestState } from '@/stores/QueryStore'
2322import { RouteStoreState } from '@/stores/RouteStore'
2423import { MapOptionsStoreState } from '@/stores/MapOptionsStore'
2524import { ErrorStoreState } from '@/stores/ErrorStore'
26- import { CurrentLocationStoreState } from '@/stores/CurrentLocationStore'
2725import Search from '@/sidebar/search/Search'
2826import ErrorMessage from '@/sidebar/ErrorMessage'
2927import useBackgroundLayer from '@/layers/UseBackgroundLayer'
@@ -47,7 +45,6 @@ import useExternalMVTLayer from '@/layers/UseExternalMVTLayer'
4745import LocationButton from '@/map/LocationButton'
4846import { SettingsContext } from '@/contexts/SettingsContext'
4947import usePOIsLayer from '@/layers/UsePOIsLayer'
50- import useCurrentLocationLayer from '@/layers/UseCurrentLocationLayer'
5148
5249export const POPUP_CONTAINER_ID = 'popup-container'
5350export const SIDEBAR_CONTENT_ID = 'sidebar-content'
@@ -62,7 +59,6 @@ export default function App() {
6259 const [ pathDetails , setPathDetails ] = useState ( getPathDetailsStore ( ) . state )
6360 const [ mapFeatures , setMapFeatures ] = useState ( getMapFeatureStore ( ) . state )
6461 const [ pois , setPOIs ] = useState ( getPOIsStore ( ) . state )
65- const [ currentLocation , setCurrentLocation ] = useState ( getCurrentLocationStore ( ) . state )
6662
6763 const map = getMap ( )
6864
@@ -76,7 +72,6 @@ export default function App() {
7672 const onPathDetailsChanged = ( ) => setPathDetails ( getPathDetailsStore ( ) . state )
7773 const onMapFeaturesChanged = ( ) => setMapFeatures ( getMapFeatureStore ( ) . state )
7874 const onPOIsChanged = ( ) => setPOIs ( getPOIsStore ( ) . state )
79- const onCurrentLocationChanged = ( ) => setCurrentLocation ( getCurrentLocationStore ( ) . state )
8075
8176 getSettingsStore ( ) . register ( onSettingsChanged )
8277 getQueryStore ( ) . register ( onQueryChanged )
@@ -87,7 +82,6 @@ export default function App() {
8782 getPathDetailsStore ( ) . register ( onPathDetailsChanged )
8883 getMapFeatureStore ( ) . register ( onMapFeaturesChanged )
8984 getPOIsStore ( ) . register ( onPOIsChanged )
90- getCurrentLocationStore ( ) . register ( onCurrentLocationChanged )
9185
9286 onQueryChanged ( )
9387 onInfoChanged ( )
@@ -97,7 +91,6 @@ export default function App() {
9791 onPathDetailsChanged ( )
9892 onMapFeaturesChanged ( )
9993 onPOIsChanged ( )
100- onCurrentLocationChanged ( )
10194
10295 return ( ) => {
10396 getSettingsStore ( ) . deregister ( onSettingsChanged )
@@ -109,7 +102,6 @@ export default function App() {
109102 getPathDetailsStore ( ) . deregister ( onPathDetailsChanged )
110103 getMapFeatureStore ( ) . deregister ( onMapFeaturesChanged )
111104 getPOIsStore ( ) . deregister ( onPOIsChanged )
112- getCurrentLocationStore ( ) . deregister ( onCurrentLocationChanged )
113105 }
114106 } , [ ] )
115107
@@ -124,7 +116,6 @@ export default function App() {
124116 useQueryPointsLayer ( map , query . queryPoints )
125117 usePathDetailsLayer ( map , pathDetails )
126118 usePOIsLayer ( map , pois )
127- useCurrentLocationLayer ( map , currentLocation )
128119
129120 const isSmallScreen = useMediaQuery ( { query : '(max-width: 44rem)' } )
130121 return (
@@ -147,7 +138,6 @@ export default function App() {
147138 error = { error }
148139 encodedValues = { info . encoded_values }
149140 drawAreas = { settings . drawAreasEnabled }
150- currentLocation = { currentLocation }
151141 />
152142 ) : (
153143 < LargeScreenLayout
@@ -158,7 +148,6 @@ export default function App() {
158148 error = { error }
159149 encodedValues = { info . encoded_values }
160150 drawAreas = { settings . drawAreasEnabled }
161- currentLocation = { currentLocation }
162151 />
163152 ) }
164153 </ div >
@@ -174,10 +163,9 @@ interface LayoutProps {
174163 error : ErrorStoreState
175164 encodedValues : object [ ]
176165 drawAreas : boolean
177- currentLocation : CurrentLocationStoreState
178166}
179167
180- function LargeScreenLayout ( { query, route, map, error, mapOptions, encodedValues, drawAreas, currentLocation } : LayoutProps ) {
168+ function LargeScreenLayout ( { query, route, map, error, mapOptions, encodedValues, drawAreas } : LayoutProps ) {
181169 const [ showSidebar , setShowSidebar ] = useState ( true )
182170 const [ showCustomModelBox , setShowCustomModelBox ] = useState ( false )
183171 return (
@@ -228,7 +216,7 @@ function LargeScreenLayout({ query, route, map, error, mapOptions, encodedValues
228216 < div className = { styles . popupContainer } id = { POPUP_CONTAINER_ID } />
229217 < div className = { styles . onMapRightSide } >
230218 < MapOptions { ...mapOptions } />
231- < LocationButton queryPoints = { query . queryPoints } currentLocation = { currentLocation } />
219+ < LocationButton queryPoints = { query . queryPoints } />
232220 </ div >
233221 < div className = { styles . map } >
234222 < MapComponent map = { map } />
@@ -241,7 +229,7 @@ function LargeScreenLayout({ query, route, map, error, mapOptions, encodedValues
241229 )
242230}
243231
244- function SmallScreenLayout ( { query, route, map, error, mapOptions, encodedValues, drawAreas, currentLocation } : LayoutProps ) {
232+ function SmallScreenLayout ( { query, route, map, error, mapOptions, encodedValues, drawAreas } : LayoutProps ) {
245233 return (
246234 < >
247235 < div className = { styles . smallScreenSidebar } >
@@ -260,7 +248,7 @@ function SmallScreenLayout({ query, route, map, error, mapOptions, encodedValues
260248 < div className = { styles . smallScreenMapOptions } >
261249 < div className = { styles . onMapRightSide } >
262250 < MapOptions { ...mapOptions } />
263- < LocationButton queryPoints = { query . queryPoints } currentLocation = { currentLocation } />
251+ < LocationButton queryPoints = { query . queryPoints } />
264252 </ div >
265253 </ div >
266254
0 commit comments