Package de.fhpotsdam.unfolding.geo

Examples of de.fhpotsdam.unfolding.geo.Location


    }
    size(800, 600, OPENGL);
    frame.setResizable(true);

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

    oldWidth = width;
    oldHeight = height;
  }
View Full Code Here


  public void setup() {
    size(1024, 768, OPENGL);

    map1 = new UnfoldingMap(this, "map1", 0, 0, 512, height);
    map1.zoomAndPanTo(new Location(52.5f, 13.4f), 10);
    map2 = new UnfoldingMap(this, "map2", 512, 0, 512, height, true, false, new Microsoft.AerialProvider());
    EventDispatcher eventDispatcher = MapUtils.createDefaultEventDispatcher(this, map1, map2);

    // Create debug displays
    debugDisplay1 = new DebugDisplay(this, map1, eventDispatcher, 10, 10);
View Full Code Here

  }

  public void zoomAndPanToFit(List<Location> locations) {
    Location[] boundingBox = GeoUtils.getBoundingBox(locations);
    List<Location> boundingBoxLocations = Arrays.asList(boundingBox);
    Location centerLocation = GeoUtils.getEuclideanCentroid(boundingBoxLocations);
    ScreenPosition pos = mapDisplay.getScreenPosition(centerLocation);
    mapDisplay.setInnerTransformationCenter(new PVector(pos.x, pos.y));
    zoomToFit(boundingBox);
    panTo(centerLocation);
  }
View Full Code Here

  private void restrictMapToArea() {
    if (restrictedPanLocation == null) {
      return;
    }

    Location mapCenter = getCenter();
    double dist = GeoUtils.getDistance(restrictedPanLocation, mapCenter);
    if (dist > maxPanningDistance) {
      float angle = PApplet.degrees((float) GeoUtils.getAngleBetween(restrictedPanLocation, mapCenter));
      float backDist = maxPanningDistance - (float) dist;
      // Pan back, with same angle but negative distance
      Location newLocation = GeoUtils.getDestinationLocation(mapCenter, angle, backDist);
      panTo(newLocation);
    }
  }
View Full Code Here

    float lon = 52.5f;
    float lat = 13.4f;

    // Initialize two maps
    map1 = new UnfoldingMap(this, mapXposition, mapYposition, mapWidth, mapHeight);
    map1.zoomAndPanTo(new Location(lon, lat), 10);
    map2 = new UnfoldingMap(this, mapXposition, mapYposition, mapWidth, mapHeight, new Microsoft.AerialProvider());
    map2.zoomAndPanTo(new Location(lon, lat), 10);
    MapUtils.createDefaultEventDispatcher(this, map1, map2);
  }
View Full Code Here

  public void setup() {
    size(1024, 768, P2D);

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

    // Create debug display (optional: specify position and size)
    debugDisplay = new DebugDisplay(this, map);
  }
View Full Code Here

    smooth();

    map = new UnfoldingMap(this);
    // map.setTweening(true);
    map.zoomToLevel(3);
    map.panTo(new Location(40f, 8f));
    MapUtils.createDefaultEventDispatcher(this, map);

    // Create Markers from Locations
    Location locationBerlin = new Location(52.5f, 13.4f);
    Location locationLondon = new Location(51.5f, 0f);

    markerBerlin = new SimplePointMarker(locationBerlin);
    markerLondon = new SimplePointMarker(locationLondon);

    PFont font = createFont("serif-bold", 12);
View Full Code Here

  public void mouseClicked() {
    Marker marker = map.getFirstHitMarker(mouseX, mouseY);
    if (marker != null) {
      map.zoomAndPanToFit(GeoUtils.getLocations(marker));
    } else {
      map.zoomAndPanTo(2, new Location(0, 0));
    }
  }
View Full Code Here

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

    map = new UnfoldingMap(this);
    map.zoomAndPanTo(new Location(50f, 12f), 4);
    MapUtils.createDefaultEventDispatcher(this, map);
  }
View Full Code Here

  UnfoldingMap map;

  public void setup() {
    size(800, 600, OPENGL);
    map = new UnfoldingMap(this, 50, 50, 700, 500);
    map.zoomAndPanTo(new Location(52.5f, 13.4f), 10);
    MapUtils.createDefaultEventDispatcher(this, map);

    // background color of the map
    map.setBackgroundColor(color(60, 70, 10));
  }
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.