Thank you for the reference and the idea there. The trick for me is that I need to have animations running while we wait 1 minute to retrieve the data. Here is another timer version that may allow this to happen, but I also assume that there are lines in the code you gave above I may need, in specific the ones regarding PGraphics. I read through the forum you linked where that code came from and people seem to have issues. Anyway, here is a sample timer I am trying to look at. I just don't know where to plug the time in, and whether or not I need to throw this entire thing into its own special void, or where to put the loadStrings for the CSV file. Actually, I will just send you my entire code so far, if it isnt too much trouble.
- PImage backgroundMap;
- float mapGeoLeft = -180;
- float mapGeoRight = 180;
- float mapGeoTop = 80;
- float mapGeoBottom = -80;
- float mapScreenWidth,mapScreenHeight;
- ********
- void setup()
- {
- size(1680, 1050);
- backgroundMap = loadImage("Map.jpg");
- mapScreenWidth = width;
- mapScreenHeight = height;
-
- String lines[] = loadStrings("http://earthquake.usgs.gov/earthquakes/feed/v0.1/summary/1.0_week.csv");
- println("there are this many lines:" + lines.length);
- for (int i = 0; i < lines.length; i++) {
- println(lines[i]);
- }
- }
- ********
- void draw()
- {
- image(backgroundMap,0,0,mapScreenWidth,mapScreenHeight);
-
- fill(0,205,0);
-
- PVector p = geoToPixel(new PVector(-116.057, 32.828));
- ellipse(p.x,p.y,50,50);
- }
- *********
- public PVector geoToPixel(PVector geoLocation)
- {
- return new PVector(mapScreenWidth*(geoLocation.x-mapGeoLeft)/
- (mapGeoRight-mapGeoLeft), mapScreenHeight -
- mapScreenHeight*(geoLocation.y-mapGeoBottom)
- /(mapGeoTop-mapGeoBottom));
- }
- *********
- class Timer
- {
- int savedTime;
- boolean running = false;
- int totalTime;
-
- Timer(int tempTotalTime) {
- totalTime = tempTotalTime;
- }
-
- void start() {
- running = true;
- savedTime = millis();
- }
-
- boolean isFinished()
- {
- int passedTime = millis() - savedTime;
- if (running && passedTime > totalTime) {
- running = false;
- return true;
- } else {
- return false;
- }
- }
-
- }