Skip to content

Instantly share code, notes, and snippets.

@nextwebb
Forked from pushmatrix/gist:6570585
Created December 5, 2020 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nextwebb/3e54d551e6bac60488294ce5b61dfc1f to your computer and use it in GitHub Desktop.
Save nextwebb/3e54d551e6bac60488294ce5b61dfc1f to your computer and use it in GitHub Desktop.
How to get started building a ship tracking app.
- Find an API that supplies the data.
- I found the one that MarineTraffic.com uses (http://www.marinetraffic.com)
- Open your computer's terminal, and paste this:
curl 'http://www.marinetraffic.com/ais/getjson.aspx?sw_x=0&sw_y=70&ne_x=30&ne_y=80&zoom=6&fleet=&station=0&id=null' -H 'Referer: http://www.marinetraffic.com/ais/'
- This shows you all the data. You will now need to automate calling this API
- Get the data from the API using something like jQuery:
- Documentation: http://api.jquery.com/jQuery.getJSON/
- Tutorial :http://www.youtube.com/watch?v=3hN4PrJ7R6A
- Learn how to interact with Google Maps API:
- Basic tutorial (http://enriquemorenotent.com/basic-google-maps-api-v3-tutorial/)
- Example of adding markers(https://developers.google.com/maps/documentation/javascript/examples/marker-simple)
The flow of the app will be something like this:
- display a map
- call the API to get boat positions
- For each boat position, add a marker to the map.
- Rinse & Repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment