Skip to main content
All events on this page are client-side and local to the client. Use AddEventHandler to listen and TriggerEvent to raise.

Contract

Raised by the map

Listened for by the map

A view also reports itself through the SDK’s hooks — el:map:view:open, el:map:view:ready, el:map:view:close and el:map:view:params — which is where a resource takes part rather than only being told. el:map:view:open is the one that can refuse an open. See Views. The four listened-for events are what the map’s integration uses. Raising them yourself is supported, and is the alternative to SetBlipMeta when your code cannot reach the export.

Inputs

The page events carry the id you gave RegisterPage. Compare against your own id: every registered page raises the same events. The fields table of el:map:blip:meta accepts the same keys as SetBlipMeta. See Exports. Repeated calls for one marker are merged.

Outputs

el:map:open is raised as the map starts opening, so a handler runs before the camera has finished moving. Use it to prepare state, not to assume the map is on screen. el:map:close is raised in every case the map stops being open: the player closed it, the player died, or the resource was stopped. It is also raised if opening failed part way through, so an el:map:open handler is always followed by an el:map:close handler. el:map:open carries the id of the view being opened, so a handler can tell the standard map from a view of its own without asking. el:map:view:leave is raised for every view that leaves the screen, including when the map closes and when a resource stop takes it down. el:map:ready is raised once per resource start. A resource that starts after the map has already started never sees it. Use GetResourceState('element_map') in that case.

Errors

None of these events report failure. An unknown marker handle is ignored, and an unregistered page id never occurs in the page events because the map only raises ids it was given.

While the map is open

The integration changes one thing in your other resources: while the map is open, the game’s pause-menu check reports that the pause menu is active. The map takes the place of the pause map, so code that pauses on the pause menu behaves the same way for the map. This applies inside every resource the integration was installed into, and only while the map is open. If a resource of yours must tell the two apart, listen for el:map:open and el:map:close and track it yourself. See Product integrations for what the integration is and how to install it.

Example

Waiting for the map to be ready, then registering a page and reacting to it:
The content of a page and what it reports are described in Pages. Pausing your own work while the map is open:
Attaching information to a marker without calling the export: