unregisterEventByName

Remove registered callback for a specific event name.

Parameters

Name

Type

Description

event

string

Name of the event to unregister. see all events

Example

You can attach as many function as you want to an event. For example, you can attach a callback to event "mouseClickContainer" in the load method.

FnoMapManager.loadMap(idMap, '3dMapContainer', function(){ FnoMapManager.registerEvent("mouseClickContainer", (data) => { console.log("Container clicked from loadMap method") }); })

On other component you want to show the name of the current selected container, you can attach function to "mouseClickContainer" again and get the name when container changed.

function RegisterContainerNameWhenClicked() { FnoMapManager.registerEvent("mouseClickContainer", (data) => { console.log("Container name:", data.container.name); }); }

Now, if you trigger "mouseClickContainer" event by clicking on an container in the 3D map, you will see this 2 rows in the console:

  • Container clicked from loadMap method

  • Container name: ABCDE

If you want to remove these 2 listeners, simply call unregisterEventByName method with the name of the event

FnoMapManager.unregisterEventByName("mouseClickContainer");