diff --git a/src/ibp/shape/elevator.js b/src/ibp/shape/elevator.js index b38332f39..27c590b5e 100644 --- a/src/ibp/shape/elevator.js +++ b/src/ibp/shape/elevator.js @@ -45,8 +45,8 @@ export default class elevator extends Group { z: model.z, draggable: false, point: { - x: model.point.x+model.width/6*4.7, - y: model.point.y+model.height/8*0.1 + x: model.width/6*4.7, + y: model.height/8*0.1 }, width: model.width/6*0.8, status: this.getStatus('top'), @@ -58,8 +58,8 @@ export default class elevator extends Group { z: model.z, draggable: false, point: { - x: model.point.x+model.width/6*1.3, - y: model.point.y+model.height/8*7.9 + x: model.width/6*1.3, + y: model.height/8*7.9 }, width: model.width/6*0.8, status: this.getStatus('bottom'), diff --git a/src/ibp/shape/elevatorBack.js b/src/ibp/shape/elevatorBack.js index b9f10f068..3b7bd3bd0 100644 --- a/src/ibp/shape/elevatorBack.js +++ b/src/ibp/shape/elevatorBack.js @@ -1,5 +1,4 @@ -import Circle from 'zrender/src/graphic/shape/Circle'; -import Polygon from 'zrender/src/graphic/shape/Polygon'; +import * as toolpath from 'zrender/src/tool/path'; import Group from 'zrender/src/container/Group'; export default class elevatorBack extends Group { @@ -14,63 +13,22 @@ export default class elevatorBack extends Group { create() { // debugger; const model = this.model; - this.arrowCircle = new Circle({ + const tempString='M'+model.width/6+' '+model.height/8*6+' L'+model.width/6*4+ + ' 0 L'+model.width/6*5+' 0 A '+model.width/6+' '+model.width/6+' 0 0 1 '+ + model.width/6*5+' '+model.height/4+'L '+model.width/3+' '+model.height+' L'+model.width/6+ + ' '+model.height+' '+'A'+model.width/6+' '+model.width/6+' 0 0 1 '+model.width/6+' '+model.height/8*6; + this.elevatorBack = toolpath.createFromString(tempString, { zlevel: model.zlevel, z: model.z, - // path: 'M 0 0 Q -70 -50 0 -100 0 -100 L 150 -400 L 200 -400 Q 270 -350 200 -300 200 -300 L 50 0', draggable: false, - // model.draggable || - shape: { - cx: (model.point.x + model.width/6*5).toFixed(2), - cy: (model.point.y + model.height/8).toFixed(2), - r: (model.width/6).toFixed(2) - }, style: { + x: model.point.x, + y: model.point.y, brushType: 'fill', fill: this.model.fillColor || '#313131', lineWidth: 0 } }); - - this.arrowPoly = new Polygon({ - zlevel: model.zlevel, - z: model.z, - draggable: false, - shape: { - points: [[(model.point.x+model.width/6).toFixed(2), (model.point.y + model.height).toFixed(2)], [(model.point.x+model.width/6*2).toFixed(2), model.point.y + model.height], - [(model.point.x+model.width/6*5).toFixed(2), (model.point.y + model.height/8*2).toFixed(2)], - [(model.point.x+model.width/6*5).toFixed(2), model.point.y], - [(model.point.x+model.width/6*4).toFixed(2), model.point.y], - [(model.point.x+model.width/6).toFixed(2), (model.point.y + model.height/8*6).toFixed(2)] - ] - }, - style: { - brushType: 'fill', - stroke: model.stroke || '#313131', - lineWidth: 0, - fill: model.fillColor || '#313131' - } - }); - - this.arrowCircleRight = new Circle({ - zlevel: model.zlevel, - z: model.z, - // path: 'M 0 0 Q -70 -50 0 -100 0 -100 L 150 -400 L 200 -400 Q 270 -350 200 -300 200 -300 L 50 0', - draggable: false, - shape: { - cx: (model.point.x + model.width/6).toFixed(2), - cy: (model.point.y + model.height/8*7).toFixed(2), - r: (model.width/6).toFixed(2) - }, - style: { - fill: this.model.fillColor || '#313131', - lineWidth: 0, - brushType: 'fill' - } - }); - - this.add(this.arrowPoly); - this.add(this.arrowCircle); - this.add(this.arrowCircleRight); + this.add(this.elevatorBack); } } diff --git a/src/jmap/shape/Station/index.js b/src/jmap/shape/Station/index.js index 872d8c741..152d34e4d 100644 --- a/src/jmap/shape/Station/index.js +++ b/src/jmap/shape/Station/index.js @@ -38,29 +38,29 @@ export default class Station extends Group { textFill: model.nameFontColor }); this.add(this.stationText); - } - - if (style.Station.kmPostShow) { + const path = window.location.href; + if (style.Station.kmPostShow || path.includes('/map/draw')) { // 公里标是否显示 - let direction = 1; - if (this.style.Station.kilometerPosition == 'up') { - direction = -1; + let direction = 1; + if (this.style.Station.kilometerPosition == 'up') { + direction = -1; + } + this.mileageText = new ETextName({ + zlevel: this.zlevel, + z: this.z, + position: [0, 0], + x: model.position.x, + y: model.position.y + ((parseInt(model.nameFont) + 2) * direction), + fontWeight: model.fontWeight, + fontSize: model.kmPostFont || 18, + fontFamily: style.fontFamily, + text: model.kmPost, + textAlign: 'middle', + textVerticalAlign: 'top', + textFill: model.kmPostFontColor + }); + this.add(this.mileageText); } - this.mileageText = new ETextName({ - zlevel: this.zlevel, - z: this.z, - position: [0, 0], - x: model.position.x, - y: model.position.y + ((parseInt(model.nameFont) + 2) * direction), - fontWeight: model.fontWeight, - fontSize: model.kmPostFont || 18, - fontFamily: style.fontFamily, - text: model.kmPost, - textAlign: 'middle', - textVerticalAlign: 'top', - textFill: model.kmPostFontColor - }); - this.add(this.mileageText); } }