Package de.fhpotsdam.unfolding.utils

Examples of de.fhpotsdam.unfolding.utils.ScreenPosition


    debugDisplay.draw();

    noFill();
    // red: London
    ScreenPosition pLondon = map.mapDisplay.getScreenPosition(locLondon);
    stroke(255, 0, 0);
    ellipse(pLondon.x, pLondon.y, 12, 12);
   
    // blue: Quito
    ScreenPosition pQuito = map.mapDisplay.getScreenPosition(locQuito);
    stroke(0, 0, 255);
    ellipse(pQuito.x, pQuito.y, 12, 12);
  }
View Full Code Here


    Location location = map.mapDisplay.getLocation(mouseX, mouseY);
    fill(215, 0, 0);
    text(location + "", mouseX, mouseY);

    // Show marker at location
    ScreenPosition pos = map.mapDisplay.getScreenPosition(berlinLocation);
    ellipse(pos.x, pos.y, 10, 10);
  }
View Full Code Here

  public void updateMap(UnfoldingMap mainMap, UnfoldingMap nextMap, boolean left) {
    float degree = (left) ? -180 : 180;

    // Move next map
    ScreenPosition pos = mainMap.getScreenPosition(new Location(0, degree));
    nextMap.move(pos.x, 0);
    if (left) {
      nextMap.moveBy(-800, 0);
    }

    // Pan next map
    nextMap.panTo(new Location(0, 0));
    ScreenPosition map1RightPos = mainMap.getScreenPosition(new Location(0, degree));
    Location map1RightLocation = nextMap.getLocation(map1RightPos);
    float lonDiff = (-map1RightLocation.getLon()) - degree;
    nextMap.panTo(new Location(-map1RightLocation.getLat(), lonDiff));

    // Ensure next map is always over main map (push 1px)
View Full Code Here

  public void draw() {
    background(240);
    map.draw();

    if (boundingBox != null) {
      ScreenPosition nwPos = map.getScreenPosition(boundingBox[0]);
      ScreenPosition sePos = map.getScreenPosition(boundingBox[1]);
      stroke(0, 255, 0, 200);
      noFill();
      rect(nwPos.x, nwPos.y, sePos.x - nwPos.x, sePos.y - nwPos.y);
    }

    noStroke();
    if (center != null) {
      ScreenPosition posC = map.getScreenPosition(center);
      fill(0, 0, 255);
      ellipse(posC.x, posC.y, 6, 6);
    }

    if (centerEuclidean != null) {
      ScreenPosition posCE = map.getScreenPosition(centerEuclidean);
      fill(0, 255, 255);
      ellipse(posCE.x, posCE.y, 6, 6);
    }
    if (centerBoundingBox != null) {
      ScreenPosition posBB = map.getScreenPosition(centerBoundingBox);
      fill(0, 255, 0);
      ellipse(posBB.x, posBB.y, 6, 6);
    }
  }
View Full Code Here

TOP

Related Classes of de.fhpotsdam.unfolding.utils.ScreenPosition

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.