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

PolyLine, Polygon, not first Map usage #118

Closed SpilkoRobert closed 6 months ago

SpilkoRobert commented 7 months ago

Hi,

I am facing an issue, that if it is NOT the first time a GoogleMap is rendered on the browser session, the addPolygon and the addPolyline functions are not working.

I was able to reproduce the issue on the demo project as well, by replacing the content with a button, which brings up a Dialog everty time it is clicked, whith the original content... The funtions are working on the first dialog, but not after. Refreshing the browser means it will again work, but only for the first time.

AddPolygonsDemo:

Button b = new Button("Bring up");
b.addClickListener(e -> {
        Dialog dialog = new Dialog();
        dialog.setHeight("500px");
        dialog.setWidth("500px");

    // original content

    dialog.add(gmaps, layout);
    dialog.open();
});
add(b);