Permalink
Browse files

Updated lots of examples to P3.

  • Loading branch information...
1 parent 055737b commit 493673eebb3cddf496ea96722dae215b2a7d94fa @tillnagel committed Dec 7, 2016
Showing with 151 additions and 75 deletions.
  1. +1 −1 examples/de/fhpotsdam/unfolding/examples/data/GeoJSONMarkerApp.java
  2. +9 −3 examples/de/fhpotsdam/unfolding/examples/marker/SimpleMarkerManagerApp.java
  3. +8 −3 examples/de/fhpotsdam/unfolding/examples/marker/SimpleNonMarkerApp.java
  4. +8 −3 examples/de/fhpotsdam/unfolding/examples/marker/connectionmarker/NeighborMarkersApp.java
  5. +8 −3 examples/de/fhpotsdam/unfolding/examples/marker/dynamic/DynamicMarkerApp.java
  6. +8 −3 examples/de/fhpotsdam/unfolding/examples/marker/imagemarker/ImageMarkerApp.java
  7. +7 −0 examples/de/fhpotsdam/unfolding/examples/marker/labelmarker/LabeledMarker.java
  8. +8 −5 examples/de/fhpotsdam/unfolding/examples/marker/labelmarker/ManualLabelMarkerApp.java
  9. +9 −3 examples/de/fhpotsdam/unfolding/examples/marker/labelmarker/MultiLabeledMarkerApp.java
  10. +11 −6 examples/de/fhpotsdam/unfolding/examples/marker/multimarker/CombineTestApp.java
  11. +10 −5 examples/de/fhpotsdam/unfolding/examples/marker/multimarker/MultiMarkerApp.java
  12. +10 −6 examples/de/fhpotsdam/unfolding/examples/multi/DayNightTransitionApp.java
  13. +13 −8 examples/de/fhpotsdam/unfolding/examples/multi/MapComparisonApp.java
  14. +10 −5 examples/de/fhpotsdam/unfolding/examples/multi/MultiProviderMultiMapApp.java
  15. +4 −6 examples/de/fhpotsdam/unfolding/examples/multi/MultiProviderOverlayMapApp.java
  16. +8 −4 examples/de/fhpotsdam/unfolding/examples/multi/SimpleMultiMapApp.java
  17. +11 −10 .../de/fhpotsdam/unfolding/examples/overviewdetail/connection/ConvexHullConnectedMapOnStaticMap.java
  18. +8 −1 examples/de/fhpotsdam/unfolding/examples/overviewdetail/connection/ConvexHullConnectionApp.java
