Skip to main content
Element 3D Map can be driven from your own resources. Everything on this page is called on the client.

Contract

Opening and closing

Markers

The player card and tabs

The page exports are described separately in Pages.

Views

Described separately in Views.

Inputs

Opening

Open and Toggle take an optional view id, registered beforehand with RegisterView, and the parameters that view is to be shown with. Omitting the id uses the default view, which is the standard map unless SetDefaultView said otherwise. An id that was never registered opens nothing and says so in the console. SwitchView closes the map and opens it again on another view. Open on an open map does nothing, because the two views are two maps and one’s camera flight and markers are not the other’s. SetViewParams, PatchView and RefreshView act on the view that is on screen and do nothing when the map is closed. Following a view from another resource is not an export: register for the el:map:view:* hooks through the SDK. See Views. Open does nothing when the map is already open, while it is opening or closing, or when the player cannot see it: during the pause menu, while the screen is faded, and when the player is not loaded or is dead. Without a framework, “loaded” and “dead” are read from the game itself: the map opens for a connected player whose character is spawned and alive. SetEnabled turns the map on and off. While disabled, Toggle, Open and the toggle command do nothing, and a map that is open closes. IsEnabled reports the current state; the map starts enabled.

AddBlip options

Only coords is required. Position and appearance Labels and the legend Behaviour Shapes A marker with radius or areaWidth is a shape: it cannot be clicked or hovered, and it is never listed in the legend. Vision cone Every configured default above is listed in Markers.

SetBlipMeta

Attaches map information to a marker another resource created with the game’s own functions, so that marker gains a legend name, an icon, a cone and the rest.
handle is the marker handle the game returned. meta accepts name, icon, category, hiddenOnLegend, routeColor, radius, cone, coneColor, coneFov, coneRange, flashSpeed, number, priority, areaWidth, areaHeight, rgb and bright, with the meanings above. Calls are merged, so setting name and later setting category keeps both. A marker you coloured with SetBlipSecondaryColour is picked up on its own — the integration watches that function — and its colour is used while the marker’s colour index is 84 (BLIP_COLOUR_USE_COLOUR32), which is the same rule the game draws by. rgb here is for a marker whose colour the game never saw. This reaches only markers the map can see, which is what the integration is for. See Markers do not appear.

The player card

SetProfile replaces any of the three fields and leaves the others as they are. SetProfileName, SetProfileAvatar and SetProfileTags each set one. The player card can be turned off entirely. See Interface.

Pages

RegisterPage adds a tab beside the map’s own and the screen behind it. id must be unique; registering the same id twice replaces the first, and order decides the position. The map draws the page from the content you registered, and reports what the player does with it. Everything a page can contain is in Pages.

Outputs

ClearBlips removes only markers added through AddBlip. Markers mirrored from your other resources are not affected.

Errors

Coordinates without numeric x and y raise an error naming the product, and so does calling AddBlip with no coordinates or no options at all:
A missing z is not an error: it defaults to 0.0. Calling any export before element_map has started does nothing, because the export does not exist yet. Wait for el:map:ready. See Events. RemoveBlip with an unknown id, and Close while the map is closed, do nothing.

Example

Attaching map information to a marker created with the game’s own functions: