Last active
May 23, 2023 17:17
-
-
Save pushmatrix/6570585 to your computer and use it in GitHub Desktop.
How to get started building a ship tracking app.
This file contains 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
- 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
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 is now 404 "nothing to sea here" :-)