@@ -34,7 +34,7 @@ public void setup() {
map.zoomToLevel(2);
MapUtils.createDefaultEventDispatcher(this, map);
- List<Feature> countries = GeoJSONReader.loadData(this, "data/countries.geo.json");
+ List<Feature> countries = GeoJSONReader.loadData(this, "data/broken.geo.json");
List<Marker> countryMarkers = MapUtils.createSimpleMarkers(countries);
map.addMarkers(countryMarkers);
}
@@ -1,7 +1,6 @@
package de.fhpotsdam.unfolding.examples.marker;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.marker.SimpleLinesMarker;
@@ -21,8 +20,15 @@
UnfoldingMap map;
+ public void settings() {
+ size(800, 600, P2D);
+ }
+
+ public static void main(String[] args) {
+ PApplet.main(new String[] { SimpleMarkerManagerApp.class.getName() });
+ }
+
public void setup() {
- size(800, 600, OPENGL);
map = new UnfoldingMap(this, new Google.GoogleMapProvider());
@@ -42,7 +48,7 @@ public void setup() {
// Add Markers to the maps default MarkerManager
map.addMarkers(berlinMarker, mexicoCityMarker, connectionMarker);
-
+
// Adapt style
berlinMarker.setColor(color(255, 0, 0, 100));
berlinMarker.setStrokeColor(color(255, 0, 0));
@@ -1,7 +1,6 @@
package de.fhpotsdam.unfolding.examples.marker;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.utils.MapUtils;
@@ -24,12 +23,18 @@
Location locationBerlin = new Location(52.5f, 13.4f);
Location locationLondon = new Location(51.5f, 0f);
+ public void settings() {
+ size(400, 400, P2D);
+ }
+
+ public static void main(String[] args) {
+ PApplet.main(new String[] { SimpleNonMarkerApp.class.getName() });
+ }
+
public void setup() {
- size(400, 400, OPENGL);
noStroke();
map = new UnfoldingMap(this);
- map.setTweening(true);
map.zoomToLevel(3);
map.panTo(new Location(40f, 8f));
MapUtils.createDefaultEventDispatcher(this, map);
@@ -4,7 +4,6 @@
import java.util.List;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.marker.Marker;
@@ -21,9 +20,15 @@
UnfoldingMap map;
- public void setup() {
- size(800, 600, OPENGL);
+ public void settings() {
+ size(800, 600, P2D);
+ }
+ public static void main(String[] args) {
+ PApplet.main(new String[] { NeighborMarkersApp.class.getName() });
+ }
+
+ public void setup() {
map = new UnfoldingMap(this);
map.zoomToLevel(11);
map.panTo(new Location(52.53f, 13.4f));
@@ -1,7 +1,6 @@
package de.fhpotsdam.unfolding.examples.marker.dynamic;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.marker.Marker;
@@ -23,9 +22,15 @@
MarkerManager<Marker> markerManager;
SimplePointMarker berlinMarker;
- public void setup() {
- size(800, 600, OPENGL);
+ public void settings() {
+ size(800, 600, P2D);
+ }
+ public static void main(String[] args) {
+ PApplet.main(new String[] { DynamicMarkerApp.class.getName() });
+ }
+
+ public void setup() {
map = new UnfoldingMap(this);
map.zoomToLevel(3);
@@ -1,7 +1,6 @@
package de.fhpotsdam.unfolding.examples.marker.imagemarker;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.utils.MapUtils;
@@ -18,9 +17,15 @@
UnfoldingMap map;
- public void setup() {
- size(800, 600, OPENGL);
+ public void settings() {
+ size(800, 600, P2D);
+ }
+ public static void main(String[] args) {
+ PApplet.main(new String[] { ImageMarkerApp.class.getName() });
+ }
+
+ public void setup() {
map = new UnfoldingMap(this);
map.zoomAndPanTo(4, new Location(50.26f, 12.1f));
MapUtils.createDefaultEventDispatcher(this, map);
@@ -17,6 +17,13 @@
private PFont font;
private float fontSize = 12;
+ /**
+ * Basic constructor. Used in MarkerFactory when created on data loading, label will be set afterwards.
+ */
+ public LabeledMarker(Location location) {
+ this(location, null, null, 0);
+ }
+
public LabeledMarker(Location location, String name) {
this(location, name, null, 0);
}
@@ -5,13 +5,10 @@
import processing.core.PApplet;
import processing.core.PFont;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.data.Feature;
import de.fhpotsdam.unfolding.data.GeoRSSReader;
import de.fhpotsdam.unfolding.data.PointFeature;
-import de.fhpotsdam.unfolding.examples.marker.labelmarker.LabeledMarker;
-import de.fhpotsdam.unfolding.examples.marker.labelmarker.MultiLabeledMarkerApp;
import de.fhpotsdam.unfolding.marker.Marker;
import de.fhpotsdam.unfolding.utils.MapUtils;
@@ -23,9 +20,15 @@
UnfoldingMap map;
- public void setup() {
- size(800, 600, OPENGL);
+ public void settings() {
+ size(800, 600, P2D);
+ }
+ public static void main(String[] args) {
+ PApplet.main(new String[] { ManualLabelMarkerApp.class.getName() });
+ }
+
+ public void setup() {
map = new UnfoldingMap(this, "map", 50, 50, 700, 500);
map.zoomToLevel(2);
MapUtils.createDefaultEventDispatcher(this, map);
@@ -3,7 +3,6 @@
import java.util.List;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.data.Feature;
import de.fhpotsdam.unfolding.data.GeoRSSReader;
@@ -26,9 +25,15 @@
UnfoldingMap map;
- public void setup() {
- size(800, 600, OPENGL);
+ public void settings() {
+ size(800, 600, P2D);
+ }
+ public static void main(String[] args) {
+ PApplet.main(new String[] { MultiLabeledMarkerApp.class.getName() });
+ }
+
+ public void setup() {
map = new UnfoldingMap(this, "map", 50, 50, 700, 500);
map.zoomToLevel(2);
MapUtils.createDefaultEventDispatcher(this, map);
@@ -67,6 +72,7 @@ public void mouseMoved() {
private void populateMarkerLabels(List<Marker> markers) {
// TODO Add convenience method: markerFactory.addPropertyRule("title", "name");
+ // See MarkerFactory
for (Marker marker : markers) {
LabeledMarker labeledMarker = (LabeledMarker) marker;
@@ -5,7 +5,6 @@
import java.util.List;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.data.Feature;
import de.fhpotsdam.unfolding.data.GeoJSONReader;
@@ -14,7 +13,7 @@
import de.fhpotsdam.unfolding.utils.MapUtils;
/**
- * Combines different markers in one MultiMarker. Only that MultiMarker then is displayed.
+ * Combines different markers in one MultiMarker. Only that MultiMarker then is displayed.
*
* Note how France is a MultiMarker by itself (France and Corsica).
*/
@@ -24,11 +23,17 @@
String[] ids = { "DEU", "FRA", "IRL" };
List<String> specialIDs = new ArrayList<String>(Arrays.asList(ids));
- public void setup() {
- size(800, 600, OPENGL);
+ public void settings() {
+ size(800, 600, P2D);
+ }
+
+ public static void main(String[] args) {
+ PApplet.main(new String[] { CombineTestApp.class.getName() });
+ }
+ public void setup() {
map = new UnfoldingMap(this);
-
+
// Load all countries
List<Feature> countries = GeoJSONReader.loadData(this, "data/countries.geo.json");
List<Marker> countryMarkers = MapUtils.createSimpleMarkers(countries);
@@ -41,7 +46,7 @@ public void setup() {
}
}
map.addMarkers(multiMarker);
-
+
// Zoom in, and center around MultiMarker
map.zoomToLevel(4);
map.panTo(multiMarker.getLocation());
@@ -4,7 +4,6 @@
import java.util.List;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.marker.Marker;
@@ -16,8 +15,8 @@
* Manual multi-marker example showing two polygons for France and Corsica to demonstrate a multi marker. By hovering
* over one of the two areas the whole MultiMarker gets selected, thus both areas are highlighted.
*
- * <p><em>Note, that loading Unfolding's DataReader automatically create and handle multi-marker. Check e.g.
- * {@link MarkerSelectionApp}.</em>
+ * <p>
+ * <em>Note, that loading Unfolding's DataReader automatically creates and handles multi-marker.</em>
* </p>
*
* Set the boolean useMultiMarker to false to see the same areas as independent markers.
@@ -28,9 +27,11 @@
UnfoldingMap map;
- public void setup() {
- size(800, 600, OPENGL);
+ public void settings() {
+ size(800, 600, P2D);
+ }
+ public void setup() {
map = new UnfoldingMap(this, "map");
map.zoomToLevel(4);
map.panTo(new Location(50f, 12f));
@@ -97,4 +98,8 @@ public void mouseMoved() {
return corsicaLocations;
}
+ public static void main(String args[]) {
+ PApplet.main(new String[] { MultiMarkerApp.class.getName() });
+ }
+
}
@@ -1,10 +1,9 @@
package de.fhpotsdam.unfolding.examples.multi;
import processing.core.PApplet;
-
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.geo.Location;
-import de.fhpotsdam.unfolding.providers.MBTilesMapProvider;
+import de.fhpotsdam.unfolding.providers.CartoDB.DarkMatter;
import de.fhpotsdam.unfolding.utils.MapUtils;
import de.fhpotsdam.utils.Integrator;
@@ -13,18 +12,23 @@
*/
public class DayNightTransitionApp extends PApplet {
- public static final String JDBC_CONN_STRING_APPLET = "jdbc:sqlite:../data/tiles/blankDark-1-3.mbtiles";
-
UnfoldingMap mapDay;
UnfoldingMap mapNight;
Integrator blendIntegrator = new Integrator(0);
+ public void settings() {
+ size(800, 600, P2D);
+ }
+
+ public static void main(String[] args) {
+ PApplet.main(new String[] { DayNightTransitionApp.class.getName() });
+ }
+
public void setup() {
- size(800, 600, OPENGL);
mapDay = new UnfoldingMap(this);
- mapNight = new UnfoldingMap(this, new MBTilesMapProvider(JDBC_CONN_STRING_APPLET));
+ mapNight = new UnfoldingMap(this, new DarkMatter());
mapDay.setZoomRange(1, 3);
mapDay.zoomToLevel(3);
Oops, something went wrong.

0 comments on commit 493673e

Please sign in to comment.