Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
![Platforms](https://img.shields.io/badge/platform-windows%20%7C%20osx%20%7C%20linux-lightgray.svg)
[![License](http://img.shields.io/:license-mit-blue.svg)](http://opensource.org/licenses/MIT)

[![oAuth2](https://img.shields.io/badge/oAuth2-v1-green.svg)](http://developer.autodesk.com/)
[![Viewer](https://img.shields.io/badge/Viewer-v3.3-green.svg)](http://developer.autodesk.com/)
[![oAuth2](https://img.shields.io/badge/oAuth2-v1-green.svg)](http://forge.autodesk.com/)
[![Viewer](https://img.shields.io/badge/Viewer-v7-green.svg)](http://forge.autodesk.com/)

## Description

Expand Down Expand Up @@ -78,4 +78,3 @@ Please see the [LICENSE](LICENSE) file for full details.
Jaime Rosales D. <br />
[![Twitter Follow](https://img.shields.io/twitter/follow/afrojme.svg?style=social&label=Follow)](https://twitter.com/AfroJme) <br />Forge Partner Development <br />
<a href="http://developer.autodesk.com/">Forge Developer Portal</a> <br />

54 changes: 34 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "https://github.com/Autodesk-Forge/viewer-react-express-headless/issues"
},
"dependencies": {
"axios": "^0.15.2",
"axios": "^0.19.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-preset-es2015": "6.3.13",
Expand Down
6 changes: 3 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="apple-touch-icon" href="%PUBLIC_URL%/images/forge-icon.png">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!-- The Viewer CSS -->
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/style.min.css" type="text/css">
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/style.min.css?v=v7.*" type="text/css">

<!--
Notice the use of %PUBLIC_URL% in the tag above.
Expand All @@ -23,7 +23,7 @@
</head>
<body>
<!-- The Viewer JS -->
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/viewer3D.js?v=v5.0"></script>
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/viewer3D.min.js?v=v7.*"></script>
<div id="root"></div>

<!--
Expand All @@ -37,4 +37,4 @@
To create a production bundle, use `npm run build`.
-->
</body>
</html>
</html>
10 changes: 3 additions & 7 deletions src/components/Viewer/Viewer-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ function loadDocument(documentId){
Autodesk.Viewing.Document.load(
documentId,
function (doc) { // onLoadCallback
var geometryItems = Autodesk.Viewing.Document.getSubItemsWithProperties(doc.getRootItem(), {'type':'geometry'}, true);
if (geometryItems.length > 0) {
geometryItems.forEach(function (item, index) {
});

viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, onGeometryLoaded);
viewer.addEventListener(Autodesk.Viewing.AGGREGATE_SELECTION_CHANGED_EVENT, debounce(() => {
console.log('selection change')
Expand All @@ -82,8 +79,7 @@ function loadDocument(documentId){
)
}), 200);

viewer.load(doc.getViewablePath(geometryItems[0])); // show 1st view on this document...
}
viewer.loadDocumentNode(doc, doc.getRoot().getDefaultGeometry()); // show 1st view on this document...
},
function (errorMsg) { // onErrorCallback
console.log(errorMsg);
Expand Down Expand Up @@ -286,4 +282,4 @@ const Helpers = {
loadDocument
};

export default Helpers;
export default Helpers;