Giter Site home page Giter Site logo

benlansdell / flying-overhead Goto Github PK

View Code? Open in Web Editor NEW
12.0 5.0 6.0 357 KB

Announce flights of anything directly overhead.

License: MIT License

Makefile 0.15% Python 32.44% CSS 2.00% HTML 65.42%
flight-track flight-tracking flight-tracker opensky-api

flying-overhead's Issues

JS opensky api call

Hi, I love the project, Thanks for helping me out bc I'm doing something similar :)
I found how to do the opensky api call from the browser, just leaving it in case anyone is interested

export async function getFlights( coords ) {
 
     // get the user's longitude and latitude
     const [ longitude, latitude ] = [ coords.longitude, coords.latitude ];
 
     // find the min and max longitude and latitude of the search area
     const kmPerDegreeLatitude  = 111.2
     const kmPerDegreeLongitude = 111.2 * Math.cos( latitude / 180 * Math.PI )
     const latitudeDegrees  = SEARCH_DISTANCE / kmPerDegreeLatitude
     const longitudeDegrees = SEARCH_DISTANCE / kmPerDegreeLongitude
 
     // build the query string
     const parameters = {
         lamin: latitude  - latitudeDegrees,
         lomin: longitude - longitudeDegrees,
         lamax: latitude  + latitudeDegrees,
         lomax: longitude + longitudeDegrees
     }
     const queryString = new URLSearchParams(parameters).toString();
 
     // make the request and set the openskyResponse variable
     const response = await fetch( OPENSKY_URL + "?" + queryString, {method: "GET", headers: HEADERS} );
     const openskyResponse = await response.json();

    return openskyResponse;
}

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.