OptionalcursorOnMap?: CSSCursorThe cursor to show on the map canvas when not interacting with any handled features.
OptionalcursorOnMouseDown?: CSSCursorThe cursor to show while clicking (mouse down).
OptionallongHoverDelayAfterMapMoveMS?: numberThe delay, in milliseconds, before a long-hover event fires when the map has just moved.
OptionallongHoverDelayOnStillMapMS?: numberThe delay, in milliseconds, before a long-hover event fires when the map has stayed still since the last long hover.
OptionalpaddingBoxPx?: numberThe padding box around the event point, in pixels.
OptionalprecisionMode?: "box" | "point" | "point-then-box"The precision mode for the event coordinates.
box - Queries features within a padding box around the event point (default).point - Queries features at the exact event point, the most precise mode.point-then-box - Tries point first, then falls back to box if it finds nothing.box suits general use, as small features are easier to click. point suits
dense, overlapping features. point-then-box balances precision and usability.
These settings affect all interactive map modules (places, POIs, routes, etc.). Tune them to your use case for a better user experience.
// Default configuration for desktop
const config: MapEventsConfig = {
precisionMode: 'box',
paddingBoxPx: 5,
cursorOnHover: 'pointer',
longHoverDelayOnStillMapMS: 300,
hoverGracePeriodMS: 400
};
// Mobile-optimized with larger hit area
const mobileConfig: MapEventsConfig = {
precisionMode: 'box',
paddingBoxPx: 15, // Larger touch targets
longHoverDelayAfterMapMoveMS: 1000
};
// Precise picking for dense data
const preciseConfig: MapEventsConfig = {
precisionMode: 'point', // Exact pixel matching
cursorOnHover: 'crosshair'
};
The options for how the map handles user events.
They control how clicks and hovers are detected and processed, including precision modes, cursor styles and timing.