|
@@ -1,11 +1,11 @@
|
|
|
import {
|
|
|
- Style,
|
|
|
- Circle,
|
|
|
- Icon,
|
|
|
- Fill,
|
|
|
- RegularShape,
|
|
|
- Stroke,
|
|
|
- Text
|
|
|
+ Style,
|
|
|
+ Circle,
|
|
|
+ Icon,
|
|
|
+ Fill,
|
|
|
+ RegularShape,
|
|
|
+ Stroke,
|
|
|
+ Text
|
|
|
} from 'ol/style'
|
|
|
|
|
|
import { OverviewMap, ScaleLine, MousePosition } from "ol/control";
|
|
@@ -13,254 +13,396 @@ import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer";
|
|
|
import { OSM, XYZ, Vector as VectorSource } from "ol/source";
|
|
|
import GeoJSON from "ol/format/GeoJSON";
|
|
|
import { createStringXY, format } from "ol/coordinate";
|
|
|
-import { Select, Pointer, Draw, Modify, } from "ol/interaction";
|
|
|
+import { Select, Pointer, Draw, Modify } from "ol/interaction";
|
|
|
import { fromLonLat, toLonLat } from "ol/proj";
|
|
|
import Feature from "ol/Feature";
|
|
|
import { Point } from "ol/geom";
|
|
|
import { createRegularPolygon, createBox } from 'ol/interaction/Draw'
|
|
|
-
|
|
|
+
|
|
|
+import { spatialRelationship } from './spatialRelationship'
|
|
|
+
|
|
|
+
|
|
|
+ * 设置通用的图形符号
|
|
|
+ * */
|
|
|
+class DrawTools {
|
|
|
|
|
|
- * 设置通用的图形符号
|
|
|
- * */
|
|
|
-class DrawTools{
|
|
|
-
|
|
|
- * 地图
|
|
|
- * */
|
|
|
- map=null;
|
|
|
-
|
|
|
-
|
|
|
- * 点要素的默认样式
|
|
|
- * */
|
|
|
- point={
|
|
|
- color:'#fc5531',
|
|
|
- outColor:"#fc5531",
|
|
|
- size:2,
|
|
|
- }
|
|
|
+ * 地图
|
|
|
+ * */
|
|
|
+ map = null;
|
|
|
+
|
|
|
+
|
|
|
+ * 点要素的默认样式
|
|
|
+ * */
|
|
|
+ point = {
|
|
|
+ color: '#fc5531',
|
|
|
+ outColor: "#fc5531",
|
|
|
+ size: 2,
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 线要素的默认样式
|
|
|
+ * */
|
|
|
+ line = {
|
|
|
+ color: '#fc5531',
|
|
|
+ width: 3
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 面要素的默认样式
|
|
|
+ * */
|
|
|
+ polygon = {
|
|
|
+ fillColor: 'rgba(252, 86, 49, 0.1)'
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ * 绘制要素
|
|
|
+ * */
|
|
|
+ drawFeature = null;
|
|
|
+
|
|
|
+
|
|
|
+ * 绘制图形资源
|
|
|
+ * */
|
|
|
+ vectorSource = null;
|
|
|
+
|
|
|
+
|
|
|
+ * 绘制工具
|
|
|
+ * */
|
|
|
+ drawTool = null;
|
|
|
+
|
|
|
+
|
|
|
+ * 图形修改工具
|
|
|
+ */
|
|
|
+ modifyTool = null;
|
|
|
+
|
|
|
+
|
|
|
+ * 图形选择工具
|
|
|
+ */
|
|
|
+ select = null;
|
|
|
+
|
|
|
+
|
|
|
+ * 图形修改工具
|
|
|
+ */
|
|
|
+ modify = null;
|
|
|
+
|
|
|
+ lineWeight = 1;
|
|
|
+
|
|
|
+ lineColor = "#e3e3e3";
|
|
|
|
|
|
-
|
|
|
- * 线要素的默认样式
|
|
|
- * */
|
|
|
- line={
|
|
|
- color:'#fc5531',
|
|
|
- width:3
|
|
|
+ color = [255, 255, 255];
|
|
|
+
|
|
|
+ opacity = 0.33
|
|
|
+
|
|
|
+ spatialRelationship = spatialRelationship
|
|
|
+
|
|
|
+
|
|
|
+ * 初始化地图和绘制样式
|
|
|
+ * @map 地图元素
|
|
|
+ * @lineWeight 线宽 Integer
|
|
|
+ * @lineColor 先颜色 string #e3e3e3
|
|
|
+ * @color 图形填充颜色 array [255,255,255]
|
|
|
+ * @opacity 填充透明度 Float 0.33
|
|
|
+ */
|
|
|
+ initMap(map, lineWeight, lineColor, color, opacity) {
|
|
|
+ this.map = map
|
|
|
+ this.lineWeight = lineWeight
|
|
|
+ this.lineColor = lineColor
|
|
|
+ this.color = color
|
|
|
+ this.opacity = opacity
|
|
|
+ }
|
|
|
+
|
|
|
+ * 初始化绘制事件
|
|
|
+ * @drawType String 绘制类型(Point、LineString、Polygon、Circle,Square,Box)=>(点、线、多边形、圆形、长方形、正方形)
|
|
|
+ * @isEdit Boolean 是否是图形新增或者编辑
|
|
|
+ * @returnFunc 回调函数
|
|
|
+ */
|
|
|
+ initDrawHandler(drawType, isEdit, returnFunc) {
|
|
|
+ if (this.map == null) {
|
|
|
+ console.log('请先初始化地图,终止绘制!')
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.removeInteraction()
|
|
|
+
|
|
|
+ this.removeDrawSource()
|
|
|
+ let feature = null
|
|
|
+ const fillColor = this.color.filter(p => true)
|
|
|
+ fillColor.push(parseFloat(this.opacity));
|
|
|
+
|
|
|
+ const outlineWidth = this.lineWeight;
|
|
|
+ const outlineColor = this.lineColor;
|
|
|
|
|
|
-
|
|
|
- * 面要素的默认样式
|
|
|
- * */
|
|
|
- polygon={
|
|
|
- fillColor:'rgba(252, 86, 49, 0.1)'
|
|
|
- };
|
|
|
-
|
|
|
-
|
|
|
- * 绘制要素
|
|
|
- * */
|
|
|
- drawFeature=null;
|
|
|
-
|
|
|
-
|
|
|
- * 绘制图形资源
|
|
|
- * */
|
|
|
- vectorSource=null;
|
|
|
-
|
|
|
-
|
|
|
- * 绘制工具
|
|
|
- * */
|
|
|
- drawTool=null;
|
|
|
-
|
|
|
-
|
|
|
- * 图形修改工具
|
|
|
- */
|
|
|
- modifyTool=null;
|
|
|
-
|
|
|
- initMap(map){
|
|
|
- this.map = map
|
|
|
+ this.vectorSource = new VectorSource({ wrapX: false })
|
|
|
+ this.vectorLayer = new VectorLayer({
|
|
|
+ source: this.vectorSource,
|
|
|
+ style: this.styleFunction(fillColor, outlineWidth, outlineColor)
|
|
|
+ })
|
|
|
+ this.map.addLayer(this.vectorLayer)
|
|
|
+ let geometryFunction = null
|
|
|
+ let maxPoint
|
|
|
+
|
|
|
+ if (drawType === 'Square') {
|
|
|
+ drawType = 'Circle'
|
|
|
+ geometryFunction = createBox()
|
|
|
+ } else if (drawType === 'Box') {
|
|
|
+ drawType = 'Circle'
|
|
|
+ geometryFunction = createRegularPolygon(4)
|
|
|
}
|
|
|
-
|
|
|
- * 初始化绘制事件
|
|
|
- * @drawType String 绘制类型(Point、LineString、Polygon、Circle,Square,Box)=>(点、线、多边形、圆形、长方形、正方形)
|
|
|
- * @isEdit Boolean 是否是图形新增或者编辑
|
|
|
- * @returnFunc 回调函数
|
|
|
- */
|
|
|
- initDrawHandler(drawType, isEdit,returnFunc) {
|
|
|
- if(this.map == null) {
|
|
|
- console.log('请先初始化地图,终止绘制!')
|
|
|
- return;
|
|
|
- }
|
|
|
- this.removeInteraction()
|
|
|
-
|
|
|
- this.removeDrawSource()
|
|
|
- let feature = null
|
|
|
- this.vectorSource = new VectorSource({ wrapX: false })
|
|
|
- this.vectorLayer = new VectorLayer({
|
|
|
- source: this.vectorSource
|
|
|
- })
|
|
|
- this.map.addLayer(this.vectorLayer)
|
|
|
- let geometryFunction = null
|
|
|
- let maxPoint
|
|
|
-
|
|
|
- if (drawType === 'Square') {
|
|
|
- drawType = 'Circle'
|
|
|
- geometryFunction = createBox()
|
|
|
- } else if (drawType === 'Box') {
|
|
|
- drawType = 'Circle'
|
|
|
- geometryFunction = createRegularPolygon(4)
|
|
|
- }
|
|
|
|
|
|
- this.drawTool = new Draw({
|
|
|
- source: this.vectorSource,
|
|
|
- wrapX: false,
|
|
|
- maxPoints: maxPoint,
|
|
|
- type: drawType,
|
|
|
- geometryFunction: geometryFunction
|
|
|
- })
|
|
|
- this.drawTool.on('drawstart', evt => {
|
|
|
-
|
|
|
- this.removeDrawSource()
|
|
|
- feature = evt.feature
|
|
|
- })
|
|
|
- this.drawTool.on('drawend', () => {
|
|
|
- this.drawFeature = feature
|
|
|
- this.map.removeInteraction(this.drawTool)
|
|
|
+
|
|
|
+ this.drawTool = new Draw({
|
|
|
+ source: this.vectorSource,
|
|
|
+ wrapX: false,
|
|
|
+ maxPoints: maxPoint,
|
|
|
+ type: drawType,
|
|
|
+ geometryFunction: geometryFunction
|
|
|
+ })
|
|
|
+ this.drawTool.on('drawstart', evt => {
|
|
|
+
|
|
|
+ this.removeDrawSource()
|
|
|
+ feature = evt.feature
|
|
|
+ })
|
|
|
+ this.drawTool.on('drawend', () => {
|
|
|
+ this.drawFeature = feature
|
|
|
+ this.map.removeInteraction(this.drawTool)
|
|
|
+ this.modifyFeature(returnFunc)
|
|
|
+ returnFunc(feature)
|
|
|
+ })
|
|
|
+ this.map.addInteraction(this.drawTool)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 修改要素
|
|
|
+ * @returnFunc修改完成的回调
|
|
|
+ */
|
|
|
+ modifyFeature(returnFunc) {
|
|
|
+ if (this.vectorSource && this.drawFeature) {
|
|
|
+
|
|
|
+ this.select = new Select();
|
|
|
+ this.map.addInteraction(this.select);
|
|
|
+
|
|
|
+ this.modify = new Modify({
|
|
|
+ features: this.select.getFeatures()
|
|
|
+ });
|
|
|
+ this.map.addInteraction(this.modify);
|
|
|
+ this.modify.on('modifyend',(evt)=>{
|
|
|
+ let feature = evt.features.array_[0]
|
|
|
returnFunc(feature)
|
|
|
})
|
|
|
- this.map.addInteraction(this.drawTool)
|
|
|
+
|
|
|
+ this.setEvents();
|
|
|
+ this.setActive(true);
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ * 设置事件
|
|
|
+ */
|
|
|
+ setEvents() {
|
|
|
+ var selectedFeatures = this.select.getFeatures();
|
|
|
+
|
|
|
+ this.select.on("change:active", () => {
|
|
|
+
|
|
|
+ selectedFeatures.forEach(selectedFeatures.remove, selectedFeatures);
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- * 移除清理
|
|
|
- */
|
|
|
- removeInteraction() {
|
|
|
- if(this.map == null) return;
|
|
|
- if (this.drawTool) {
|
|
|
- this.map.removeInteraction(this.drawTool)
|
|
|
- }
|
|
|
- if (this.modifyTool) {
|
|
|
- this.map.removeInteraction(this.modifyTool)
|
|
|
+
|
|
|
+ * 激活事件
|
|
|
+ */
|
|
|
+ setActive(active) {
|
|
|
+ if (this.select) this.select.setActive(active);
|
|
|
+ if (this.modify) this.modify.setActive(active);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 修改VectorLayer的style
|
|
|
+ * @lineWeight 线宽 Integer
|
|
|
+ * @lineColor 先颜色 string #e3e3e3
|
|
|
+ * @color 图形填充颜色 array [255,255,255]
|
|
|
+ * @opacity 填充透明度 Float 0.33
|
|
|
+ */
|
|
|
+ updateStyle(lineWeight, lineColor, color, opacity) {
|
|
|
+ this.lineWeight = lineWeight
|
|
|
+ this.lineColor = lineColor
|
|
|
+ this.color = color
|
|
|
+ this.opacity = opacity
|
|
|
+ const fillColor = this.color.filter(p => true)
|
|
|
+ fillColor.push(parseFloat(this.opacity));
|
|
|
+ const outlineWidth = this.lineWeight;
|
|
|
+ const outlineColor = this.lineColor;
|
|
|
+ let style = this.styleFunction(fillColor, outlineWidth, outlineColor)
|
|
|
+ if (this.vectorLayer) {
|
|
|
+ let features = this.vectorLayer.getSource().getFeatures()
|
|
|
+ if (features) {
|
|
|
+ for (let i = 0; i < features.length; i++) {
|
|
|
+ features[i].setStyle(style)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ * 设置绘制图形样式
|
|
|
+ * @fillColor 图形填错颜色和透明度,如:[255, 255, 255, 0.33]
|
|
|
+ * @outlineWidth 图形边线宽度 如:2
|
|
|
+ * @outlineColor 图形边线颜色:如:#dc5246
|
|
|
+ *
|
|
|
+ */
|
|
|
+ styleFunction(fillColor, outlineWidth, outlineColor) {
|
|
|
+ return new Style({
|
|
|
+ fill: new Fill({
|
|
|
+ color: fillColor
|
|
|
+ }),
|
|
|
+ stroke: new Stroke({
|
|
|
+ width: outlineWidth,
|
|
|
+ color: outlineColor
|
|
|
+ }),
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- * 清除绘制资源
|
|
|
- */
|
|
|
- removeDrawSource() {
|
|
|
- if (this.vectorSource) {
|
|
|
- this.vectorSource.clear()
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+ * 移除清理
|
|
|
+ */
|
|
|
+ removeInteraction() {
|
|
|
+ if (this.map == null) return;
|
|
|
+ if (this.drawTool) {
|
|
|
+ this.map.removeInteraction(this.drawTool)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- * 获取点样式
|
|
|
- * @param size 点大小
|
|
|
- * @param color 点颜色
|
|
|
- * @param outSize 外边框大小
|
|
|
- * @param outColor 外边框颜色
|
|
|
- */
|
|
|
- getPointStyle(size,color,outSize,outColor){
|
|
|
- let style= new Style({
|
|
|
- image: new Circle({
|
|
|
- radius: size|| this.point.size,
|
|
|
- fill: new Fill({
|
|
|
- color: color||this.point.color
|
|
|
- }),
|
|
|
- stroke: new Stroke({
|
|
|
- color:outColor||this.line.color,
|
|
|
- width:outSize|| this.line.width
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- return style;
|
|
|
+ if (this.modifyTool) {
|
|
|
+ this.map.removeInteraction(this.modifyTool)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- * 获取线样式
|
|
|
- * @param size 线的宽度大小
|
|
|
- * @param color 线颜色
|
|
|
- */
|
|
|
- getLineStyle(width,color){
|
|
|
- let style= new Style({
|
|
|
- stroke: new Stroke({
|
|
|
- color: color||this.line.color,
|
|
|
- width: width||this.line.width
|
|
|
- })
|
|
|
- })
|
|
|
- return style;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 清除绘制资源
|
|
|
+ */
|
|
|
+ removeDrawSource() {
|
|
|
+ if (this.vectorSource) {
|
|
|
+ this.vectorSource.clear()
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- * 获取面样式
|
|
|
- * @param lineWidth 面的边界线宽度(默认宽度3)
|
|
|
- * @param lineColor 面的边界颜色(默认红色)
|
|
|
- * @param fillColor 面里面的颜色(默认红色透明度0.1)
|
|
|
- */
|
|
|
- getPolygonStyle(lineWidth,lineColor,fillColor){
|
|
|
- let style= new Style({
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取点样式
|
|
|
+ * @param size 点大小
|
|
|
+ * @param color 点颜色
|
|
|
+ * @param outSize 外边框大小
|
|
|
+ * @param outColor 外边框颜色
|
|
|
+ */
|
|
|
+ getPointStyle(size, color, outSize, outColor) {
|
|
|
+ let style = new Style({
|
|
|
+ image: new Circle({
|
|
|
+ radius: size || this.point.size,
|
|
|
fill: new Fill({
|
|
|
- color:fillColor||this.polygon.fillColor
|
|
|
- }),
|
|
|
+ color: color || this.point.color
|
|
|
+ }),
|
|
|
stroke: new Stroke({
|
|
|
- color: lineColor||this.line.color,
|
|
|
- width: lineWidth||this.line.width
|
|
|
+ color: outColor || this.line.color,
|
|
|
+ width: outSize || this.line.width
|
|
|
})
|
|
|
})
|
|
|
- return style;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 获取全套的样式(点、线、面)
|
|
|
- * @param pointSize 点的大小
|
|
|
- * @param pointColor 点的颜色
|
|
|
- * @param lineWidth 面的边界线宽度(默认宽度3)
|
|
|
- * @param lineColor 面的边界颜色(默认红色)
|
|
|
- * @param fillColor 面里面的颜色(默认红色透明度0.1)
|
|
|
- */
|
|
|
- getAllStyle(pointSize,pointColor,lineWidth,lineColor,fillColor){
|
|
|
- return this.setAllStyle(pointSize,pointColor,lineWidth,lineColor,fillColor,null)
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 获取绘制时的样式
|
|
|
- * @param pointSize 点的大小
|
|
|
- * @param pointColor 点的颜色
|
|
|
- * @param lineWidth 面的边界线宽度(默认宽度3)
|
|
|
- * @param lineColor 面的边界颜色(默认红色)
|
|
|
- * @param fillColor 面里面的颜色(默认红色透明度0.1)
|
|
|
- * @param lineDash 线打断比例(默认打断[10,10])
|
|
|
- */
|
|
|
- getDrawStyle(pointSize,pointColor,lineWidth,lineColor,fillColor,lineDash){
|
|
|
- return this.setAllStyle(pointSize,pointColor,lineWidth,lineColor,fillColor,lineDash||[10,10])
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- *设置全套的的样式
|
|
|
- * @param pointSize 点的大小
|
|
|
- * @param pointColor 点的颜色
|
|
|
- * @param lineWidth 面的边界线宽度(默认宽度3)
|
|
|
- * @param lineColor 面的边界颜色(默认红色)
|
|
|
- * @param fillColor 面里面的颜色(默认红色透明度0.1)
|
|
|
- * @param lineDash 线打断比例(默认不打断[0,0])
|
|
|
- */
|
|
|
- setAllStyle(pointSize,pointColor,lineWidth,lineColor,fillColor,lineDash){
|
|
|
- let style= new Style({
|
|
|
+ })
|
|
|
+ return style;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取线样式
|
|
|
+ * @param size 线的宽度大小
|
|
|
+ * @param color 线颜色
|
|
|
+ */
|
|
|
+ getLineStyle(width, color) {
|
|
|
+ let style = new Style({
|
|
|
+ stroke: new Stroke({
|
|
|
+ color: color || this.line.color,
|
|
|
+ width: width || this.line.width
|
|
|
+ })
|
|
|
+ })
|
|
|
+ return style;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取面样式
|
|
|
+ * @param lineWidth 面的边界线宽度(默认宽度3)
|
|
|
+ * @param lineColor 面的边界颜色(默认红色)
|
|
|
+ * @param fillColor 面里面的颜色(默认红色透明度0.1)
|
|
|
+ */
|
|
|
+ getPolygonStyle(lineWidth, lineColor, fillColor) {
|
|
|
+ let style = new Style({
|
|
|
+ fill: new Fill({
|
|
|
+ color: fillColor || this.polygon.fillColor
|
|
|
+ }),
|
|
|
+ stroke: new Stroke({
|
|
|
+ color: lineColor || this.line.color,
|
|
|
+ width: lineWidth || this.line.width
|
|
|
+ })
|
|
|
+ })
|
|
|
+ return style;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取全套的样式(点、线、面)
|
|
|
+ * @param pointSize 点的大小
|
|
|
+ * @param pointColor 点的颜色
|
|
|
+ * @param lineWidth 面的边界线宽度(默认宽度3)
|
|
|
+ * @param lineColor 面的边界颜色(默认红色)
|
|
|
+ * @param fillColor 面里面的颜色(默认红色透明度0.1)
|
|
|
+ */
|
|
|
+ getAllStyle(pointSize, pointColor, lineWidth, lineColor, fillColor) {
|
|
|
+ return this.setAllStyle(pointSize, pointColor, lineWidth, lineColor, fillColor, null)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取绘制时的样式
|
|
|
+ * @param pointSize 点的大小
|
|
|
+ * @param pointColor 点的颜色
|
|
|
+ * @param lineWidth 面的边界线宽度(默认宽度3)
|
|
|
+ * @param lineColor 面的边界颜色(默认红色)
|
|
|
+ * @param fillColor 面里面的颜色(默认红色透明度0.1)
|
|
|
+ * @param lineDash 线打断比例(默认打断[10,10])
|
|
|
+ */
|
|
|
+ getDrawStyle(pointSize, pointColor, lineWidth, lineColor, fillColor, lineDash) {
|
|
|
+ return this.setAllStyle(pointSize, pointColor, lineWidth, lineColor, fillColor, lineDash || [10, 10])
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ *设置全套的的样式
|
|
|
+ * @param pointSize 点的大小
|
|
|
+ * @param pointColor 点的颜色
|
|
|
+ * @param lineWidth 面的边界线宽度(默认宽度3)
|
|
|
+ * @param lineColor 面的边界颜色(默认红色)
|
|
|
+ * @param fillColor 面里面的颜色(默认红色透明度0.1)
|
|
|
+ * @param lineDash 线打断比例(默认不打断[0,0])
|
|
|
+ */
|
|
|
+ setAllStyle(pointSize, pointColor, lineWidth, lineColor, fillColor, lineDash) {
|
|
|
+ let style = new Style({
|
|
|
+ fill: new Fill({
|
|
|
+ color: fillColor || this.polygon.fillColor
|
|
|
+ }),
|
|
|
+ stroke: new Stroke({
|
|
|
+ lineDash: lineDash || [0, 0],
|
|
|
+ color: lineColor || this.line.color,
|
|
|
+ width: lineWidth || this.line.width
|
|
|
+ }),
|
|
|
+ image: new Circle({
|
|
|
+ radius: pointSize || 0,
|
|
|
fill: new Fill({
|
|
|
- color: fillColor||this.polygon.fillColor
|
|
|
- }),
|
|
|
- stroke: new Stroke({
|
|
|
- lineDash: lineDash||[0,0],
|
|
|
- color: lineColor||this.line.color,
|
|
|
- width: lineWidth||this.line.width
|
|
|
- }),
|
|
|
- image: new Circle({
|
|
|
- radius: pointSize||0,
|
|
|
- fill: new Fill({
|
|
|
- color: pointColor||this.point.color
|
|
|
- })
|
|
|
+ color: pointColor || this.point.color
|
|
|
})
|
|
|
})
|
|
|
- return style;
|
|
|
- }
|
|
|
+ })
|
|
|
+ return style;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- export const drawTools=new DrawTools();
|
|
|
+}
|
|
|
+
|
|
|
+export const drawTools = new DrawTools();
|