talonendm / Processing

Processing GPL experiments
GNU General Public License v2.0
0 stars 0 forks source link

new KetaiLocation created in setup #1

Open talonendm opened 8 years ago

talonendm commented 8 years ago

which one is better, current one or like this?


void setup() {
  //fullScreen(); // orientation(LANDSCAPE);
  orientation(PORTRAIT);
  textAlign(CENTER, CENTER);
  textSize(36);
  location = new KetaiLocation(this);
}

void draw() {
  background(78, 93, 75);
  zoomi2 = zoomi - 12;
  if (location.getProvider() == "none")
    text("Location data is unavailable. \n" +
      "Please check your location settings.",  0, 0, width, height);
  else
    text("Latitude: " + latitude + "\n" + 
      "Longitude: " + longitude + "\n" + 
      "Altitude: " + altitude + "\n" + 
      "Provider: " + location.getProvider() + "\n" + 
      "Zoom: " + zoomi +", "+zoomi2 ,  0, 0, width, height);

  // getProvider() returns "gps" if GPS is available
  // otherwise "network" (cell network) or "passive" (WiFi MACID)
}

void onLocationEvent(double _latitude, double _longitude, double _altitude)
{
  longitude = _longitude;
  latitude = _latitude;
  altitude = _altitude;
  println("lat/lon/alt: " + latitude + "/" + longitude + "/" + altitude);
}

``