修改配置
This commit is contained in:
parent
db37f69619
commit
c855925ae3
@ -1,8 +1,8 @@
|
||||
const mapDeviceStyle = {
|
||||
'01': 'chengdu_04',
|
||||
'02': 'fuzhou_01',
|
||||
// '03': 'bejing_01',
|
||||
'03': 'chengdu_03',
|
||||
'03': 'bejing_01',
|
||||
'04': 'chengdu_03',
|
||||
'05': 'batong_01' // 暂时没有画北京八通线
|
||||
};
|
||||
|
||||
|
@ -20,8 +20,9 @@ export default class Switch extends Group {
|
||||
this.style = style;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 6;
|
||||
this.triangle = new JTriangle(model.intersection, model.skew);
|
||||
this.create();
|
||||
this._createLockRect(); // 创建单锁矩形框显示
|
||||
this.createLockRect(); // 创建单锁矩形框显示
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
@ -40,8 +41,6 @@ export default class Switch extends Group {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
|
||||
this.triangle = new JTriangle(model.intersection, model.skew);
|
||||
|
||||
let halfWidth = style.Section.line.width / 2;
|
||||
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth*2 + 0.8;
|
||||
const swPadding = style.Switch.core.length;
|
||||
@ -147,7 +146,7 @@ export default class Switch extends Group {
|
||||
this.add(this.name);
|
||||
}
|
||||
|
||||
_createLockRect() {
|
||||
createLockRect() {
|
||||
const offsetX = this.model.locateType == '01' ? 3 : 0;
|
||||
this.lockRect = new ELockRect({
|
||||
zlevel: this.zlevel,
|
||||
|
@ -4,8 +4,8 @@ class Theme {
|
||||
this._mapMenu = {
|
||||
'01': 'default', // 成都4号线
|
||||
'02': 'fuzhou_01',
|
||||
// '03': 'beijing_01',
|
||||
'03': 'chengdou_03',
|
||||
'03': 'beijing_01',
|
||||
'04': 'chengdou_03',
|
||||
'05': 'batong_01'
|
||||
};
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ JTriangle.prototype = {
|
||||
dricty: 0,
|
||||
drict: 0,
|
||||
|
||||
init: function (beg, end) {
|
||||
init (beg, end) {
|
||||
this.beg = beg;
|
||||
this.end = end;
|
||||
this.abspowx = Math.pow(this.end.x - this.beg.x, 2);
|
||||
@ -28,35 +28,35 @@ JTriangle.prototype = {
|
||||
this.diff_x = end.x - beg.x;
|
||||
this.diff_y = end.y - beg.y;
|
||||
},
|
||||
getRotation: function () {
|
||||
getRotation () {
|
||||
return Math.atan(this.diff_y / this.diff_x);
|
||||
},
|
||||
getAngle: function () {
|
||||
getAngle () {
|
||||
return 360 * Math.atan(this.diff_y / this.diff_x) / (2 * Math.PI);
|
||||
},
|
||||
getCos: function (n) {
|
||||
getCos (n) {
|
||||
return this.drictx * Math.sqrt(Math.pow(n, 2) * this.abspowx / this.abspowz);
|
||||
},
|
||||
getSin: function (n) {
|
||||
getSin (n) {
|
||||
return this.dricty * Math.sqrt(Math.pow(n, 2) * this.abspowy / this.abspowz);
|
||||
},
|
||||
getCosRate: function () {
|
||||
getCosRate () {
|
||||
return Math.sqrt(this.abspowx / this.abspowz);
|
||||
},
|
||||
getSinRate: function () {
|
||||
getSinRate () {
|
||||
return Math.sqrt(this.abspowy / this.abspowz);
|
||||
},
|
||||
getTanRate: function () {
|
||||
getTanRate () {
|
||||
var diff_x = this.end.x - this.beg.x;
|
||||
var diff_y = this.end.y - this.beg.y;
|
||||
return Math.abs(diff_y / diff_x);
|
||||
},
|
||||
getCotRate: function () {
|
||||
getCotRate () {
|
||||
var diff_x = this.end.x - this.beg.x;
|
||||
var diff_y = this.end.y - this.beg.y;
|
||||
return Math.abs(diff_x / diff_y);
|
||||
},
|
||||
middlePoint: function () {
|
||||
middlePoint () {
|
||||
return {
|
||||
x: Math.min(this.end.x, this.beg.x) + Math.abs(this.end.x - this.beg.x) / 2,
|
||||
y: Math.min(this.end.y, this.beg.y) + Math.abs(this.end.y - this.beg.y) / 2
|
||||
|
Loading…
Reference in New Issue
Block a user