如何在 JAVA 中使用 DirectionService() GWT

How to use DirectionService() GWT in JAVA

是否有处理 DirectionService() 并且是最新的示例?而且在 Java 而不是 javascript?
我到处都找不到。我想要一些有关如何使用它的具体示例。

无论如何这是我的问题:

Set the renderer to use the result from the DirectionsService. Setting a valid set of directions in this manner will display the directions on the renderer's designated map and panel.

这就是 Google Map DirectionRenderer().setDirection() 中的内容。
而当我点击查看DirectionServices时,唯一的方法是。

route(request:DirectionsRequest, callback:function(DirectionsResult, DirectionsStatus))

这是有道理的。但我不知道如何使用回调。我做了一些研究,但仍然出错。这是我的代码。

DirectionsRequest req = DirectionsRequest.create();
req.setOrigin(userPosition);
req.setDestination(destination);
DirectionsService serv = DirectionsService.create();
serv.route(req, new ???????)

所以,这就是我卡住的地方。我找到的唯一帮助是 https://github.com/branflake2267/GWT-Maps-V3-Api/blob/master/gwt-maps-showcase/src/main/java/com/google/gwt/maps/testing/client/maps/DirectionsServiceMapWidget.java
这个 link 以上。但他们似乎使用旧版本的 gwt,而我的版本不再有效。拜托,感谢任何帮助!

想通了....

serv.route(req, new DirectionsService.Callback() {

        @Override
        public void handle(DirectionsResult a, DirectionsStatus b) {
            // TODO Auto-generated method stub

        }
    });

我真诚地希望有人遇到同样的问题时能找到这个