From 7b99ad5f6cea9ddbbbdbe9ba8ab4078433c6a11a Mon Sep 17 00:00:00 2001 From: terribl Date: Tue, 14 May 2013 13:04:31 +0300 Subject: [PATCH] Few bugs --- public_html/script.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index a2af763..e78d9b2 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -75,8 +75,8 @@ function selectPlane(selectedPlane) { function refreshGeneralInfo() { var i = document.getElementById('geninfo'); - i.innerHTML += PlanesOnMap + ' planes on map.
'; - i.innerHTML = PlanesOnGrid + ' planes on grid.'; + i.innerHTML = PlanesOnMap + ' planes on map.
'; + i.innerHTML += PlanesOnGrid + ' planes on grid.'; } function refreshSelectedInfo() { @@ -178,8 +178,8 @@ function fetchData() { // Declare our plane that we are working with from our old data set var myplane = Planes[plane.hex]; - // If the lat/long is not 0, we should make a marker for it - if (plane.lat != 0 && plane.lon != 0) { + // If the has valid position, we should make a marker for it + if (plane.validposition) { if (myplane.marker != null) { marker = myplane.marker; var icon = marker.getIcon(); @@ -222,7 +222,7 @@ function fetchData() { } else { // This is a new plane // Do we have a lat/long that is not 0? - if (plane.lat != 0 && plane.lon != 0) { + if (plane.validposition) { // Add new plane to map marker = new google.maps.Marker({ position: new google.maps.LatLng(plane.lat, plane.lon), @@ -242,7 +242,7 @@ function fetchData() { } // If we have lat/long, we must have a marker, so lets set the marker title - if (plane.lat != 0 && plane.lon != 0) { + if (plane.validposition) { if (plane.flight.length == 0) { marker.setTitle(plane.hex) } else {