GwtCommand command = new GwtCommand(GeometryUtilsRequest.COMMAND);
command.setCommandRequest(request);
GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
public void execute(CommandResponse response) {
if (response instanceof GeometryUtilsResponse) {
GeometryUtilsResponse resp = (GeometryUtilsResponse) response;
if (onFinished != null) {
Geometry[] geometriesArray = new Geometry[resp.getGeometries().length];
for (int i = 0; i < geometriesArray.length; i++) {
geometriesArray[i] = GeometryConverter.toGwt(resp.getGeometries()[i]);
}
onFinished.execute(geometriesArray);
}
}
}