Esempio n. 1
0
  @Override
  public void dispatch(MapsLoadedEvent event) {
    MapOptions mapOptions = MapOptions.newInstance();
    mapOptions.center(LatLng.newInstance(42.163403, -82.900772));
    mapOptions.zoom(11);
    mapOptions.roadmap();
    map = Map.newInstance(mapPlace, mapOptions);

    addClickListener(map, firePositionChange);
    switch (modeHolder.mode()) {
      case NEW: // fall through
      case LAST: // fall through
      case UPDATED:
        if (pendingPoint != null) {
          dispatch(pendingPoint);
          pendingPoint = null;
        }
        if (pendingLevel != null) {
          dispatch(pendingLevel);
          pendingLevel = null;
        }
        break;
      case LIST:
        if (pendingOverview != null) {
          dispatch(pendingOverview);
          pendingOverview = null;
        }
        break;
      default:
        throw new RuntimeException("mode not supported: " + modeHolder.mode());
    }
  }
Esempio n. 2
0
 @Override
 public void call(LatLng latLng) {
   switch (modeHolder.mode()) {
     case NEW: // fall through
     case LAST: // fall through
     case UPDATED:
       firePositionChange(latLng);
       break;
     case LIST:
       break;
     default:
       throw new RuntimeException("mode not supported: " + modeHolder.mode());
   }
 }
Esempio n. 3
0
 @Override
 public void dispatch(ModeEvent event) {
   switch (modeHolder.mode()) {
     case NEW:
       detachOverview();
       break;
     case LAST: // fall through
     case UPDATED:
       detachOverview();
       attachCurrentHum();
       break;
     case LIST:
       break;
     default:
       throw new RuntimeException("mode not supported: " + modeHolder.mode());
   }
 }
Esempio n. 4
0
 private void firePositionChange(LatLng latLng) {
   geocoderService.reverse(latLng);
   PointProxy point = humWorkflow.createPoint();
   point.setLat(latLng.getLatitude());
   point.setLng(latLng.getLongitude());
   bus.fireEvent(new PointEvent(point));
   modeHolder.userEvent();
 }