onClientMapStop
Context: mapmanager, client-side, argument resourceName. The reviewed provider dispatches this from its resource-stop handler before its own unloadMap call. It is a teardown notification, not a universal barrier proving every map-related asset and handler has finished cleanup.
// client.js: keep cleanup idempotent and specific to the map your feature uses.
on('onClientMapStop', (resourceName) => {
if (resourceName !== 'fd_lab_map_resource') return;
console.log('[Map observation] The watched map is stopping.');
});Replace the example name with the actual map resource you are observing. Remove only blips, timers or UI that your resource owns; do not delete unrelated entities because a map stopped. Pair initialization with an explicit current-state/restart path rather than assuming every consumer was listening when the map started.
Source: pinned mapmanager implementation . Related: map start, stock-event contracts.