Skip to content

Commit

Permalink
Wenn Daten fehlen, gibt es z.Bsp. keinen Code fuer die Flagge.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfoerster committed Feb 17, 2012
1 parent 106dd4e commit 19d9758
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
Binary file added img/noFlag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 13 additions & 14 deletions js/ais-formatter.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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();
Expand All @@ -121,7 +120,7 @@ var createMarkerContent = function(vesselinfo) {

content =
"<div class='container'>"+
"<div class='flag'>"+"<img src='" + flagSrc+ vesselinfo.flagid +".png'/> "+"</div>" +
"<div class='flag'>"+"<img src='"+ vesselinfo.flaglnk +"' /></div>" +

" <div class='vesselname'>"+ cnvrt2Upper(vesselinfo.name)+ "</div>" + translateType(vesselinfo.type) +
"<dl class='table-display'>"+
Expand Down
2 changes: 1 addition & 1 deletion js/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 19d9758

Please sign in to comment.