package guimodule;

import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.providers.Google;
import de.fhpotsdam.unfolding.utils.MapUtils;
import processing.core.PApplet;

public class LifeExpectancy extends PApplet{
	private UnfoldingMap map;
	
	public void setup(){
		size(800, 600, OPENGL);
		map =  new UnfoldingMap(this, 50, 50, 700, 500, new Google.GoogleMapProvider());
		MapUtils.createDefaultEventDispatcher(this, map);
	}
	
	public void drow(){
		map.draw();
	}

}

@@ -13,16 +13,65 @@
 odule;%0A%0A
+import java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 import d
@@ -310,30 +310,184 @@
 p;%0A%09
-%0A%09public void setup()%7B
+private Map%3CString,Float%3E lifeExpectationByCountry;%0A%09%0A%09public void setup()%7B%0A%09%09lifeExpectationByCountry = loadLifeExpectancyFromCSV(%22%22%0A%09%09%09%09+ %22data/LifeExpectancyWorldBank.csv%22);
 %0A%09%09s
@@ -647,18 +647,16 @@
 ap);%0A%09%7D%0A
-%09%0A
 %09public 
@@ -684,12 +684,412 @@
 aw();%0A%09%7D
+%0A%09%0A%09private Map%3CString, Float%3E loadLifeExpectancyFromCSV(String filename) %7B%0A%09%09Map%3CString,Float%3E lifeExpecByCountry = new HashMap%3CString,Float%3E();%0A%09%09String%5B%5D rows = loadStrings(filename);%0A%09%09for(String row:rows)%7B%0A%09%09%09String%5B%5D colmuns = row.split(%22,%22);%0A%09%09%09if(true)%7B%0A%09%09%09%09float value = Float.parseFloat(colmuns%5B5%5D);%0A%09%09%09%09lifeExpecByCountry.put(colmuns%5B4%5D, value);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return lifeExpecByCountry;%0A%09%7D%0A%0A%09
 %0A%0A%7D%0A

Load CSV Data