Skip to content

Instantly share code, notes, and snippets.

@pushmatrix
Last active May 23, 2023 17:17
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save pushmatrix/6570585 to your computer and use it in GitHub Desktop.
Save pushmatrix/6570585 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
@mawg
Copy link

mawg commented Apr 18, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment