常用styleFunc
var styleFunc = function (feature) {
var property = feature.getProperties();
return new ol.style.Style({
// 图片
image: new ol.style.Icon({
src: '../../images/windAlter.png',
anchor: [0.5, 0.5],
//size: [76, 68],
offset: [0, 0],
opacity: 1,
scale: 1,
rotation: property.CompCourseAngle * Math.PI / 180
}),
// 字体
text: new ol.style.Text({
font: '16px 微软雅黑 ',
text: property.name,
fill: new ol.style.Fill({
color: '#021935'
}),
stroke: new ol.style.Stroke({
color: 'rgba(0,0,0,0)',
width: 1
}),
//offsetX: 12,
offsetY: -34
}),
// 圆形
image: new ol.style.Circle({
// 圆形颜色