@Override public GetLocationForStringRequest getEmptyCommandRequest() { return new GetLocationForStringRequest(); }
public void goToLocation(final String location) { GwtCommand command = new GwtCommand(GetLocationForStringRequest.COMMAND); GetLocationForStringRequest request = new GetLocationForStringRequest(); request.setCrs(map.getMapModel().getCrs()); request.setLocation(location); request.setServicePattern(servicePattern); if (GWT.isClient()) { // causes NPE when run as junit test String locale = LocaleInfo.getCurrentLocale().getLocaleName(); if (!"default".equals(locale)) { request.setLocale(locale); } } command.setCommandRequest(request); GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<GetLocationForStringResponse>() { public void execute(GetLocationForStringResponse response) { goToLocation(response, location); } }); }
@Override public void findLocation(final String location) { showAlternativesView(false); GwtCommand command = new GwtCommand(GetLocationForStringRequest.COMMAND); GetLocationForStringRequest request = new GetLocationForStringRequest(); request.setCrs(mapPresenter.getViewPort().getCrs()); request.setLocation(location); request.setServicePattern(servicePattern); command.setCommandRequest(request); GeomajasServerExtension.getInstance().getCommandService().execute(command, new AbstractCommandCallback<GetLocationForStringResponse>() { public void execute(GetLocationForStringResponse response) { goToLocation(response, location); } }); }