getHighlightArea method

RectangleGeographicArea? getHighlightArea({
  1. 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 to 0

Returns

See also:

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;
  }
}