// insert JavaScript source code here

// === The basis of the arrow icon information ===
var arrowIcon = new GIcon();
arrowIcon.iconSize = new GSize(12,12);
arrowIcon.shadowSize = new GSize(1,1);
arrowIcon.iconAnchor = new GPoint(6,6);
arrowIcon.infoWindowAnchor = new GPoint(0,0);
 
// === A function to put arrow heads at intermediate points
function arrowhead(myPT,myBear)
{
    // == round it to a multiple of 3 and cast out 120s
    var dir = Math.round(myBear/3) * 3;
    while (dir >= 120)
    {
        dir -= 120;
    }
    // == use the corresponding triangle marker
    arrowIcon.image = "http://www.google.com/intl/en_ALL/mapfiles/dir_"+dir+".png";
    map.addOverlay(new GMarker(myPT, arrowIcon));
}
