activateHighlight method
- List<
Landmark> landmarks, { - HighlightRenderSettings? renderSettings,
- 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 maprenderSettings: Customizes the visual appearance of highlighted landmarks (colors, sizes, icons). Ifnull, uses default rendering. Defaults tonullhighlightId: Unique identifier for this highlight collection. If a collection with this ID exists, it will be replaced. Defaults to0
See also:
- deactivateHighlight - Remove highlighting from a collection
- getHighlight - Retrieve highlighted landmarks
- getHighlightArea - Get geographic bounds of highlighted collection
- HighlightRenderSettings - Customize highlight appearance
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,
},
);
}