Home > @magiclane/maps-sdk > GemMap

GemMap class

Signature:

export declare class GemMap extends GemView 

Extends: GemView

Constructors

Constructor

Modifiers

Description

(constructor)(canvas, pointerId, mapId)

Constructs a new instance of the GemMap class

Properties

Property

Modifiers

Type

Description

labelHoverProbingEnabled

boolean

Enable/disable the built-in label hover probing (default: enabled).

When enabled, every pointer move performs a native hover probe (highlightHoveredMapLabel) so the hovered-map-label callbacks fire. Applications that do not use those callbacks can disable it to remove the per-mousemove native round trip entirely. Disabling while a label is hovered ends the hover (callbacks receive null).

Methods

Method

Modifiers

Description

closeAllPopups()

Close every popup opened through showPopup.

collapseCluster()

Collapse an open spiderfy fan, if any.

dispose()

expandCluster(position, options)

Expand the marker cluster (points group) under position (PHYSICAL pixels — same convention as registerTouchCallback).

Two-mode expansion: when zooming in would visually separate the members, the camera animates to exactly that zoom, centered on the cluster. Otherwise — members within one pin-footprint or fully coincident — the members fan out in screen space around the cluster anchor (spiderfy), at most maxLeaves at a time with a "+N" paging leaf for the rest.

Requires the collection to be added with buildPointsGroupConfig: true (the engine's points-group queries back this API).

highlightHoveredMapLabel(screenPosition, { selectMapObject }, input)

Highlight the hovered map label under the given screen coordinates.

To turn off the hover highlight call the function with (0, 0) screen position

A recommended implementation is to call highlightHoveredMapLabel(..., selectMapObjects = false) to check if a label is hovered (and eventually update tracking device cursor shape etc) and if the cursor position is stationary for a reasonable time period (e.g. 500 ms) call highlightHoveredMapLabel(..., selectMapObjects = true) to retrieve the hovered map object data

showPopup(coords, content, options)

Open a popup anchored at coords. A STRING is treated as HTML (sanitize untrusted input); an HTMLElement is attached as-is. Multiple popups may be open simultaneously.