var size = 0; function categories_airports(feature, value) { switch(value) {case "Civilian/Public": return [ new ol.style.Style({ image: new ol.style.Circle({radius: 4.0 + size, stroke: new ol.style.Stroke({color: 'rgba(0,0,0,1.0)', lineDash: null, lineCap: 'butt', lineJoin: 'miter', width: 0}), fill: new ol.style.Fill({color: 'rgba(222,26,193,1.0)'})}) })]; break; case "Joint Military/Civilian": return [ new ol.style.Style({ image: new ol.style.Circle({radius: 4.0 + size, stroke: new ol.style.Stroke({color: 'rgba(0,0,0,1.0)', lineDash: null, lineCap: 'butt', lineJoin: 'miter', width: 0}), fill: new ol.style.Fill({color: 'rgba(112,117,206,1.0)'})}) })]; break; case "Military": return [ new ol.style.Style({ image: new ol.style.Circle({radius: 4.0 + size, stroke: new ol.style.Stroke({color: 'rgba(0,0,0,1.0)', lineDash: null, lineCap: 'butt', lineJoin: 'miter', width: 0}), fill: new ol.style.Fill({color: 'rgba(215,134,93,1.0)'})}) })]; break; case "Other": return [ new ol.style.Style({ image: new ol.style.Circle({radius: 4.0 + size, stroke: new ol.style.Stroke({color: 'rgba(0,0,0,1.0)', lineDash: null, lineCap: 'butt', lineJoin: 'miter', width: 0}), fill: new ol.style.Fill({color: 'rgba(122,222,41,1.0)'})}) })]; break; case "": return [ new ol.style.Style({ image: new ol.style.Circle({radius: 4.0 + size, stroke: new ol.style.Stroke({color: 'rgba(0,0,0,1.0)', lineDash: null, lineCap: 'butt', lineJoin: 'miter', width: 0}), fill: new ol.style.Fill({color: 'rgba(86,218,185,1.0)'})}) })]; break;}}; var styleCache_airports={} var style_airports = function(feature, resolution){ var value = feature.get("USE"); var style = categories_airports(feature, value); if ("" !== null) { var labelText = String(""); } else { var labelText = "" } var key = value + "_" + labelText if (!styleCache_airports[key]){ var text = new ol.style.Text({ font: '10.725px \'MS Shell Dlg 2\', sans-serif', text: labelText, textBaseline: "center", textAlign: "left", offsetX: 5, offsetY: 3, fill: new ol.style.Fill({ color: 'rgba(0, 0, 0, 255)' }), }); styleCache_airports[key] = new ol.style.Style({"text": text}) } var allStyles = [styleCache_airports[key]]; allStyles.push.apply(allStyles, style); return allStyles; };