Init3DViewerElements
This document lists changes in the engine to help you to migrate your code base.
+0.8.21
+ +-
+
- Init3DViewerElements must be called when the document is loaded and returns an array of the created EmbeddedViewer objects. Earlier it registered a load event handler inside, now it's the responsibility of the caller. +
0.8.21
-
diff --git a/docs/Page_Usage.html b/docs/Page_Usage.html
index 006c3d3..f61060f 100644
--- a/docs/Page_Usage.html
+++ b/docs/Page_Usage.html
@@ -92,12 +92,14 @@ There are two ways to use the library:
- environmentmapbg: Boolean ("true" or "false") to set the environment map as background.
After placing the elements, call the Init3DViewerElements function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.
+After placing the elements, call the Init3DViewerElements function to initalize all the viewers. It must be called after the document is loaded.
-// tell the engine where to find the libs folder
-OV.SetExternalLibLocation ('libs');
-// init all viewers on the page
-OV.Init3DViewerElements ();
+window.addEventListener ('load', () => {
+ // tell the engine where to find the libs folder
+ OV.SetExternalLibLocation ('libs');
+ // init all viewers on the page
+ OV.Init3DViewerElements ();
+});
Initialization from code
diff --git a/docs/source/MigrationGuide.html b/docs/source/MigrationGuide.html index 46cfa45..bd48c5d 100644 --- a/docs/source/MigrationGuide.html +++ b/docs/source/MigrationGuide.html @@ -2,6 +2,13 @@This document lists changes in the engine to help you to migrate your code base.
+0.8.21
+ +-
+
- {@link Init3DViewerElements} must be called when the document is loaded and returns an array of the created {@link EmbeddedViewer} objects. Earlier it registered a load event handler inside, now it's the responsibility of the caller. +
0.8.21
-
diff --git a/docs/source/Usage.html b/docs/source/Usage.html
index 4951a1d..1b66ed6 100644
--- a/docs/source/Usage.html
+++ b/docs/source/Usage.html
@@ -30,12 +30,14 @@ There are two ways to use the library:
- environmentmapbg: Boolean ("true" or "false") to set the environment map as background.
After placing the elements, call the {@link Init3DViewerElements} function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.
+After placing the elements, call the {@link Init3DViewerElements} function to initalize all the viewers. It must be called after the document is loaded.
-// tell the engine where to find the libs folder
-OV.SetExternalLibLocation ('libs');
-// init all viewers on the page
-OV.Init3DViewerElements ();
+window.addEventListener ('load', () => {
+ // tell the engine where to find the libs folder
+ OV.SetExternalLibLocation ('libs');
+ // init all viewers on the page
+ OV.Init3DViewerElements ();
+});