Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
206:viewer:sdk:examples_js:autologin_cloud [2020/06/23 11:22]
jeroen
206:viewer:sdk:examples_js:autologin_cloud [2020/07/13 11:51]
pieter
Line 1: Line 1:
 ====== Example loginOptions 3DM Cloud ====== ====== Example loginOptions 3DM Cloud ======
- 
  
 <html> <html>
-    <script src="https://cdn.3dmapping.cloud/19.6.0/javascript/orbitgt_3dm_sdk.js"></script> +<iframe width="850height="600frameborder="0src="https://cdn.3dmapping.cloud/20.7.0/javascript_examples/example11.html"/>
-    <div id="m3dviewer"/> +
- +
-    <script type="text/javascript"+
- +
-        var viewer; +
- +
-        var AMap orbitgt.mapping3d.sdk.viewer.AMap; +
-        var Constants = orbitgt.mapping3d.sdk.viewer.Constants; +
-        var SDKViewer = orbitgt.mapping3d.sdk.viewer.SDKViewer; +
-         +
-        console.log(Constants); +
- +
-        /** +
-         * Called when the viewer component is ready for interaction. +
-         */ +
-        function handleReady() { +
-            // Listen to the state-changed signal +
-            viewer.onAppStateChanged.add(handleAppStateChanged); +
-        } +
- +
-        /** +
-         * Called when the page is full loaded. +
-         */ +
-        function handleDOMReady() { +
-            // Create viewer startup options +
-            var loginOptions = new AMap(); +
-            loginOptions.set(Constants.LOGIN_MODE, Constants.LOGINMODE_GUEST_CLOUD); +
-            loginOptions.set(Constants.LOGIN_PUBLICATION_PUBLIC_ID, "CldMRasjNYPbnBQcyo3A"); +
-            var options = new AMap(); +
-            options.set(Constants.STARTUP_AUTO_LOGIN,loginOptions); +
-            // Create viewer +
-            var appElement = document.getElementById("m3dviewer"); +
-            viewer = new SDKViewer("example application",appElement,options); +
-            viewer.setSize(1000,500); +
-            viewer.isReady.then(handleReady); +
-        } +
- +
-        // Wait for page to load +
-        document.addEventListener("DOMContentLoaded", handleDOMReady); +
- +
-   </script>+
 </html> </html>
 
Last modified:: 2020/07/13 11:56