Giter Site home page Giter Site logo

lukedawilson / nasa Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5.93 MB

Takes two NASA datasets (the International Space Station location, and exoplanet data), and overlays them on Google Earth and Google Sky, respectively; written in C#/ASP.NET

C# 35.35% CSS 5.19% ASP 0.51% JavaScript 3.08% HTML 55.87%

nasa's Introduction

Nasa

Takes two NASA datasets (the International Space Station location, and exoplanet data), and overlays them on Google Earth and Google Sky, respectively; written in C#/ASP.NET.

This was based on an interactive session given as part of Trayport's internal employee tech talk series.

Mars weather API

http://marsweather.ingenology.com/ (e.g. http://marsweather.ingenology.com/v1/archive/)

ExoAPI

http://exoapi.com/ (e.g. http://exoapi.com/api/skyhook/planets/search?habitable=1)

ISS location API

http://open-notify.org/Open-Notify-API/ISS-Location-Now/ (e.g. http://api.open-notify.org/iss-now.json)

Chart API

google.load('visualization', '1.0', { 'packages': ['corechart'] });
google.setOnLoadCallback(function() {
   $.ajax({
      url: "@Url.Action("HttpRequestSync", new { url = api_call })"
   }).success(function_to_render_data);
});

https://developers.google.com/chart/

https://developers.google.com/chart/interactive/docs/gallery/barchart

Earth API

var ge;
google.load("earth", "1", { "other_params": "sensor=false" });

function init() { google.earth.createInstance('map3d', initCB); }

function initCB(instance) {
   ge = instance;
   ge.getWindow().setVisibility(true);

   (Make call to api, call showMap with returned data) 
}
      
function showMap(data) {
   ge.getOptions().setMapType(map_type);

   setTimeout(function () {
      (Parse data here)
      
      // Create location object
      var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
      lookAt.setLatitude(some_latitude);
      lookAt.setLongitude(some_longitude);

      // Zoom to point
      var oldFlyToSpeed = ge.getOptions().getFlyToSpeed();
      ge.getOptions().setFlyToSpeed(.2);  // Slow down the camera flyTo speed.
      ge.getView().setAbstractView(lookAt);
      ge.getOptions().setFlyToSpeed(oldFlyToSpeed);
  }, 1000);  // Start the zoom-in after one second.
}

google.setOnLoadCallback(init);

http://www.google.com/earth/explore/products/plugin.html

https://developers.google.com/earth/documentation/index

https://developers.google.com/earth/documentation/sky_mars_moon

http://earth-api-samples.googlecode.com/svn/trunk/examples/placemark-point.html

http://earth-api-samples.googlecode.com/svn/trunk/examples/event-placemark.html

HTTP request helper

$.ajax({ 
   url: "@Url.Action("HttpRequestSync", new { url = some_url })"
}).success(some_function);

Parse JSON response

JSON.parse(data)

Create a placemark (pin)

var placemark = ge.createPlacemark('');
ge.getFeatures().appendChild(placemark);

var point = ge.createPoint('');
point.setLatitude(some_latitude);
point.setLongitude(some_longitude);
placemark.setGeometry(point);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.