绘制面
- 修改
Draw
方法,设置type
为Circle
,同时修改geometryFunction
为ol.interaction.Draw.createBox()
,以及freehandCondition
为ol.events.condition.always
- 修改加载
Polygon
的样式。
//面样式
if("Polygon" == type){
styles = new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#F00',
width: 1
})
});
}
draw = new ol.interaction.Draw({
source: _vectorSource,
type: _drawOptions.type,
freehandCondition: ol.events.condition.always,
geometryFunction: ol.interaction.Draw.createBox()
});
结合前面几张,综合展示如下图:
tx6.gif
网友评论