var size = 0; var ranges_pipelines = [[1.000000, 8.400000, [ new ol.style.Style({ stroke: new ol.style.Stroke({color: "rgba(247,251,255,1.0)", lineDash: null, lineCap: 'square', lineJoin: 'bevel', width: 0}), })]], [8.400000, 15.800000, [ new ol.style.Style({ stroke: new ol.style.Stroke({color: "rgba(199,220,239,1.0)", lineDash: null, lineCap: 'square', lineJoin: 'bevel', width: 0}), })]], [15.800000, 23.200000, [ new ol.style.Style({ stroke: new ol.style.Stroke({color: "rgba(114,178,215,1.0)", lineDash: null, lineCap: 'square', lineJoin: 'bevel', width: 0}), })]], [23.200000, 30.600000, [ new ol.style.Style({ stroke: new ol.style.Stroke({color: "rgba(40,120,184,1.0)", lineDash: null, lineCap: 'square', lineJoin: 'bevel', width: 0}), })]], [30.600000, 38.000000, [ new ol.style.Style({ stroke: new ol.style.Stroke({color: "rgba(8,48,107,1.0)", lineDash: null, lineCap: 'square', lineJoin: 'bevel', width: 0}), })]]]; var styleCache_pipelines={} var style_pipelines = function(feature, resolution){ var value = feature.get("cat"); var style = ranges_pipelines[0][2]; for (i = 0; i < ranges_pipelines.length; i++){ var range = ranges_pipelines[i]; if (value > range[0] && value<=range[1]){ style = range[2]; } }; if ("" !== null) { var labelText = String(""); } else { var labelText = "" } var key = value + "_" + labelText if (!styleCache_pipelines[key]){ var text = new ol.style.Text({ font: '10.725px Calibri,sans-serif', text: labelText, textBaseline: "center", textAlign: "left", offsetX: 5, offsetY: 3, fill: new ol.style.Fill({ color: "rgba(0, 0, 0, 255)" }), }); styleCache_pipelines[key] = new ol.style.Style({"text": text}) } var allStyles = [styleCache_pipelines[key]]; allStyles.push.apply(allStyles, style); return allStyles; };