Hello, I need to use GoogleMap inside a Dialog. First time everything is fi

Hello, I need to use GoogleMap inside a Dialog.
First time everything is fine, when I close the Dialog and try to reopen
I get this message “TypeError: Cannot read property ‘click’ of undefined”
and the Marker doesn’t show. Please note that there is no real navigation.
Any help will be appreciated. Thanks in advance.

    GoogleMap gmaps;
    Dialog dialog = null;

    public MainView() {
        Button btnOpen = new Button("Open Dialog");
        Button btnClose = new Button("Close");
        btnClose.addClickListener(e -> {
            dialog.close();
        });
        
        btnOpen.addClickListener(e -> {
            gmaps = new GoogleMap(apiKey, null, null);
            gmaps.setMapType(GoogleMap.MapType.SATELLITE);
            gmaps.setSizeFull();
            gmaps.setCenter(new LatLon(-31.636036, -60.7055271));
            gmaps.addMarker("Center", new LatLon(-31.636036, -60.7055271), true, "");
            dialog = new Dialog();
            dialog.setSizeFull();
            dialog.add(btnClose, gmaps);
            dialog.open();
        });
        add(btnOpen);
    }

A silly hint: I noticed that the problem is solved by invalidating the Vaadin Session. Maybe a method should be provided to force GoogleMap initialization ?

        Button btnInit = new Button("ReInit");
        btnInit.addClickListener(e -> VaadinSession.getCurrent().getSession().invalidate());
        add(btnInit);

Sometimes DIY is the Bible. Take a look in the Issue Tracker to see my solution.

Hello, thanks for the contribution! We’re working on it. We will let you know when a release with the fix is available.

Hello Aldo. There’s a new release with the fix for this issue. Please check it out and let us know if you run into any other issue! Thanks!