activateHighlight method

void activateHighlight(
  1. List<Landmark> landmarks, {
  2. HighlightRenderSettings? renderSettings,
  3. int highlightId = 0,
})

Activates highlighting for a collection of landmarks with custom rendering.

Visually emphasizes the specified landmarks on the map using customizable rendering settings. Highlighted landmarks stand out from normal map content, useful for search results, route waypoints, or points of interest.

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

  • landmarks: The list of landmarks to highlight on the map
  • renderSettings: Customizes the visual appearance of highlighted landmarks (colors, sizes, icons). 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 activateHighlight(
  final List<Landmark> landmarks, {
  HighlightRenderSettings? renderSettings,
  final int highlightId = 0,
}) {
  renderSettings ??= HighlightRenderSettings();
  final LandmarkList landmarkList = LandmarkList.fromList(landmarks);

  objectMethod(
    _pointerId,
    'MapView',
    'activateHighlight',
    args: <String, dynamic>{
      'landmarks': landmarkList.pointerId,
      'renderSettings': renderSettings.toJson(),
      'highlightId': highlightId,
    },
  );
}