bounds property

Future<List<double?>?> get bounds

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL. Default value: -180,-85.051129,180,85.051129.

Implementation

Future<List<double?>?> get bounds async {
  final localStyle = style;
  if (localStyle == null) return null;
  final raw = (await localStyle.getStyleSourceProperty(id, "bounds")).value;
  if (raw == null) return null;
  return (raw as List<dynamic>).cast();
}