getHighlightArea method
- int highlightId = 0,
Retrieves the geographic bounds of a highlighted collection.
Returns a RectangleGeographicArea representing the minimum bounding box that contains all elements in the specified highlight collection. This is useful for centering the map on highlighted content or calculating optimal view areas.
Returns null if the specified highlight collection doesn't exist or
contains no elements.
Parameters
highlightId: The ID of the highlight collection whose area to retrieve. Defaults to0
Returns
- RectangleGeographicArea with the bounds of the highlighted elements, or
nullif the collection doesn't exist
See also:
- activateHighlight - Activate highlighting for landmarks
- getOptimalHighlightCenterViewport - Calculate optimal viewport for highlights
Implementation
RectangleGeographicArea? getHighlightArea({final int highlightId = 0}) {
try {
final OperationResult resultString = objectMethod(
_pointerId,
'MapView',
'getHighlightArea',
args: highlightId,
);
return RectangleGeographicArea.fromJson(resultString['result']);
} catch (e) {
return null;
}
}