activateHighlightOverlayItems method

void activateHighlightOverlayItems(
  1. List<OverlayItem> overlayItems, {
  2. HighlightRenderSettings? renderSettings,
  3. int highlightId = 0,
})

Activates highlighting for a collection of overlay items with custom rendering.

Visually emphasizes the specified overlay items on the map using customizable rendering settings. This is useful for highlighting user-added content, selected items, or interactive elements.

Each highlight collection is identified by a unique ID. If a collection with the specified ID already exists, it will be replaced. Multiple collections can coexist and are rendered in ascending order by highlight ID.

Parameters

  • overlayItems: The list of overlay items to highlight on the map
  • renderSettings: Customizes the visual appearance of highlighted overlay items. If null, uses default rendering. Defaults to null
  • highlightId: Unique identifier for this highlight collection. If a collection with this ID exists, it will be replaced. Defaults to 0

See also:

Implementation

void activateHighlightOverlayItems(
  final List<OverlayItem> overlayItems, {
  final HighlightRenderSettings? renderSettings,
  final int highlightId = 0,
}) {
  final OverlayItemList landmarkList = OverlayItemList.fromList(overlayItems);

  objectMethod(
    _pointerId,
    'MapView',
    'activateHighlightOverlayItems',
    args: <String, dynamic>{
      'landmarks': landmarkList.pointerId,
      if (renderSettings != null) 'renderSettings': renderSettings.toJson(),
      'highlightId': highlightId,
    },
  );
}