-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAdnViewerManager_Sample.html
More file actions
56 lines (55 loc) · 2.22 KB
/
AdnViewerManager_Sample.html
File metadata and controls
56 lines (55 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title Page</title>
<!-- Bootstrap CSS -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="viewerDiv">
</div>
<!-- Your HTML code -->
<!-- jquery -->
<script src="https://code.jquery.com/jquery-2.1.2.min.js"></script>
<!-- Bootstrap JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- Viewer -->
<link type="text/css" rel="stylesheet" href="https://developer.api.autodesk.com/viewingservice/v1/viewers/style.css"/>
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js"></script>
<script src="https://rawgit.com/Developer-Autodesk/library-javascript-view.and.data.api/master/js/Autodesk.ADN.Toolkit.Viewer.js"></script>
<script>
//replace with your own urn ...
var urn = 'urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFuaWVsZHV0ZXN0YnVja2V0MTEvU2VhdC5kd2Z4';
$(document).ready(function () {
var adnViewerMng = new Autodesk.ADN.Toolkit.Viewer.AdnViewerManager(
'https://still-spire-1606.herokuapp.com/api/token',
document.getElementById('viewerDiv'));
var paramUrn = Autodesk.Viewing.Private.getParameterByName('urn');
urn = (paramUrn !== '' ? paramUrn : urn);
if (urn.substring(0,4)!="urn:")
urn = 'urn:' + urn;
adnViewerMng.loadDocument(urn, onViewerInitialized, onError);
});
var onViewerInitialized = function(viewer)
{
//Now it's your turn to have fun with viewer client API...
//For example, you can get the camera of viewer
var camera = viewer.getCamera();
console.dir(camera);
};
var onError = function(error)
{
console.error(error);
};
</script>
</body>
</html>