public void setup() {
size(800, 600, P2D);
// map = new UnfoldingMap(this, 0, 60, 800, 540, new MBTilesMapProvider("jdbc:sqlite:./berlin-dark.mbtiles"));
map = new UnfoldingMap(this, 0, 60, 800, 540, new StamenMapProvider.TonerLite());
map.zoomAndPanTo(new Location(52.5f, 13.4f), 15);
map.setZoomRange(10, 17);
MapUtils.createDefaultEventDispatcher(this, map);
// Create marker
List<Feature> features = GPXReader.loadData(this, "data/bike-tour2.gpx");
// List<Feature> features = GPXReader.loadData(this, "data/bike-tour.gpx");
println("Loaded " + features.size() + " features");
// MarkerFactory markerFactory = new MarkerFactory();
// List<Marker> markers = markerFactory.createMarkers(features);
// map.addMarkers(markers);
// Center around bike path (by panning to center of all features)
locations = GeoUtils.getLocationsFromFeatures(features);
Location center = GeoUtils.getEuclideanCentroid(locations);
map.panTo(center);
// UI
cp5 = new ControlP5(this);
cp5.addSlider("simplificationTolerance").setPosition(20, 25).setRange(0, 25).setCaptionLabel("Simplification");