Package de.fhpotsdam.unfolding.geo

Examples of de.fhpotsdam.unfolding.geo.Location


    noStroke();

    map = new UnfoldingMap(this);
    map.setTweening(true);
    map.zoomToLevel(3);
    map.panTo(new Location(40f, 8f));
    MapUtils.createDefaultEventDispatcher(this, map);
  }
View Full Code Here


  public void setup() {
    size(600, 600, OPENGL);

    map = new UnfoldingMap(this);
    map.zoomAndPanTo(new Location(52.5f, 13.4f), 10);
    MapUtils.createDefaultEventDispatcher(this, map);
  }
View Full Code Here

  public void draw() {
    background(255);

    map.draw();

    Location mainLocation = new Location(52.52f, 13.42f);
    ScreenPosition pos = map.getScreenPosition(mainLocation);
    float distanceInKm = getDistance(mainLocation, 5);
    fill(255, 255, 0, 127);
    ellipse(pos.x, pos.y, distanceInKm, distanceInKm);
  }
View Full Code Here

    fill(255, 255, 0, 127);
    ellipse(pos.x, pos.y, distanceInKm, distanceInKm);
  }

  public float getDistance(Location mainLocation, float size) {
    Location tempLocation = GeoUtils.getDestinationLocation(mainLocation, 90, size);
    ScreenPosition pos1 = map.getScreenPosition(mainLocation);
    ScreenPosition pos2 = map.getScreenPosition(tempLocation);
    return dist(pos1.x, pos1.y, pos2.x, pos2.y);
  }
View Full Code Here

  public void setup() {
    size(800, 600, OPENGL);

    map = new UnfoldingMap(this);
    map.zoomAndPanTo(new Location(50.26f, 12.1f), 4);
    MapUtils.createDefaultEventDispatcher(this, map);

    ImageMarker imgMarker1 = new ImageMarker(lisbonLocation, loadImage("ui/marker.png"));
    ImageMarker imgMarker2 = new ImageMarker(veniceLocation, loadImage("ui/marker_red.png"));
    ImageMarker imgMarker3 = new ImageMarker(berlinLocation, loadImage("ui/marker_gray.png"));
View Full Code Here

    noFill();
    strokeWeight(4);
    stroke(0, 100);
    beginShape();
    for (float d = 0; d < dist; d += 100) {
      Location tweenLocation = GeoUtils.getDestinationLocation(targetLocation, degrees((float) bearing),
          (float) d);
      ScreenPosition tweenPos = map.getScreenPosition(tweenLocation);
      vertex(tweenPos.x, tweenPos.y);
    }
    endShape();
View Full Code Here

    size(800, 600, OPENGL);

    map = new UnfoldingMap(this, new Google.GoogleMapProvider());

    map.zoomToLevel(3);
    map.panTo(new Location(40f, -42f));
    MapUtils.createDefaultEventDispatcher(this, map);

    // Create Markers from Locations
    Location berlinLocation = new Location(52.5f, 13.4f);
    Location mexicoCityLocation = new Location(19.4f, -99.1f);

    // Point Markers
    SimplePointMarker berlinMarker = new SimplePointMarker(berlinLocation);
    SimplePointMarker mexicoCityMarker = new SimplePointMarker(mexicoCityLocation);
    // Line Marker
View Full Code Here

           
            // 3 variations to zoom with two finger gestures
            // TODO Do study on usability for different interaction approaches.
           
            // 1. pos of last finger
            Location centerLocation = map.getLocation(transCenter.x, transCenter.y);
            zoomMapEvent.setTransformationCenterLocation(centerLocation);

            // 2. object center: pinch gesture w/o fixed finger-location connection
            // float[] objectCenterXY =
            // map.mapDisplay.getScreenFromObjectPosition(map.mapDisplay.getWidth()/2,
            // map.mapDisplay.getHeight()/2);
            // PVector objectCenter = new PVector(objectCenterXY[0], objectCenterXY[1]);
            // map.mapDisplay.setInnerTransformationCenter(objectCenter);

            // 3. middle pos between both fingers

            float newDist = getDistance(tuioCursor1, tuioCursor2);
            float scaleDelta = newDist / oldDist;
            oldDist = newDist;
            zoomMapEvent.setZoomDelta(scaleDelta);

            eventDispatcher.fireMapEvent(zoomMapEvent);
          }

          if (rotate) {
           
            // TODO Use events (instead of direct map manipulation)

            // rotate center
            map.mapDisplay.setTransformationCenter(transCenter);

            float newAngle = getAngleBetween(tuioCursor1, tuioCursor2);
            float angle = newAngle - oldAngle;
            oldAngle = newAngle;
            map.rotate(angle);
          }


        } else if (tuioCursor1 != null) {
          // One finger: pan

          if (tuioCursor1.getCursorID() == tcur.getCursorID()) {
            TuioPoint oldTuioPoint = tcur.getPath().get(tcur.getPath().size() - 2);
            Location fromLocation = map.mapDisplay.getLocation(oldTuioPoint.getScreenX(p.width),
                oldTuioPoint.getScreenY(p.height));
            Location toLocation = map.mapDisplay.getLocation(tuioCursor1.getScreenX(p.width),
                tuioCursor1.getScreenY(p.height));

            PanMapEvent panMapEvent = new PanMapEvent(this, map.getId(), PanMapEvent.PAN_BY);
            panMapEvent.setFromLocation(fromLocation);
            panMapEvent.setToLocation(toLocation);
View Full Code Here

  public void setup() {
    size(800, 600, OPENGL);

    map = new UnfoldingMap(this);
    map.zoomAndPanTo(10, new Location(52.5f, 13.4f));

    MapUtils.createDefaultEventDispatcher(this, map);
  }
View Full Code Here

      Ani.to(this, 4.5f, "currentZoom", targetZoom, Ani.ELASTIC_OUT);
    }
  }

  public void mouseReleased() {
    Location targetLocation = map.getLocation(mouseX, mouseY);

    Ani.to(this, 1.5f, "lat", targetLocation.getLat(), Ani.ELASTIC_OUT);
    Ani.to(this, 1.5f, "lon", targetLocation.getLon(), Ani.ELASTIC_OUT);
  }
View Full Code Here

TOP

Related Classes of de.fhpotsdam.unfolding.geo.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.