Google Maps routes in MapViewer

I have this app that plots routes in a mapviewer acording to geopoints defined by the user.
For that I use Google DirectionsApi by the methods in like:

mapViewer.route(request, new DirectionsRequestCallback() {
            public void onCallback(DirectionsResult result, DirectionsStatus status) {
                pending_request = false;
                if (status == DirectionsStatus.OK && result.getRoutes() != null
                        && !result.getRoutes().isEmpty()) { ..........................}

For wich I have to thank Igor Korotkov.
The problem is that it works well only when just one browser client is active. As soon as the same screen is openend in another browser (myself or other user) the Callback method never gets fired again. Tomcat must be restarted to get it functioning again.
Why is that? How can it be solved?


Changing to long pooling,
cuba.web.pushLongPolling = true

or disabling “server push”,
cuba.web.pushEnabled = false

Does not solve the problem

Hi Pedro, it was a bug in Google Maps Vaadin addon, which we have fixed now. The very the next CUBA bugfix release will not have this issue.

Thank you for reporting it.

Thank you very much Igor for the reply

I had to took the decision to abandon Vaadin addon and use in the meanwhile.
Works perfectly, one of the many adavntages of Cuba, I’m already using several Java Libraries without problems.
Good to know you’re getting everything sorted out.


If you are mostly interested in Google Maps Web Services (geocoding, places, directions) then I would even recommend using specialised libraries.

CUBA’s maps implementation revolves around visual map component, and, although it provides some implementations of Google Maps JavaScript API, the coverage of them is not great due to lack of users demand.

:ticket: See the following issue in our bug tracker:

Hi Pedro @parmelim
I was also going to try CUBA for google map directions but now I understand it’s not possible for now! I came across your post and good that you have already implemented using Jalal client library. Would you mind sharing some thoughts and code snippets to implement directions and way points?
Thanks a lot.