1
0
Fork 0

Merge branch 'master' of gitorious.org:fg/fgdata

This commit is contained in:
BARANGER Emmanuel 2014-03-24 23:41:32 +01:00
commit 3e0da55b09
2 changed files with 26 additions and 12 deletions

View file

@ -53,7 +53,7 @@
<shade-model>smooth</shade-model> <shade-model>smooth</shade-model>
<cull-face>back</cull-face> <cull-face>back</cull-face>
<render-bin> <render-bin>
<bin-number>111</bin-number> <bin-number>7</bin-number>
<bin-name>DepthSortedBin</bin-name> <bin-name>DepthSortedBin</bin-name>
</render-bin> </render-bin>
<texture-unit> <texture-unit>

View file

@ -211,6 +211,22 @@ html,body,#map {
} }
}, },
filter : function(feature, layer) {
var zoom = map.getZoom();
switch( feature.properties.type ) {
case 'airport':
if( zoom >= 10 ) return true;
return feature.properties.longestRwyLength_m >= 2000;
break;
case 'NDB':
if( zoom >= 10 ) return true;
if( zoom >= 8 ) return feature.properties.range_nm >= 30;
return feature.properties.range_nm > 50;
}
return true;
},
style : function(feature) { style : function(feature) {
if (feature.properties.type == "ILS" || feature.properties.type == "localizer") { if (feature.properties.type == "ILS" || feature.properties.type == "localizer") {
return { return {
@ -243,9 +259,9 @@ html,body,#map {
if (radius < 10) if (radius < 10)
radius = 10; radius = 10;
var filter = "vor,dme,ndb,airport"; var filter = "vor,ndb,airport";
if (radius < 60) if (radius < 60)
filter += ",ils,loc,om"; filter += ",ils,dme,loc,om";
if (radius < 20) if (radius < 20)
filter += ",mm"; filter += ",mm";
@ -276,15 +292,12 @@ html,body,#map {
var overlays = { var overlays = {
"NAVDB" : navdbLayer, "NAVDB" : navdbLayer,
//"ICAO VFR (Germany)" : icaoGermany, "ICAO VFR (Germany)" : icaoGermany,
//"Lower Airspace (Germany)" : lowerGermany, "Lower Airspace (Germany)" : lowerGermany,
"Precipitation" : owmPrecipitation, "Precipitation" : owmPrecipitation,
"Isobares" : owmPressure, "Isobares" : owmPressure,
}; };
L.control.layers(baseLayers, overlays).addTo(map);
L.control.scale().addTo(map);
var aircraftMarker = new L.RotatedMarker(map.getCenter(), { var aircraftMarker = new L.RotatedMarker(map.getCenter(), {
angle : 45, angle : 45,
icon : L.icon({ icon : L.icon({
@ -292,7 +305,8 @@ html,body,#map {
iconAnchor : [ 30, 30 ], iconAnchor : [ 30, 30 ],
popupAncor : [ 0, -32 ], popupAncor : [ 0, -32 ],
iconUrl : "images/aircraft.svg", iconUrl : "images/aircraft.svg",
}) }),
zIndexOffset: 10000,
}); });
aircraftMarker.addTo(map); aircraftMarker.addTo(map);
aircraftMarker.setState = function(s) { aircraftMarker.setState = function(s) {
@ -324,18 +338,18 @@ html,body,#map {
this._div.innerHTML = s; this._div.innerHTML = s;
}; };
info.addTo(map);
var FollowAircraftControl = L.control(); var FollowAircraftControl = L.control();
FollowAircraftControl.onAdd = function(map) { FollowAircraftControl.onAdd = function(map) {
this._div = L.DomUtil.create('div', 'followAircraft'); this._div = L.DomUtil.create('div', 'followAircraft');
this._div.innerHTML = '<img src="images/followAircraft.svg" title="Center Map on Aircraft Position" />'; this._div.innerHTML = '<img src="images/followAircraft.svg" title="Center Map on Aircraft Position" />';
this._div.onclick = function() { toggleFollowAircraft(); return true; }; this._div.onclick = function() { toggleFollowAircraft(); return true; };
// this.update();
return this._div; return this._div;
} }
L.control.scale().addTo(map);
info.addTo(map);
FollowAircraftControl.addTo(map); FollowAircraftControl.addTo(map);
L.control.layers(baseLayers, overlays).addTo(map);
map.on('resize', function(e) { map.on('resize', function(e) {
navdbLayer.dirty = true; navdbLayer.dirty = true;