highlightHoveredMapLabel method

GemError highlightHoveredMapLabel(
  1. Point<int> screenPosition, {
  2. bool selectMapObject = false,
})

Highlights a map label at the specified screen coordinates.

Detects and highlights any map label (street name, landmark name, etc.) at the given screen position. This is useful for implementing hover effects or tooltips when the user interacts with map labels.

To disable the hover highlight, call this method with screen position (0, 0).

Recommended implementation pattern:

  1. Call with selectMapObject = false to check if a label is hovered (for cursor shape updates or preliminary checks)
  2. If the cursor is stationary for a reasonable period (e.g., 500ms), call again with selectMapObject = true to retrieve full map object data

Parameters

  • screenPosition: The screen coordinates in physical pixels to check for hovered labels, relative to the map view's top-left corner
  • selectMapObject: If true and a label is hovered, map objects attached to the label are returned via GemMapController.registerOnHoveredMapLabelHighlightedLandmark. If false, no callback is issued. Defaults to false

Returns

See also:

Implementation

GemError highlightHoveredMapLabel(
  final Point<int> screenPosition, {
  final bool selectMapObject = false,
}) {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'MapView',
    'highlightHoveredMapLabel',
    args: <String, Object>{
      'pt': XyType<int>.fromPoint(screenPosition),
      'selectMapObjects': selectMapObject,
    },
  );

  return GemErrorExtension.fromCode(resultString['result']);
}