registerEvent
Register a function for an unity event callback
Parameters
| Name | Type | Description |
|---|---|---|
| event | string | Event name |
| callback | Function | Callback function |
| userId | string | (optionnal) A custom user id. Allow you to delete all registered events with these id by calling "unregisterEventByUserId" |
Example
x
const fnoToken = "<YOUR-FNO-TOKEN>"; // provided by the backofficeconst fnoMapId = "<MAP-ID>" // id of the map to loadlet FnoMapManager;window.addEventListener("load", function(){ FnoMapManager = window.FnoMapManager; FnoMapManager.initViewerMode(fnoToken) FnoMapManager.loadMap(idMap, '3dMapContainer', function(){ FnoMapManager.registerEvent("mouseClickContainer", (data) => { // user clicked on a container in the 3d map console.log("Container clicked:", data) }); })});