Package de.fhpotsdam.unfolding.geo

Examples of de.fhpotsdam.unfolding.geo.Location


      XML lonXML = itemXML[i].getChild("geo:long");
      if (latXML != null && latXML.getContent() != null) {
        float lat = Float.valueOf(latXML.getContent());
        float lon = Float.valueOf(lonXML.getContent());

        rssGeoLocations.add(new Location(lat, lon));
      }
    }
  }
View Full Code Here


public class GPXUtils {

  public static List<TrackPoint> loadGPXTrack(PApplet p, String gpxFilename) {
    List<TrackPoint> trackPoints = new ArrayList<TrackPoint>();
    Calendar prevTime = null;
    Location prevLocation = null;

    // Load GPX file
    XML gpx = p.loadXML(gpxFilename);
    // Get all track points
    XML[] itemXML = gpx.getChildren("trk/trkseg/trkpt");
    for (int i = 0; i < itemXML.length; i++) {
      // Creates location for track point
      float lat = itemXML[i].getFloat("lat");
      float lon = itemXML[i].getFloat("lon");
      Location location = new Location(lat, lon);

      // Calculates speed for track point
      // Uses time span (h) and distance (km) to previous point to get km/h
      double speed = 0;
      try {
View Full Code Here

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

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

    addRandomMarkers();
  }
View Full Code Here

  public void setup() {
    size(800, 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 panViewportOnDetailMap() {
    float x = viewportRect.x + viewportRect.w / 2;
    float y = viewportRect.y + viewportRect.h / 2;
    Location newLocation = mapOverviewStatic.mapDisplay.getLocation(x, y);
    mapDetail.panTo(newLocation);
  }
View Full Code Here

      if (map.isHit(mouseX, mouseY)) {
        if (mouseButton == PConstants.LEFT && mouseEvent.getCount() == 2) {

          // Pan + Zoom (order is important)
          PanMapEvent panMapEvent = new PanMapEvent(this, map.getId());
          Location location = map.getLocation(mouseX, mouseY);
          panMapEvent.setToLocation(location);
          eventDispatcher.fireMapEvent(panMapEvent);

          ZoomMapEvent zoomMapEvent = new ZoomMapEvent(this, map.getId(), ZoomMapEvent.ZOOM_BY_LEVEL, 1);
          zoomMapEvent.setTransformationCenterLocation(location);
View Full Code Here

        // log.debug("mouse: fire zoomBy for " + map.getId());

        ZoomMapEvent zoomMapEvent = new ZoomMapEvent(this, map.getId(), ZoomMapEvent.ZOOM_BY_LEVEL);

        // Use location as zoom center, so listening maps can zoom correctly
        Location location = map.getLocation(mouseX, mouseY);
        zoomMapEvent.setTransformationCenterLocation(location);

        // Zoom in or out
        if (delta < 0) {
          zoomMapEvent.setZoomLevelDelta(1);
View Full Code Here

        if (mouseButton == PConstants.LEFT) {
          // log.debug("mouse: fire panTo for " + map.getId());

          // Pan between two locations, so other listening maps can pan correctly

          Location oldLocation = map.getLocation(pmouseX, pmouseY);
          Location newLocation = map.getLocation(mouseX, mouseY);

          PanMapEvent panMapEvent = new PanMapEvent(this, map.getId(), PanMapEvent.PAN_BY);
          panMapEvent.setFromLocation(oldLocation);
          panMapEvent.setToLocation(newLocation);
          eventDispatcher.fireMapEvent(panMapEvent);
View Full Code Here

    MyPolygonMarker polygonMarker = new MyPolygonMarker();
    // Either add single location with lat, lng
    polygonMarker.addLocation(15, 5);
    // Or add multiple locations
    polygonMarker.addLocations(new Location(22, 12), new Location(23, 7));
    map.addMarkers(polygonMarker);
  }
View Full Code Here

    size(800, 600, OPENGL);

    map = new UnfoldingMap(this);

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

    // Get default MarkerManager (still empty at this moment)
    markerManager = map.getDefaultMarkerManager();

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

    // Point Markers
    berlinMarker = new SimplePointMarker(berlinLocation);
    SimplePointMarker mexicoCityMarker = new SimplePointMarker(mexicoCityLocation);
    // Line Marker
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.