Created
October 30, 2015 14:31
-
-
Save leefsmp/8fb342f5176e1fc8383c to your computer and use it in GitHub Desktop.
Downloading View & Data model for offline viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lmv = new Lmv(config); | |
function onError(error) { | |
console.log("Error"); | |
console.log(error); | |
} | |
function onInitialized(response) { | |
// downloads package to target directory, | |
// creates recursively if not exists | |
lmv.download(urn, '.test/data/download').then( | |
onDataDownloaded, | |
onError | |
); | |
} | |
function onDataDownloaded(items) { | |
console.log('Model downloaded successfully'); | |
var path3d = items.filter(function(item){ | |
return item.type === '3d'; | |
}); | |
console.log('3D Viewable path:'); | |
console.log(path3d); | |
var path2d = items.filter(function(item){ | |
return item.type === '2d'; | |
}); | |
console.log('2D Viewable path:'); | |
console.log(path2d); | |
} | |
//start | |
lmv.initialize().then(onInitialized, onError); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment