public SelectLocationEvent(MapWidget mapWidget, GetLocationForStringResponse alternative) { super(); this.mapWidget = mapWidget; canonicalLocation = alternative.getCanonicalLocation(); center = alternative.getCenter(); bbox = alternative.getBbox(); geocoderName = alternative.getGeocoderName(); userData = alternative.getUserData(); }
@Override public GetLocationForStringResponse getEmptyCommandResponse() { return new GetLocationForStringResponse(); }
response.setLocationFound(false); if (!results.isEmpty()) { response.setLocationFound(true); response.setCanonicalLocation(matchedLocation); response.setGeocoderName(geocoderName); response.setUserData(results.get(0).getUserData()); response.setBbox(bbox); response.setCenter(new Coordinate(bbox.getX() + bbox.getWidth() / 2, bbox.getY() + bbox.getHeight() / 2)); } else { List<GetLocationForStringAlternative> altList = new ArrayList<GetLocationForStringAlternative>(); response.setAlternatives(altList); for (GetLocationResult[] altArr : alternatives) { for (GetLocationResult alt : altArr) {
@Override public void goToLocation(final GetLocationForStringResponse response, final String location) { if (response.isLocationFound()) { fireGeocoderEvent(new SelectLocationEvent(mapPresenter, response)); } else { List<GetLocationForStringAlternative> alternatives = response.getAlternatives(); if (null != alternatives && alternatives.size() > 0) { fireGeocoderEvent(new SelectAlternativeEvent(mapPresenter, alternatives)); } else { fireGeocoderEvent(new LocationNotFoundEvent(location)); } } }
public void goToLocation(final CommandResponse commandResponse, final String location) { if (commandResponse instanceof GetLocationForStringResponse) { GetLocationForStringResponse response = (GetLocationForStringResponse) commandResponse; if (response.isLocationFound()) { removeAltWindow(); handlerManager.fireEvent(new SelectLocationEvent(map, response)); } else { List<GetLocationForStringAlternative> alternatives = response.getAlternatives(); if (null != alternatives && alternatives.size() > 0) { handlerManager.fireEvent(new SelectAlternativeEvent(map, alternatives)); } else { SC.say(messages.locationNotFound(location)); } } } }
public SelectLocationEvent(MapPresenter mapPresenter, GetLocationForStringResponse alternative) { super(); this.mapPresenter = mapPresenter; canonicalLocation = alternative.getCanonicalLocation(); center = alternative.getCenter(); bbox = alternative.getBbox(); geocoderName = alternative.getGeocoderName(); userData = alternative.getUserData(); }