File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1014,18 +1014,22 @@ app.ontoolinput = async (params) => {
10141014 }
10151015
10161016 if ( bbox ) {
1017- // Mark that we received explicit tool input (overrides persisted state)
10181017 hasReceivedToolInput = true ;
10191018
1020- // Store initial bbox for home button (first tool input becomes the "home" view)
1019+ // Store tool input bbox for home button (first tool input becomes the "home" view)
10211020 if ( ! initialBoundingBox ) {
10221021 initialBoundingBox = bbox ;
10231022 }
10241023
1025- log . info ( "Positioning camera to bbox:" , bbox ) ;
1026-
1027- // Position camera instantly (no animation)
1028- setViewToBoundingBox ( viewer , bbox ) ;
1024+ // Check if we have a persisted view state - if so, use it instead of tool input
1025+ const persistedState = loadPersistedViewState ( ) ;
1026+ if ( persistedState ) {
1027+ log . info ( "[ViewState] using persisted view instead of tool input" ) ;
1028+ restorePersistedView ( viewer ) ;
1029+ } else {
1030+ log . info ( "Positioning camera to tool input bbox:" , bbox ) ;
1031+ setViewToBoundingBox ( viewer , bbox ) ;
1032+ }
10291033
10301034 // Wait for tiles to load at this location
10311035 await waitForTilesLoaded ( viewer ) ;
You can’t perform that action at this time.
0 commit comments