var size = 0; var ranges_lakes = [[20.057000, 219.690600, [ new ol.style.Style({ 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(247,251,255,1.0)"}) })]], [219.690600, 419.324200, [ new ol.style.Style({ 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(199,220,239,1.0)"}) })]], [419.324200, 618.957800, [ new ol.style.Style({ 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(114,178,215,1.0)"}) })]], [618.957800, 818.591400, [ new ol.style.Style({ 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(40,120,184,1.0)"}) })]], [818.591400, 1018.225000, [ new ol.style.Style({ 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(8,48,107,1.0)"}) })]]]; var styleCache_lakes={} var style_lakes = function(feature, resolution){ var value = feature.get("AREA_MI"); var style = ranges_lakes[0][2]; for (i = 0; i < ranges_lakes.length; i++){ var range = ranges_lakes[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_lakes[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_lakes[key] = new ol.style.Style({"text": text}) } var allStyles = [styleCache_lakes[key]]; allStyles.push.apply(allStyles, style); return allStyles; };