Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_google_street_view] There is no callback to know if the street view is not available for a location. #2

Closed
skyloovportal opened this issue Sep 30, 2021 · 2 comments

Comments

@skyloovportal
Copy link

Hey, I really appreciate your efforts but i would like to request for an update i.e If there is no street view available for a specific location please provide a callback in platform view in order to show a valid response to the user.

Thanks

@zyzdev
Copy link
Owner

zyzdev commented Oct 3, 2021

Hi, @skyloovportal
Callback onPanoramaChangeListener can solve it.
onPanoramaChangeListener callback function is
void Function(StreetViewPanoramaLocation? location, Exception? e){}
and the Exception? e will not be null while the street view invalid.
Try the code shown below.

const LatLng INVALID = LatLng(-45.125783, 151.276417);

FlutterGoogleStreetView(
  initPos: INVALID,
  onPanoramaChangeListener: (location, e) {
    print("location:$location, e:$e");
  },
);

//log
location:null, e:Exception: Oops..., no valid panorama found with position:-45.125783, 151.27641700000004, try to change position, radius or source.

@zyzdev
Copy link
Owner

zyzdev commented Oct 5, 2021

Close this issue here.
The callback onPanoramaChangeListener will receive exception while the street view invalid.
See demo Street View Panorama events(demo/street_view_panorama_events.dart) in example for usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants