redrawBoundingBox static method

PolygonLayer<Object> redrawBoundingBox(
  1. LatLngBounds visibleBounds,
  2. double margin
)

Implementation

static PolygonLayer redrawBoundingBox(LatLngBounds visibleBounds, double margin) {
  return PolygonLayer(
    polygons: [
      Polygon(color: Colors.red.withAlpha(25),
      borderColor: Colors.red,
      borderStrokeWidth: 2,
      points: [
        LatLng(
          visibleBounds.northEast.latitude - margin,
          visibleBounds.northEast.longitude - margin,
        ),
        LatLng(
          visibleBounds.northWest.latitude - margin,
          visibleBounds.northWest.longitude + margin,
        ),
        LatLng(
          visibleBounds.southWest.latitude + margin,
          visibleBounds.southWest.longitude + margin,
        ),
        LatLng(
          visibleBounds.southEast.latitude + margin,
          visibleBounds.southEast.longitude - margin,
        ),
      ]),
    ],
  );
}