var MAP_ICON = {}; MAP_ICON["VOR"] = L.icon({ iconSize : [ 30, 30 ], iconAnchor : [ 15, 15 ], popupAncor : [ 0, -17 ], iconUrl : "images/vor.svg", }); MAP_ICON["NDB"] = L.icon({ iconSize : [ 30, 30 ], iconAnchor : [ 15, 15 ], popupAncor : [ 0, -17 ], iconUrl : "images/ndb.svg", }); MAP_ICON["dme"] = L.icon({ iconSize : [ 30, 30 ], iconAnchor : [ 15, 15 ], popupAncor : [ 0, -17 ], iconUrl : "images/dme.svg", }); MAP_ICON["airport-paved"] = L.icon({ iconSize : [ 30, 30 ], iconAnchor : [ 15, 15 ], popupAncor : [ 0, -17 ], iconUrl : "images/airport-paved.svg", }); MAP_ICON["airport-unpaved"] = L.icon({ iconSize : [ 30, 30 ], iconAnchor : [ 15, 15 ], popupAncor : [ 0, -17 ], iconUrl : "images/airport-unpaved.svg", }); MAP_ICON["airport-unknown"] = L.icon({ iconSize : [ 30, 30 ], iconAnchor : [ 15, 15 ], popupAncor : [ 0, -17 ], iconUrl : "images/airport-unknown.svg", }); MAP_ICON["arp"] = L.icon({ iconSize : [ 30, 30 ], iconAnchor : [ 15, 15 ], popupAncor : [ 0, -17 ], iconUrl : "images/arp.svg", }); MAP_ICON["aircraft"] = L.icon({ iconSize : [ 20, 20 ], iconAnchor : [ 10, 10 ], popupAncor : [ 0, -12 ], iconUrl : "images/aircraft.svg", }); L.NavdbLayer = L.GeoJSON.extend({ options: { pointToLayer : function(feature, latlng) { var options = { title : feature.properties.id + ' (' + feature.properties.name + ')', alt : feature.properties.id, riseOnHover : true, }; if (feature.properties.type == "airport") { if( map.getZoom() >= 13 ) { options.icon = MAP_ICON['arp']; } else { options.angle = feature.properties.longestRwyHeading_deg; switch (feature.properties.longestRwySurface) { case 'asphalt': case 'concrete': options.icon = MAP_ICON['airport-paved']; break; case 'unknown': options.icon = MAP_ICON['airport-unknown']; break; default: options.icon = MAP_ICON['airport-unpaved']; break; } } } else { if (feature.properties.type in MAP_ICON) { options.icon = MAP_ICON[feature.properties.type]; } } return L.rotatedMarker(latlng, options); }, /* onEachFeature : function(feature, layer) { if (feature.properties) { var popupString = '