I’m trying to integrate in a dashboard a map generated by VesselFinder site to visualize and track the movements of ships.
The VesselFinder site provides the javascript snippet to display the map on an html page:
<script type="text/javascript">
// Map appearance
var width="20%"; // width in pixels or percentage
var height="100"; // height in pixels
var names=true; // always show ship names (defaults to false)
// Single ship tracking
var imo="9227429"; // display latest position (by IMO, overrides MMSI)
var show_track=true; // display track line (last 24 hours)
</script>
<script type="text/javascript" src="https://www.vesselfinder.com/aismap.js"></script>
As much as I tried however to create a js file putting it in the assets folder, I was not able to see the map on my dashboard. Do you have any suggestions?
Just a quick and dirty code (I also don’t know how often the map updates) but what about making an interval callback with the output being the src of the iframe?