Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:developer:3dmapping_sdk:viewer_state [2019/01/31 15:30]
pieter.bonne@orbitgt.com
dev:developer:3dmapping_sdk:viewer_state [2020/05/15 11:22]
jeroen removed
Line 8: Line 8:
  
 To listen for state changes, we listen to the ''onAppStateChanged'' signal of the viewer. Save state whenever it changes. To listen for state changes, we listen to the ''onAppStateChanged'' signal of the viewer. Save state whenever it changes.
 +
 +Below is a pseudocode example of storing application state in the browser's localStorage.
  
 <code javascript> <code javascript>
Line 15: Line 17:
 // Save state // Save state
 function handleAppStateChanged(state) { function handleAppStateChanged(state) {
-    window.localStorage.etItem("m3dviewer_state",state);+    window.localStorage.getItem("m3dviewer_state",state);
 } }
 </code> </code>
Line 24: Line 26:
  
 Startup options can be provided only once, on viewer construction. Startup options can be provided only once, on viewer construction.
 +
 +Below is a pseudocode example of restoring the application state using the state we have previously stored in the browser's localStorage.
  
 <code javascript> <code javascript>