diff --git a/img/noFlag.png b/img/noFlag.png new file mode 100644 index 0000000..56db4e7 Binary files /dev/null and b/img/noFlag.png differ diff --git a/js/ais-formatter.js b/js/ais-formatter.js index fa26352..430f738 100644 --- a/js/ais-formatter.js +++ b/js/ais-formatter.js @@ -1,3 +1,14 @@ +var direction = new Array(); + direction["7"] = "Nordwest"; + direction["8"] = "Nord"; + direction["9"] = "Nordost"; + direction["6"] = "0st"; + direction["3"] = "Südost"; + direction["2"] = "Süd"; + direction["1"] = "Südwest"; + direction["4"] = "West"; + direction["5"] = "unbekannt"; + var translations = new Array(); // states @@ -86,19 +97,7 @@ var cnvrt2Upper = function (str) { } } -var createMarkerContent = function(vesselinfo) { - - var direction = new Array(); - direction["7"] = "Nordwest"; - direction["8"] = "Nord"; - direction["9"] = "Nordost"; - direction["6"] = "0st"; - direction["3"] = "Südost"; - direction["2"] = "Süd"; - direction["1"] = "Südwest"; - direction["4"] = "West"; - direction["5"] = "unbekannt"; - +var createMarkerContent = function(vesselinfo) { // get optional content var description = new Object(); @@ -121,7 +120,7 @@ var createMarkerContent = function(vesselinfo) { content = "
"+ - "
"+" "+"
" + + "
"+"
" + "
"+ cnvrt2Upper(vesselinfo.name)+ "
" + translateType(vesselinfo.type) + "
"+ diff --git a/js/parser.js b/js/parser.js index 980e89d..08a179b 100644 --- a/js/parser.js +++ b/js/parser.js @@ -59,7 +59,7 @@ var parseXml = function(xmlDoc) { vessel.left = this.getAttribute("left"); vessel.front = this.getAttribute("front"); vessel.nationality = this.getAttribute("country"); - vessel.flagid = this.getAttribute("flag"); + vessel.flaglnk = ((this.getAttribute("flag")==null)?"img/noFlag.png":flagSrc+ this.getAttribute("flag") +".png"); vessel.speed = ((this.getAttribute("speed")==null)?"0":this.getAttribute("speed")); vessel.pic = this.getAttribute("p"); vessel.lastSeen = this.getAttribute("last_seen");