Zoom on a container when clicked
Zoom on a container when user clicked on it:
x
const fnoToken = "<YOUR-FNO-TOKEN>"; // provide from backoffice
const fnoMapId = "<MAP-ID>" // id of the map to load
let FnoMapManager;
window.addEventListener("load", function(){
FnoMapManager = window.FnoMapManager;
FnoMapManager.initViewerMode(fnoToken)
// enable mouse event listener
FnoMapManager.sendEvent('setMouseListener', {state: true});
// register on container clicked event
FnoMapManager.registerEvent("mouseClickContainer", (data) => {
// send zoom on container event with container id
FnoMapManager.sendEvent("zoomOnContainer", { id_container : data.container.id});
});
})
});