通过DrawFeature绘制要素点时,通过featureadded和beforefeatureadded事件,修改了feature的style属性,但是并没有按照我设置的颜色进行绘制
function drawCompleted(eventArgs) {
drawPoint.deactivate();
var f = eventArgs.feature;
console.log(f);
//f.style = style;
}
function drawbefore(eventArgs){
var f = eventArgs.feature;
f.style = style;
f.style.fillColor = fillColor;
console.log(f);
}
style = {
fillColor:"red",
fillOpacity: 1,
hoverFillColor: "white",
hoverFillOpacity: 0.8,
strokeColor: "#ee9900",
strokeOpacity: 1,
strokeWidth: 1,
strokeLinecap: "round",
strokeDashstyle: "solid",
hoverStrokeOpacity: 1,
hoverStrokeWidth: 0.2,
pointRadius: 6,
hoverPointRadius: 1,
hoverPointUnit: "%",
pointerEvents: "visiblePainted",
cursor: "inherit",
fontColor: "#000000",
labelAlign: "cm",
labelOutlineColor: "white",
labelOutlineWidth: 3
};