Skip to content

Commit

Permalink
Do not parse viewState from localStorage so only hash controls it
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-chemla committed Jul 19, 2024
1 parent e7f984a commit bc76fd6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,14 @@ function App(props): React.ReactElement {
const [basemapStyle, setBasemapStyle]: [string, any] = useLocalStorage('UI_map_basemapStyle', 'satellite-streets-v11')
const [rasterOpacity, setRasterOpacity] = useLocalStorage('UI_rasterOpacity', 0.8)
const [splitPanelSizesPercent, setSplitPanelSizesPercent] = useLocalStorage('UI_splitPanelSizesPercent', [75, 25])
const [viewState, setViewState] = useLocalStorage('UI_map_viewState', defaultViewStateNaturalearth, false)

// const [viewState, setViewState] = useLocalStorage('UI_map_viewState', defaultViewStateNaturalearth, false)
const [viewState, setViewState] = React.useState({
zoom: 3,
latitude: 0,
longitude: 0,
pitch: 0,
});

React.useEffect( () => {
const hash = window.location.hash;
let hashed_viewstate = hash
Expand Down

0 comments on commit bc76fd6

Please sign in to comment.