tillnagel / unfolding

A library to create interactive maps and geovisualizations in Processing and Java
http://unfoldingmaps.org
Other
478 stars 245 forks source link

Cannot find anything named GPXSpeedreader #160

Closed skatewizard closed 6 years ago

skatewizard commented 6 years ago

Hi Till, Im new in processing, im trying to display my .xml (gps data) in a 2d map but I can't work it out. Im usiing your code (without "package" line and without "public class GPXSpeedTrackApp extends PApplet {"...

// package de.fhpotsdam.unfolding.examples.data.customreader;

import java.util.List;

//import processing.core.PApplet;

import de.fhpotsdam.unfolding.UnfoldingMap; import de.fhpotsdam.unfolding.data.Feature; import de.fhpotsdam.unfolding.data.MarkerFactory; import de.fhpotsdam.unfolding.geo.Location; import de.fhpotsdam.unfolding.marker.Marker; import de.fhpotsdam.unfolding.utils.MapUtils;

/**

//public class GPXSpeedTrackApp extends PApplet {

UnfoldingMap map;

Location startLocation = new Location(52.49f, 13.44f);

public void settings() { size(800, 600, P2D); }

public void setup() { map = new UnfoldingMap(this); MapUtils.createDefaultEventDispatcher(this, map); map.zoomAndPanTo(14, startLocation);

List<Feature> features = GPXSpeedReader.loadData(this, "data/bike-tour.gpx");
MarkerFactory markerFactory = new MarkerFactory();
markerFactory.setLineClass(ColoredLinesMarker.class);
List<Marker> markers = markerFactory.createMarkers(features);
map.addMarkers(markers);

}

public void draw() { map.draw(); }

public static void main(String[] args) { PApplet.main(new String[] { GPXSpeedTrackApp.class.getName() }); }

//}

tillnagel commented 6 years ago

If you are not within that package (which you correctly commented out), you need to import the class GPXSpeedreader from that package. See https://github.com/tillnagel/unfolding/tree/master/examples/de/fhpotsdam/unfolding/examples/data/customreader