style_select = function(feature, resolution) {
var context = {
feature: feature,
variables: {}
};
var size = 0;
console.log(feature);
if (feature.get("features")) {
console.log("ok");
size = feature.get("features").length;
if (size > 1) {
size = 2 * (Math.log(size) / Math.log(2));
}
console.log(size);
}
var style = [
new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'black',
width: 1.4
}),
fill: new ol.style.Fill({ color: 'rgba(255,255,255,0.5)' })
}),
new ol.style.Style({
image: new ol.style.Circle({
color: 'rgba(228,26,28,1.0)',
radius: 4 + size,
fill: new ol.style.Fill({
color: 'rgba(255,255,255,0.5)'
}),
stroke: new ol.style.Stroke({
color: 'black',
width: 1.4
})
}),
zIndex: Infinity
})
];
return style;
}