Skip to content

Commit

Permalink
Display flights with alert squawk in an other color
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Oct 20, 2015
1 parent aa2cced commit 68f3e73
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions js/map.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,19 @@ function airportPopup (feature, layer) {


function update_airportsLayer() {
if (typeof airportsLayer != 'undefined') {
if (map.hasLayer(airportsLayer) == true) {
map.removeLayer(airportsLayer);
}
}
<?php
if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom'];
else $getZoom = '7';
?>
//if (map.getZoom() <= <?php print $getZoom; ?>) {
if (typeof airportsLayer != 'undefined') {
if (map.hasLayer(airportsLayer) == true) {
map.removeLayer(airportsLayer);
}
}
//}
if (map.getZoom() > <?php print $getZoom; ?>) {
//if (typeof airportsLayer == 'undefined' || map.hasLayer(airportsLayer) == false) {
var bbox = map.getBounds().toBBoxString();
airportsLayer = new L.GeoJSON.AJAX("<?php print $globalURL; ?>/airport-geojson.php?coord="+bbox,{
onEachFeature: airportPopup,
Expand All @@ -239,6 +242,8 @@ function update_airportsLayer() {
});
}
}).addTo(map);

//}
}
};

Expand Down Expand Up @@ -475,6 +480,10 @@ function getLiveData()
//var iconURLpath = '<?php print $globalURL; ?>/images/aircrafts/selected/'+feature.properties.aircraft_shadow;
var iconURLpath = '<?php print $globalURL; ?>/getImages.php?color=FF0000&filename='+feature.properties.aircraft_shadow;
var iconURLShadowpath = '<?php print $globalURL; ?>/getImages.php?color=8D93B9&filename='+feature.properties.aircraft_shadow;
} else if ( feature.properties.squawk == "7700" || feature.properties.squawk == "7600" || feature.properties.squawk == "7500" ) {
//var iconURLpath = '<?php print $globalURL; ?>/images/aircrafts/selected/'+feature.properties.aircraft_shadow;
var iconURLpath = '<?php print $globalURL; ?>/getImages.php?color=FF8C00&filename='+feature.properties.aircraft_shadow;
var iconURLShadowpath = '<?php print $globalURL; ?>/getImages.php?color=8D93B9&filename='+feature.properties.aircraft_shadow;
} else {
//var iconURLpath = '<?php print $globalURL; ?>/images/aircrafts/'+feature.properties.aircraft_shadow;
var iconURLpath = '<?php print $globalURL; ?>/getImages.php?color=<?php print $IconColor; ?>&filename='+feature.properties.aircraft_shadow;
Expand Down

0 comments on commit 68f3e73

Please sign in to comment.