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

Map not rendering and error thrown in browser console #65

Closed thomasdewaelheyns closed 2 years ago

thomasdewaelheyns commented 2 years ago

When using the Google Maps Addon widget, the map is not shown and an exception is being thrown to the console of the browser.

The visualization in the browser: image

The following error is being shown in the console: image

This problem also occurs on the online demo of the Vaadin addon at https://addonsv14.flowingcode.com/googlemaps

Platform versions: Google Maps Addon version: 1.6.0 Vaadin version: 14.8.4

Verified in: Chrome: 98.0.4758.82 Firefox: 97.0 (64-bit)

CodeMonkeyLab commented 2 years ago

Hi, i have found a workaround. You have to set the MapID via gmaps.setMapId("8e0a97af9386fef"); If you do not set a map id you get this error

You can create your own map id (Style) via this https://developers.google.com/maps/documentation/get-map-id

javier-godoy commented 2 years ago

@CodeMonkeyLab Thanks. Indeed, reverting to version 1.5.0 (that doesn't have the MapID feature) seems to avoid this issue. This is clearly a bug since MapID was intended as an optional feature. @paodb can you investigate?

paodb commented 2 years ago

Hi @javier-godoy, I did some testing but I'm not able to reproduce the issue. I see no console error and the maps are displaying correctly. And the demo doesn't show the issue either.

thomasdewaelheyns commented 2 years ago

I forgot to write an update but a day or two after I reported the issue, it was magically solved without changing anything. So with no changes to the Vaadin dependency or the maps addons version in both production and development environments. In development, the same build was still running without restart or anything.

I can only speculate something happened on Google's side of things since the exception was throwing in a javascript library loaded from their content delivery.

As it is currently working as expected I will close this issue. Thanks for taking the time to investigate.