a14n / dart-google-maps

A library to use Google Maps JavaScript API v3 from Dart scripts.
Apache License 2.0
130 stars 66 forks source link

Plus Code is not supported by the Dart wrapper #90

Closed YuzuruT closed 3 years ago

YuzuruT commented 3 years ago

The GeocoderResult class does not seem to unpack any of the Plus Code data supplied from the API calls to GeoCodeService.

a14n commented 3 years ago

Is it really related to the Dart wrapper? After a quick look at the Google Maps JavaScript API V3 Reference I haven't seen any reference to Plus Code. Do you have an example with the JS api that works with a PlusCode?

YuzuruT commented 3 years ago

Thank you for your prompt response.

I see. It does seem a bit odd. Although I do see documentation about PlacePlusCode https://developers.google.com/maps/documentation/javascript/reference/places-service#PlacePlusCode, it seems the documentation for GeocoderResponse https://developers.google.com/maps/documentation/javascript/reference/geocoder#GeocoderResponse and GeocoderResult https://developers.google.com/maps/documentation/javascript/reference/geocoder#GeocoderResult both do not include the PlacePlusCode field. Yet, in the JSFiddle example https://developers.google.com/maps/documentation/javascript/geocoding# of ReverseGeocoding https://developers.google.com/maps/documentation/javascript/geocoding#ReverseGeocoding, I clearly see PlacePlusCode https://developers.google.com/maps/documentation/javascript/reference/places-service#PlacePlusCode in both GeocoderResponse https://developers.google.com/maps/documentation/javascript/reference/geocoder#GeocoderResponse and GeocoderResult https://developers.google.com/maps/documentation/javascript/reference/geocoder#GeocoderResult. Attached image shows PlacePlusCode inside GeocoderResult.

I arrived here by Google searching "how to get Plus Code from LatLng" and ReverseGeocoding was the recommendation, only to find that these fields didn't pipe through to the Dart impl response.

While "plus_code" is included in the type field of GeocoderAddressComponent https://developers.google.com/maps/documentation/javascript/reference/geocoder#GeocoderAddressComponent, both long_name and short_name are not the full 10 digit Plus Code which is not very useful if one wants the exact location via a single Plus Code string.

I am new to this process. I assume my next step should be to request Maps API documentation to add PlacePlusCode as an official field of GeocoderResponse/Result?

2020年12月3日(木) 1:36 Alexandre Ardhuin notifications@github.com:

Is it really related to the Dart wrapper? After a quick look at the Google Maps JavaScript API V3 Reference https://developers.google.com/maps/documentation/javascript/reference I haven't seen any reference to Plus Code. Do you have an example with the JS api that works with a PlusCode?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/a14n/dart-google-maps/issues/90#issuecomment-737723887, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXM6I7R4PYQPRSC4F6N4B3SS45Y5ANCNFSM4ULDMJFA .

a14n commented 3 years ago

As you point out plus_code can be used in GeocoderResult.types or GeocoderAddressComponent.types to indicate that long_name and/or short_name is a PlusCode.

I actually never saw a plus_code as result so it's not easy to answer your question.

I'm closing this issue because nothing need to be done on the code.