a14n / dart-google-maps

A library to use Google Maps JavaScript API v3 from Dart scripts.
Other
125 stars 63 forks source link

getPanorama throw a exception when consult not available location for streetview #116

Closed lautarozanuttini closed 1 year ago

lautarozanuttini commented 1 year ago

Hi a14n, a im using the package to consult locations but if its not available throw a exception in this functions, the solutions that will help its convert the value that return from StreetViewResponse to StreetViewResponse?

extension StreetViewService$Ext on StreetViewService {
  Future<StreetViewResponse> getPanorama(
    Object? /*StreetViewLocationRequest?|StreetViewPanoRequest?*/ request, [
    void Function(StreetViewPanoramaData?, StreetViewStatus?)? callback,
  ]) =>
      promiseToFuture(callMethod(this, 'getPanorama', [
        request,
        callback == null
            ? null
            : allowInterop((p0, p1) => callback(p0, StreetViewStatus$cast(p1)))
      ]));
}

getPanorama(), on line 6126 on google_maps_core.js.g.dart. thanks

a14n commented 1 year ago

I don't understand the issue. The example 08-services/streetview-service works without issue even on location without streetview (the check of the status allows you to catch those cases)?

lautarozanuttini commented 1 year ago

Hi Alexandre, im using flutter_street_view package where use this package to find location and show the view but flutter throw error in this functions everytime that location is not available, here attached images with the error. Thanks you for the patience.

196828970-41bf00ba-4275-49bd-a56f-a7409f0ece32 197032348-a84ff17c-bc42-4291-830b-8271aaf367b9

a14n commented 1 year ago

Do you use a specific version of google maps? What returns google.maps.version in the js console?

According to the getPanorama doc this method should return a promise (and not null as the logs suggest)

Could you share your getPanorama() call?

lautarozanuttini commented 1 year ago

im using google_maps_flutter: ^2.1.12, google_maps_flutter_web: ^0.4.0+2 and flutter_google_street_view: ^3.1.2, i will send you more info latter because im not in the office now.

a14n commented 1 year ago

Is this issue still relevant?

lautarozanuttini commented 1 year ago

Hi Alexandre, i had to close another things but yesteday i execute flutter clean, update all packeges and re-code the widget that have this issue and didnt show anymore, i think that was the solution, i will keep testing and if show up again then i re-open this issue, im sorry for the time and thank you for your patience.

lautarozanuttini commented 1 year ago

Hi Alexander, here is the error again and that is the call to the getPanorama function.

image image

a14n commented 1 year ago

Do you use a specific version of google maps? What returns google.maps.version in the js console of your browser?

Could you provide a simple project that reproduce the issue? I'm not able to see this issue on the example 08-services/streetview-service.