FlowingCode / GoogleMapsAddon

Vaadin Addon based on Google Maps Web Component
https://www.flowingcode.com/en/open-source/
Apache License 2.0
20 stars 7 forks source link

Add the 'current location' button #114

Closed mvysny closed 7 months ago

mvysny commented 7 months ago

The web Google Maps has this "crosshair" current location button available, please see screenshot for more details. Would it be possible to add an API to show the button?

image

mvysny commented 7 months ago

Looks like it's not baked in the Google Maps JavaScript API:

  1. The initial demo of the component at https://developers.google.com/maps/documentation/javascript/overview doesn't show the crosshair button
  2. There's a documentation to add the "Current location" button here: https://developers.google.com/maps/documentation/javascript/geolocation
mvysny commented 7 months ago

This is reported upstream, with unfortunately no activity since 2017: https://issuetracker.google.com/issues/35829640

mvysny commented 7 months ago

See solution in #115

javier-godoy commented 7 months ago

Hello. With support for the Controls API (#115), the current location button would be just an example on how to call goToCurrentLocation from a custom control, and we should update the geolocation example in demo so that it uses the new API.

We'll keep this issue open until #115 is resolved.