Created
November 3, 2015 14:41
-
-
Save denkspuren/2a7e380f2f2a5b3c703e to your computer and use it in GitHub Desktop.
Track the International Space Station (ISS) with Processing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://open-notify.org/Open-Notify-API/ISS-Location-Now/ | |
// https://developers.google.com/maps/documentation/static-maps/intro | |
// https://developers.google.com/maps/documentation/static-maps/ | |
JSONObject json; | |
double latitude, longitude; | |
int zoomVal = 3; | |
PImage img; | |
void setup() { | |
size(640,480); | |
frameRate(1); | |
} | |
void draw() { | |
json = loadJSONObject("http://api.open-notify.org/iss-now.json"); | |
latitude = json.getJSONObject("iss_position").getDouble("latitude"); | |
longitude = json.getJSONObject("iss_position").getDouble("longitude"); | |
String mapurl = "https://maps.googleapis.com/maps/api/staticmap?"; | |
// String apiKey = "???"; // create your own key, see Google link above | |
String center = "¢er=" + Double.toString(latitude) + "," + Double.toString(longitude); | |
String zoom = "&zoom=" + Integer.toString(zoomVal); | |
String size = "&size=640x480"; | |
String options = center + zoom + size + apiKey; | |
img = loadImage(mapurl + options, "png"); | |
image(img, 0, 0); | |
ellipse(width/2, height/2, 10, 10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks, i just tweaked one tiny thing in my fork. Sadly you can't make an pull request for an gist