Some maps that use the blockmap-seatmap map typology have extra sections
on the seatmaps that allow you to load neighbor seatmaps. Those sections have the special node type "section_nh".
import{loadModule}from"@3ddv/dvm";constvenue_id="nam-us-10169-orioles";consttopview="blockmap";loadModule("map_viewer",{container:"viewer-container",styles_by_groups:true,instanced_nodes:true,}).then((viewer)=>{window.viewer=viewer;start(viewer);}).catch((err)=>{console.error(err);});functionstart(viewer){constbtn_back=document.getElementById("btn-back");btn_back.addEventListener("click",()=>goBack());// Just for the example purposeviewer.flags.scroll_with_mod_key=true;viewer.subscribe("load_success",(_obj)=>{setRandomAvailability();});viewer.subscribe("load_error",(err)=>{console.error(err);});viewer.subscribe("click",(obj)=>{constnode=obj.nodes[0];if(node){switch(node.type){case"section":case"section_nh":loadOnClick(node);break;}}});// Start map-viewervoidviewer.loadMap({venue_id,map_id:topview});functionloadOnClick(node){// Load a map with node.id if it is available and it is not already loadedif(node.state==="available"&&node.id!==viewer.getMapId()){voidviewer.loadMap({venue_id,map_id:node.id});}}// Go back to the topview if it is not already loadedfunctiongoBack(){if(viewer.getMapId()!==topview){voidviewer.loadMap({venue_id,map_id:topview});}}// Just for the purpose of having some random availability on the mapfunctionsetRandomAvailability(prob=0.6){if(viewer&&viewer.isLoaded()){viewer.getTypesList().forEach((type)=>{constavailability=viewer.getNodesByType(type).filter(()=>Math.random()<prob);viewer.setAvailability(type,availability);});}}}