1 - Loading a map
This basic example shows the minimum necessary to load a map.
Map Viewer
Code
| // ---- LOADING MODULE ----
DVM.loadModule("map_viewer", {
container: "viewer-container" // Container where the viewer will be appended
})
.then(function(viewer) {
console.log(`Module '${viewer.getModuleName()}' initialized:`, viewer);
start(viewer);
})
.catch(function(err) {
console.error(err);
});
function start(viewer) {
// ---- LOADING MAP ----
viewer.loadMap({
venue_id: "eu-es-00008-default", // Venue to be loaded. 3ddigitalvenue will provide these IDs
// map_id: "main" // Map id. "main" by default. Not necessary in this case.
})
.then(function(obj) {
// Successfully loaded
console.log("LOADED!");
})
.catch(function(err) {
// Error while loading
console.error(err);
});
}
|