focusOnFeatureSet method

Future<void> focusOnFeatureSet({
  1. VoyagerFeatureSet? featureSet,
  2. double padding = 100.0,
})

Implementation

Future<void> focusOnFeatureSet({
  VoyagerFeatureSet? featureSet,
  double padding = 100.0,
}) async {
  try {
    await _mapBloc.isMapReady.future;
    await Future.delayed(
      const Duration(seconds: 1),
      () => _mapBloc.googleMapController.animateCamera(
        CameraUpdate.newLatLngBounds(
            (featureSet ?? getVoyagerFeatureSet()).getBoundsForFeatureSet()!,padding),
      ),
    );
  } catch (e) {
    log("Error!!! Unable to focus to feature set");
  }
}