From 19d9758ece0bd5acf6243fd2704ff46ffa378f42 Mon Sep 17 00:00:00 2001 From: Dirk Foerster Date: Fri, 17 Feb 2012 12:32:40 +0100 Subject: [PATCH] Wenn Daten fehlen, gibt es z.Bsp. keinen Code fuer die Flagge. --- img/noFlag.png | Bin 0 -> 131 bytes js/ais-formatter.js | 27 +++++++++++++-------------- js/parser.js | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 img/noFlag.png diff --git a/img/noFlag.png b/img/noFlag.png new file mode 100644 index 0000000000000000000000000000000000000000..56db4e7f0830215e3f167d4616eacb1821d94d14 GIT binary patch literal 131 zcmeAS@N?(olHy`uVBq!ia0vp^VjwmL8<1SPbY3!$Vo7)Ob!1@J*w6hZkrl{iFY)ws zWxvKDBBY?J;dl|GN8QuKF~q_@`42w}&lU!S=1fM3j6@9!5jWnp)&m&<2QDAV2)JOU Z!La;}f>dW@_B5at22WQ%mvv4FO#nANA(8+9 literal 0 HcmV?d00001 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");