DESKTOP-CRQ4N2U\jintian 1 anno fa
parent
commit
e3dc628bf8

+ 0 - 331
src/jtMap3d/Widgets/DrawTools/drawArrow/algorithm.js

@@ -1,331 +0,0 @@
-import P from "./plotUtil.js";
-
-var xp = {
-	version: "1.0.0",
-	createTime: "2018.6.19",
-	author: "xupinhui"
-}
-var doubleArrowDefualParam = {
-	type: "doublearrow",
-	headHeightFactor: .25,
-	headWidthFactor: .3,
-	neckHeightFactor: .85,
-	fixPointCount: 4,
-	neckWidthFactor: .15
-}
-var tailedAttackArrowDefualParam = {
-	headHeightFactor: .18,
-	headWidthFactor: .3,
-	neckHeightFactor: .85,
-	neckWidthFactor: .15,
-	tailWidthFactor: .1,
-	headTailFactor: .8,
-	swallowTailFactor: 1
-};
-var fineArrowDefualParam = {
-	tailWidthFactor: 0.15,
-	neckWidthFactor: 0.20,
-	headWidthFactor: 0.25,
-	headAngle: Math.PI / 8.5,
-	neckAngle: Math.PI / 13
-};
-xp.algorithm = {},
-	xp.algorithm.doubleArrow = function(inputPoint) {
-		this.connPoint = null;
-		this.tempPoint4 = null;
-		this.points = inputPoint;
-		var result = {
-			controlPoint: null,
-			polygonalPoint: null
-		};
-		//获取已经点击的坐标数
-		var t = inputPoint.length;
-		if (!(2 > t)) {
-			if (2 == t) return inputPoint;
-			var o = this.points[0], //第一个点
-				e = this.points[1], //第二个点
-				r = this.points[2], //第三个点
-				t = inputPoint.length; //获取已经点击的坐标数
-			//下面的是移动点位后的坐标
-			3 == t ? this.tempPoint4 = xp.algorithm.getTempPoint4(o, e, r) : this.tempPoint4 = this.points[3],
-				3 == t || 4 == t ? this.connPoint = P.PlotUtils.mid(o, e) : this.connPoint = this.points[4];
-			var n, g;
-			P.PlotUtils.isClockWise(o, e, r) ? (n = xp.algorithm.getArrowPoints(o, this.connPoint, this.tempPoint4, !1), g = xp.algorithm.getArrowPoints(this.connPoint, e, r, !0)) : (n = xp.algorithm.getArrowPoints(e, this.connPoint, r, !1), g = xp.algorithm.getArrowPoints(this.connPoint, o, this.tempPoint4, !0));
-			var i = n.length,
-				s = (i - 5) / 2,
-				a = n.slice(0, s),
-				l = n.slice(s, s + 5),
-				u = n.slice(s + 5, i),
-				c = g.slice(0, s),
-				p = g.slice(s, s + 5),
-				h = g.slice(s + 5, i);
-			c = P.PlotUtils.getBezierPoints(c);
-			var d = P.PlotUtils.getBezierPoints(h.concat(a.slice(1)));
-			u = P.PlotUtils.getBezierPoints(u);
-			var f = c.concat(p, d, l, u);
-			var newArray = xp.algorithm.array2Dto1D(f);
-			result.controlPoint = [o, e, r, this.tempPoint4, this.connPoint];
-			result.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(newArray);
-		}
-		return result;
-	},
-	xp.algorithm.threeArrow = function(inputPoint) {
-		this.connPoint = null;
-		this.tempPoint4 = null;
-		this.tempPoint5 = null;
-		this.points = inputPoint;
-		var result = {
-			controlPoint: null,
-			polygonalPoint: null
-		};
-		//获取已经点击的坐标数
-		var t = inputPoint.length;
-		if (t >= 2) {
-			if (t == 2) {
-				return inputPoint;
-			}
-			var o = this.points[0], //第一个点
-				e = this.points[1], //第二个点
-				r = this.points[2], //第三个点
-				t = inputPoint.length; //获取已经点击的坐标数
-			//下面的是移动点位后的坐标
-			if (t == 3) {
-				this.tempPoint4 = xp.algorithm.getTempPoint4(o, e, r);
-				this.tempPoint5 = P.PlotUtils.mid(r, this.tempPoint4);
-			} else {
-				this.tempPoint4 = this.points[3];
-				this.tempPoint5 = this.points[4];
-			}
-			if (t < 6) {
-				this.connPoint = P.PlotUtils.mid(o, e);
-			} else {
-				this.connPoint = this.points[5];
-			}
-			var n, g;
-			if (P.PlotUtils.isClockWise(o, e, r)) {
-				n = xp.algorithm.getArrowPoints(o, this.connPoint, this.tempPoint4, !1);
-				g = xp.algorithm.getArrowPoints(this.connPoint, e, r, !0);
-			} else {
-				n = xp.algorithm.getArrowPoints(e, this.connPoint, r, !1);
-				g = xp.algorithm.getArrowPoints(this.connPoint, o, this.tempPoint4, !0);
-			}
-			var i = n.length,
-				s = (i - 5) / 2,
-				a = n.slice(0, s),
-				l = n.slice(s, s + 5),
-				u = n.slice(s + 5, i),
-				c = g.slice(0, s),
-				p = g.slice(s, s + 5),
-				h = g.slice(s + 5, i);
-			c = P.PlotUtils.getBezierPoints(c);
-			var d = P.PlotUtils.getBezierPoints(h.concat(a.slice(1)));
-			u = P.PlotUtils.getBezierPoints(u);
-			var f = c.concat(p, d, l, u);
-			var newArray = xp.algorithm.array2Dto1D(f);
-			result.controlPoint = [o, e, r, this.tempPoint4, this.tempPoint5, this.connPoint];
-			result.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(newArray);
-		}
-		return result;
-	},
-	xp.algorithm.array2Dto1D = function(array) {
-		var newArray = [];
-		array.forEach(function(elt) {
-			newArray.push(elt[0]);
-			newArray.push(elt[1]);
-		});
-		return newArray;
-	},
-	xp.algorithm.getArrowPoints = function(t, o, e, r) {
-		this.type = doubleArrowDefualParam.type,
-			this.headHeightFactor = doubleArrowDefualParam.headHeightFactor,
-			this.headWidthFactor = doubleArrowDefualParam.headWidthFactor,
-			this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor,
-			this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
-		var n = P.PlotUtils.mid(t, o),
-			g = P.PlotUtils.distance(n, e),
-			i = P.PlotUtils.getThirdPoint(e, n, 0, .3 * g, !0),
-			s = P.PlotUtils.getThirdPoint(e, n, 0, .5 * g, !0);
-		i = P.PlotUtils.getThirdPoint(n, i, P.Constants.HALF_PI, g / 5, r),
-			s = P.PlotUtils.getThirdPoint(n, s, P.Constants.HALF_PI, g / 4, r);
-		var a = [n, i, s, e],
-			l = xp.algorithm.getArrowHeadPoints(a, this.headHeightFactor, this.headWidthFactor, this.neckHeightFactor, this.neckWidthFactor),
-			u = l[0],
-			c = l[4],
-			p = P.PlotUtils.distance(t, o) / P.PlotUtils.getBaseLength(a) / 2,
-			h = xp.algorithm.getArrowBodyPoints(a, u, c, p),
-			d = h.length,
-			f = h.slice(0, d / 2),
-			E = h.slice(d / 2, d);
-		return f.push(u),
-			E.push(c),
-			f = f.reverse(),
-			f.push(o),
-			E = E.reverse(),
-			E.push(t),
-			f.reverse().concat(l, E)
-	},
-	xp.algorithm.getArrowHeadPoints = function(t, o, e) {
-		this.type = doubleArrowDefualParam.type,
-			this.headHeightFactor = doubleArrowDefualParam.headHeightFactor,
-			this.headWidthFactor = doubleArrowDefualParam.headWidthFactor,
-			this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor,
-			this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
-		var r = P.PlotUtils.getBaseLength(t),
-			n = r * this.headHeightFactor,
-			g = t[t.length - 1],
-			i = (P.PlotUtils.distance(o, e), n * this.headWidthFactor),
-			s = n * this.neckWidthFactor,
-			a = n * this.neckHeightFactor,
-			l = P.PlotUtils.getThirdPoint(t[t.length - 2], g, 0, n, !0),
-			u = P.PlotUtils.getThirdPoint(t[t.length - 2], g, 0, a, !0),
-			c = P.PlotUtils.getThirdPoint(g, l, P.Constants.HALF_PI, i, !1),
-			p = P.PlotUtils.getThirdPoint(g, l, P.Constants.HALF_PI, i, !0),
-			h = P.PlotUtils.getThirdPoint(g, u, P.Constants.HALF_PI, s, !1),
-			d = P.PlotUtils.getThirdPoint(g, u, P.Constants.HALF_PI, s, !0);
-		return [h, c, g, p, d];
-	},
-	xp.algorithm.getArrowBodyPoints = function(t, o, e, r) {
-		for (var n = P.PlotUtils.wholeDistance(t), g = P.PlotUtils.getBaseLength(t), i = g * r, s = P.PlotUtils.distance(o, e), a = (i - s) / 2, l = 0, u = [], c = [], p = 1; p < t.length - 1; p++) {
-			var h = P.PlotUtils.getAngleOfThreePoints(t[p - 1], t[p], t[p + 1]) / 2;
-			l += P.PlotUtils.distance(t[p - 1], t[p]);
-			var d = (i / 2 - l / n * a) / Math.sin(h),
-				f = P.PlotUtils.getThirdPoint(t[p - 1], t[p], Math.PI - h, d, !0),
-				E = P.PlotUtils.getThirdPoint(t[p - 1], t[p], h, d, !1);
-			u.push(f),
-				c.push(E)
-		}
-		return u.concat(c)
-	},
-	xp.algorithm.getTempPoint4 = function(t, o, e) {
-		var r, n, g, i, s = P.PlotUtils.mid(t, o),
-			a = P.PlotUtils.distance(s, e),
-			l = P.PlotUtils.getAngleOfThreePoints(t, s, e);
-		return l < P.Constants.HALF_PI ? (n = a * Math.sin(l), g = a * Math.cos(l), i = P.PlotUtils.getThirdPoint(t, s, P.Constants.HALF_PI, n, !1), r = P.PlotUtils.getThirdPoint(s, i, P.Constants.HALF_PI, g, !0)) : l >= P.Constants.HALF_PI && l < Math.PI ? (n = a * Math.sin(Math.PI - l), g = a * Math.cos(Math.PI - l), i = P.PlotUtils.getThirdPoint(t, s, P.Constants.HALF_PI, n, !1), r = P.PlotUtils.getThirdPoint(s, i, P.Constants.HALF_PI, g, !1)) : l >= Math.PI && l < 1.5 * Math.PI ? (n = a * Math.sin(l - Math.PI), g = a * Math.cos(l - Math.PI), i = P.PlotUtils.getThirdPoint(t, s, P.Constants.HALF_PI, n, !0), r = P.PlotUtils.getThirdPoint(s, i, P.Constants.HALF_PI, g, !0)) : (n = a * Math.sin(2 * Math.PI - l), g = a * Math.cos(2 * Math.PI - l), i = P.PlotUtils.getThirdPoint(t, s, P.Constants.HALF_PI, n, !0), r = P.PlotUtils.getThirdPoint(s, i, P.Constants.HALF_PI, g, !1)),
-			r
-	},
-	xp.algorithm.tailedAttackArrow = function(inputPoint) {
-		inputPoint = xp.algorithm.dereplication(inputPoint);
-		this.tailWidthFactor = tailedAttackArrowDefualParam.tailWidthFactor;
-		this.swallowTailFactor = tailedAttackArrowDefualParam.swallowTailFactor;
-		this.swallowTailPnt = tailedAttackArrowDefualParam.swallowTailPnt;
-		//控制点
-		var result = {
-			controlPoint: null,
-			polygonalPoint: null
-		};
-		result.controlPoint = inputPoint;
-		var t = inputPoint.length;
-		if (!(2 > t)) {
-			if (2 == inputPoint.length) {
-				result.polygonalPoint = inputPoint;
-				return result;
-			}
-			var o = inputPoint,
-				e = o[0],
-				r = o[1];
-			P.PlotUtils.isClockWise(o[0], o[1], o[2]) && (e = o[1], r = o[0]);
-			var n = P.PlotUtils.mid(e, r),
-				g = [n].concat(o.slice(2)),
-				i = xp.algorithm.getAttackArrowHeadPoints(g, e, r, tailedAttackArrowDefualParam),
-				s = i[0],
-				a = i[4],
-				l = P.PlotUtils.distance(e, r),
-				u = P.PlotUtils.getBaseLength(g),
-				c = u * this.tailWidthFactor * this.swallowTailFactor;
-			this.swallowTailPnt = P.PlotUtils.getThirdPoint(g[1], g[0], 0, c, !0);
-			var p = l / u,
-				h = xp.algorithm.getAttackArrowBodyPoints(g, s, a, p),
-				t = h.length,
-				d = [e].concat(h.slice(0, t / 2));
-			d.push(s);
-			var f = [r].concat(h.slice(t / 2, t));
-			var newArray = [];
-			f.push(a),
-				d = P.PlotUtils.getQBSplinePoints(d),
-				f = P.PlotUtils.getQBSplinePoints(f),
-				newArray = xp.algorithm.array2Dto1D(d.concat(i, f.reverse(), [this.swallowTailPnt, d[0]]));
-			result.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(newArray);
-		}
-		return result;
-	},
-	xp.algorithm.getAttackArrowHeadPoints = function(t, o, e, defaultParam) {
-		this.headHeightFactor = defaultParam.headHeightFactor;
-		this.headTailFactor = defaultParam.headTailFactor;
-		this.headWidthFactor = defaultParam.headWidthFactor;
-		this.neckWidthFactor = defaultParam.neckWidthFactor;
-		this.neckHeightFactor = defaultParam.neckHeightFactor;
-		var r = P.PlotUtils.getBaseLength(t),
-			n = r * this.headHeightFactor,
-			g = t[t.length - 1];
-		r = P.PlotUtils.distance(g, t[t.length - 2]);
-		var i = P.PlotUtils.distance(o, e);
-		n > i * this.headTailFactor && (n = i * this.headTailFactor);
-		var s = n * this.headWidthFactor,
-			a = n * this.neckWidthFactor;
-		n = n > r ? r : n;
-		var l = n * this.neckHeightFactor,
-			u = P.PlotUtils.getThirdPoint(t[t.length - 2], g, 0, n, !0),
-			c = P.PlotUtils.getThirdPoint(t[t.length - 2], g, 0, l, !0),
-			p = P.PlotUtils.getThirdPoint(g, u, P.Constants.HALF_PI, s, !1),
-			h = P.PlotUtils.getThirdPoint(g, u, P.Constants.HALF_PI, s, !0),
-			d = P.PlotUtils.getThirdPoint(g, c, P.Constants.HALF_PI, a, !1),
-			f = P.PlotUtils.getThirdPoint(g, c, P.Constants.HALF_PI, a, !0);
-		return [d, p, g, h, f]
-	},
-	xp.algorithm.getAttackArrowBodyPoints = function(t, o, e, r) {
-		for (var n = P.PlotUtils.wholeDistance(t), g = P.PlotUtils.getBaseLength(t), i = g * r, s = P.PlotUtils.distance(o, e), a = (i - s) / 2, l = 0, u = [], c = [], p = 1; p < t.length - 1; p++) {
-			var h = P.PlotUtils.getAngleOfThreePoints(t[p - 1], t[p], t[p + 1]) / 2;
-			l += P.PlotUtils.distance(t[p - 1], t[p]);
-			var d = (i / 2 - l / n * a) / Math.sin(h),
-				f = P.PlotUtils.getThirdPoint(t[p - 1], t[p], Math.PI - h, d, !0),
-				E = P.PlotUtils.getThirdPoint(t[p - 1], t[p], h, d, !1);
-			u.push(f),
-				c.push(E)
-		}
-		return u.concat(c)
-	},
-	xp.algorithm.dereplication = function(array) {
-		var last = array[array.length - 1];
-		var change = false;
-		var newArray = [];
-		newArray = array.filter(function(i) {
-			if (i[0] != last[0] && i[1] != last[1]) {
-				return i;
-			}
-			change = true;
-		});
-		if (change) newArray.push(last);
-		return newArray;
-	},
-	xp.algorithm.fineArrow = function(tailPoint, headerPoint) {
-		if ((tailPoint.length < 2) || (headerPoint.length < 2)) return;
-		//画箭头的函数
-		let tailWidthFactor = fineArrowDefualParam.tailWidthFactor;
-		let neckWidthFactor = fineArrowDefualParam.neckWidthFactor;
-		let headWidthFactor = fineArrowDefualParam.headWidthFactor;
-		let headAngle = fineArrowDefualParam.headAngle;
-		let neckAngle = fineArrowDefualParam.neckAngle;
-		var o = [];
-		o[0] = tailPoint;
-		o[1] = headerPoint;
-		var e = o[0],
-			r = o[1],
-			n = P.PlotUtils.getBaseLength(o),
-			g = n * tailWidthFactor,
-			//尾部宽度因子
-			i = n * neckWidthFactor,
-			//脖子宽度银子
-			s = n * headWidthFactor,
-			//头部宽度因子
-			a = P.PlotUtils.getThirdPoint(r, e, P.Constants.HALF_PI, g, !0),
-			l = P.PlotUtils.getThirdPoint(r, e, P.Constants.HALF_PI, g, !1),
-			u = P.PlotUtils.getThirdPoint(e, r, headAngle, s, !1),
-			c = P.PlotUtils.getThirdPoint(e, r, headAngle, s, !0),
-			p = P.PlotUtils.getThirdPoint(e, r, neckAngle, i, !1),
-			h = P.PlotUtils.getThirdPoint(e, r, neckAngle, i, !0),
-			d = [];
-		d.push(a[0], a[1], p[0], p[1], u[0], u[1], r[0], r[1], c[0], c[1], h[0], h[1], l[0], l[1], e[0], e[1]);
-		return Cesium.Cartesian3.fromDegreesArray(d);
-	}
-
-export default xp

+ 0 - 1450
src/jtMap3d/Widgets/DrawTools/drawArrow/arrowClass.js

@@ -1,1450 +0,0 @@
-import CreateRemindertip from "../../common/ReminderTip.js";
-
-import xp from "./algorithm.js";
-
-/**
- * 运行环境类型
- */
-const RuntimeEnvironment = Object.freeze(({
-	App: 'app',
-	Web: 'web'
-}))
-
-/**
- * 检测程序运行环境
- * @return {RuntimeEnvironment}
- */
-function _checkAppOrWeb() {
-	if (window.navigator.userAgent.match(
-			/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
-		)) {
-		return RuntimeEnvironment.App;
-	} else {
-		return RuntimeEnvironment.Web;
-	}
-}
-
-/**
- * 是否是运行于App
- * @ignore
- */
-function _isRuntimeApp() {
-	if (_checkAppOrWeb() === RuntimeEnvironment.App) {
-		return true;
-	}
-	return false;
-}
-
-/**
- * 是否是运行于App
- * @ignore
- */
-function _isRuntimeWeb() {
-	if (_checkAppOrWeb() === RuntimeEnvironment.Web) {
-		return true;
-	}
-	return false;
-}
-
-/**
- * @ignore
- * 创建操作的主容器
- */
-function _createOperationMainDom() {
-	//创建画布
-	let buttonDiv = document.createElement('div');
-	buttonDiv.id = "drawButtonDiv";
-	buttonDiv.style.width = '80px';
-	buttonDiv.style.backgroundColor = 'rgba(5, 45, 155, 0.7)';
-	buttonDiv.style.borderRadius = '5px';
-	buttonDiv.style.display = 'flex';
-	buttonDiv.style.flexDirection = 'column';
-	buttonDiv.style.padding = '8px';
-	buttonDiv.style.justifyContent = 'center';
-	buttonDiv.style.position = 'absolute';
-	buttonDiv.style.bottom = '150px';
-	buttonDiv.style.right = '10px';
-
-	// let btnUndo = document.createElement('button');
-	// btnUndo.id = "btnDrawBackout";
-	// btnUndo.style.height = '30px';
-	// btnUndo.style.marginBottom = '8px';
-	// btnUndo.style.backgroundColor = 'rgba(52, 137, 255, 1.0)';
-	// btnUndo.style.color = 'rgb(255, 255, 255)';
-	// btnUndo.style.border = '0px solid red';
-	// btnUndo.style.borderRadius = '5px';
-	// btnUndo.innerHTML = '回退';
-	// btnUndo.style.fontSize = '13px';
-	// btnUndo.style.cursor = 'pointer';
-	// buttonDiv.appendChild(btnUndo);
-
-	let btnCompletion = document.createElement('button');
-	btnCompletion.id = "btnDrawComplete";
-	btnCompletion.style.height = '30px';
-	btnCompletion.style.backgroundColor = 'rgba(88, 185, 45, 1.0)';
-	btnCompletion.style.color = 'rgb(255, 255, 255)';
-	btnCompletion.style.border = '0px solid red';
-	btnCompletion.style.borderRadius = '5px';
-	btnCompletion.innerHTML = '完成';
-	btnCompletion.style.fontSize = '13px';
-	btnCompletion.style.cursor = 'pointer';
-	buttonDiv.appendChild(btnCompletion);
-
-	/* 加入到页面 */
-	document.body.appendChild(buttonDiv);
-}
-
-/**
- * 创建顶部弹出提示消息 1秒后自动消失
- * @ignore
- * @param {String} message 消息内容
- */
-function _showTooltipMessage(message) {
-	let msgMainDom = document.getElementById('messageMainDom');
-	if (msgMainDom !== null && msgMainDom !== undefined) {
-		document.body.removeChild(msgMainDom);
-	}
-	msgMainDom = document.createElement('div');
-	msgMainDom.style.width = '30%';
-	msgMainDom.style.backgroundColor = 'rgba(237, 248, 230, 1.0)';
-	msgMainDom.style.height = '45px';
-	msgMainDom.style.border = 'solid 2px rgb(219, 241, 208)';
-	msgMainDom.style.borderRadius = '8px';
-	msgMainDom.style.display = 'flex';
-	msgMainDom.style.alignItems = 'center';
-	msgMainDom.style.paddingLeft = '10px';
-	msgMainDom.style.color = 'rgb(91, 188, 48)';
-	msgMainDom.style.fontSize = '14px';
-	msgMainDom.style.fontWeight = '600';
-	msgMainDom.style.position = 'absolute';
-	msgMainDom.style.left = '35%';
-	msgMainDom.style.transition = 'transform 1s';
-	msgMainDom.style.transform = 'translateY(-90px)';
-	msgMainDom.style.top = '0px';
-	msgMainDom.style.zIndex = 1000;
-	document.body.appendChild(msgMainDom);
-
-	let strHtml = '';
-	strHtml += "<div style='"
-	strHtml += "background-color: rgb(88, 185, 45);";
-	strHtml += "color: rgb(255, 255, 255);";
-	strHtml += "height: 24px;";
-	strHtml += "width: 24px;";
-	strHtml += "border-radius: 20px;";
-	strHtml += "display: flex;";
-	strHtml += "justify-content: center;";
-	strHtml += "align-items: center;";
-	strHtml += "font-size: 14px;";
-	strHtml += "margin-right: 18px;";
-	strHtml += "'>&#10003</div>";
-	strHtml += "<div>" + message + "</div>";
-
-	msgMainDom.innerHTML = strHtml;
-	msgMainDom.addEventListener('transitionend', function() {
-		setTimeout(function() {
-			document.body.removeChild(msgMainDom);
-		}, 1000);
-	}, false);
-
-	setTimeout(function() {
-		msgMainDom.style.transform = 'translateY(50px)';
-	}, 100)
-}
-
-
-//粗单尖直线箭头
-var StraightArrow = function(viewer, options) {
-	this.type = "StraightArrow";
-	this.objId = Number((new Date()).getTime() + "" + Number(Math.random() * 1000).toFixed(0)); //用于区分多个相同箭头时
-	this.viewer = viewer;
-	this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-	this.pointImageUrl = "jt3dSDK/imgs/point/point.png";
-
-	options = options || {};
-
-	options.color = Cesium.defaultValue(options.color, 'rgba(0,255,0,0.5)');
-	options.polygonColor = Cesium.defaultValue(options.color, 'rgba(0,255,0,0.5)');
-	options.outlineColor = Cesium.defaultValue(options.outlineColor, 'rgba(255,255,255,1)');
-	options.outlineWidth = Cesium.defaultValue(options.outlineWidth, 0);
-
-	/* 通用参数集合 */
-	this._param = {
-		id: "straightArrow",
-		color: options.color, //面填充颜色
-		polygonColor: options.polygonColor, //面填充颜色
-		outlineColor: options.outlineColor, //边框颜色
-		outlineWidth: options.outlineWidth, //边框宽度
-	}
-
-	/* 创建面材质 */
-	this.fillMaterial = this._materialColorProperty({
-		color: this._param.polygonColor,
-	})
-	/* 创建线材质 */
-	this.outlineMaterial = this._materialColorProperty({
-		color: this._param.outlineColor,
-	})
-
-	this.positions = [];
-	this.firstPoint = null;
-	this.floatPoint = null;
-	this.arrowEntity = null;
-	this.state = -1; //state用于区分当前的状态 0 为删除 1为添加 2为编辑 
-	this.selectPoint = null;
-	this.clickStep = 0;
-	this.modifyHandler = null;
-}
-StraightArrow.prototype = {
-	disable: function() {
-		this.positions = [];
-		if (this.firstPoint) {
-			this.viewer.entities.remove(this.firstPoint);
-			this.firstPoint = null;
-		}
-		if (this.floatPoint) {
-			this.viewer.entities.remove(this.floatPoint);
-			this.floatPoint = null;
-		}
-		if (this.arrowEntity) {
-			this.viewer.entities.remove(this.arrowEntity);
-			this.arrowEntity = null;
-		}
-		this.state = -1;
-		if (this.handler) {
-			this.handler.destroy();
-			this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		}
-		if (this.selectPoint) {
-			this.viewer.entities.remove(this.selectPoint);
-			this.selectPoint = null;
-		}
-		if (this.modifyHandler) {
-			this.modifyHandler.destroy();
-			this.modifyHandler = null;
-		}
-		this.clickStep = 0;
-	},
-	/**
-	 * 取消鼠标事件
-	 * @param {Object} options
-	 */
-	disableHandler: function(options) {
-
-		if (this.handler) {
-			this.handler.destroy();
-			this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		}
-		if (this.modifyHandler) {
-			this.modifyHandler.destroy();
-			this.modifyHandler = null;
-		}
-
-		this.state = -1;
-		if (this.firstPoint) {
-			this.firstPoint.show = false;
-		}
-		if (this.floatPoint) {
-			this.floatPoint.show = false;
-		}
-	},
-	/**
-	 * 开始绘制
-	 * @param {Object} options
-	 */
-	startDraw: function(options) {
-		var $this = this;
-		let toolTip = "单击开始绘制";
-		if (_isRuntimeApp()) {
-			toolTip = "点击开始绘制";
-			_showTooltipMessage(toolTip);
-		}
-
-		this.state = 1;
-		this.handler.setInputAction(function(evt) { //单机开始绘制
-			var cartesian;
-			cartesian = getCatesian3FromPX($this.viewer, evt.position);
-			if (!cartesian) return;
-			if ($this.positions.length == 0) {
-				$this.firstPoint = $this.creatPoint(cartesian);
-				$this.firstPoint.type = "firstPoint";
-				$this.floatPoint = $this.creatPoint(cartesian);
-				$this.floatPoint.type = "floatPoint";
-				$this.positions.push(cartesian);
-
-				toolTip = "再次单击结束绘制";
-				if (_isRuntimeApp()) {
-					toolTip = "再次点击结束绘制";
-					_showTooltipMessage(toolTip);
-				}
-			}
-
-			if ($this.positions.length >= 2) {
-				if (_isRuntimeApp()) {
-					$this.floatPoint.position.setValue(cartesian);
-					if (!Cesium.defined($this.arrowEntity)) {
-						$this.positions.push(cartesian);
-						$this.arrowEntity = $this.showArrowOnMap($this.positions);
-					} else {
-						$this.positions.pop();
-						$this.positions.push(cartesian);
-					}
-				}
-			}
-
-			if ($this.positions.length == 3) {
-				$this.firstPoint.show = false;
-				$this.floatPoint.show = false;
-				$this.handler.destroy();
-				$this.arrowEntity.objId = $this.objId;
-				$this.state = -1;
-
-				CreateRemindertip(toolTip, evt.endPosition, false);
-
-				/* 回调返回 */
-				if (options.onComplete) options.onComplete($this.positions, $this.getLnglats());
-			}
-			$this.positions.push(cartesian.clone());
-		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
-		this.handler.setInputAction(function(evt) { //移动时绘制面
-
-			/* 如果运行环境是App 则禁止使用移动事件 */
-			if (_isRuntimeApp()) return;
-
-			/* 标签提示 */
-			CreateRemindertip(toolTip, evt.endPosition, true);
-
-			if ($this.positions.length < 1) return;
-
-			/* 获取空间位置 */
-			var cartesian = getCatesian3FromPX($this.viewer, evt.endPosition);
-			/* 如果获取点失败 则直接返回 */
-			if (!cartesian) return;
-
-			$this.floatPoint.position.setValue(cartesian);
-			if ($this.positions.length >= 2) {
-				if (!Cesium.defined($this.arrowEntity)) {
-					$this.positions.push(cartesian);
-					$this.arrowEntity = $this.showArrowOnMap($this.positions);
-				} else {
-					$this.positions.pop();
-					$this.positions.push(cartesian);
-				}
-			}
-		}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
-	},
-	/**
-	 * 更新面的属性
-	 * @ignore 不公开方法
-	 * @param {Object} params
-	 */
-	_updatePolygonProperty: function(params) {
-		let material = this.arrowEntity.polygon.material;
-		if (material instanceof Cesium.ColorMaterialProperty) {
-			let newMaterial = this._materialColorProperty({
-				color: params.polygonColor,
-			});
-			this.arrowEntity.polygon.material = newMaterial;
-		}
-		if (this.arrowEntity.polyline !== undefined) {
-			let newMaterial = this._materialColorProperty({
-				color: params.outlineColor,
-			});
-			this.arrowEntity.polyline.material = newMaterial;
-			this.arrowEntity.polyline.width = parseFloat(params.outlineWidth);
-		}
-
-		/* 重新关联属性 */
-		this._param = params;
-	},
-
-	/**
-	 * 颜色材质
-	 * @ignore 生成方法时不对外公开
-	 * @param {JSON} options 配置项
-	 * @param {String} options.color 文字颜色 rgba(r,g,b,a)
-	 */
-	_materialColorProperty(options) {
-		let mColor = 'rgba(0,255,0,1)';
-		if (options !== undefined && options.color !== undefined) mColor = options.color;
-		/* 创建材质 */
-		let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
-		colorMaterial._param = {
-			color: mColor,
-		}
-		/* 返回材质 */
-		return colorMaterial;
-	},
-	/**
-	 * 图形修改
-	 */
-	startModify: function(options) {
-
-		this.state = 2;
-		this.firstPoint.show = true;
-		this.floatPoint.show = true;
-		var $this = this;
-		this.clickStep = 0;
-		if (!this.modifyHandler) this.modifyHandler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		this.modifyHandler.setInputAction(function(evt) { //单机开始绘制
-			var pick = $this.viewer.scene.pick(evt.position);
-			if (Cesium.defined(pick) && pick.id) {
-				$this.clickStep++;
-
-				if (!pick.id.objId) {
-					$this.selectPoint = pick.id;
-				} else {
-					$this.selectPoint = pick.id;
-
-					$this.modifyHandler.destroy();
-					$this.modifyHandler = null;
-					$this.firstPoint.show = false;
-					$this.floatPoint.show = false;
-					$this.state = -1;
-
-					/* 回调返回 */
-					if (options.onComplete) options.onComplete(pick.id.objId);
-				}
-			} else { //激活移动点之后 单击面之外 移除这个事件
-				$this.modifyHandler.destroy();
-				$this.modifyHandler = null;
-				$this.firstPoint.show = false;
-				$this.floatPoint.show = false;
-				$this.state = -1;
-			}
-
-			//选中点后 第二次点击 则重新定位该点
-			if ($this.clickStep == 2) {
-				$this.clickStep = 0;
-				var cartesian;
-				cartesian = getCatesian3FromPX($this.viewer, evt.position);
-				if (!cartesian) return;
-				if ($this.selectPoint) {
-					$this.selectPoint.position.setValue(cartesian);
-					$this.selectPoint = null;
-				}
-			};
-
-		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
-		this.modifyHandler.setInputAction(function(evt) {
-			if ($this.selectPoint) {
-				var cartesian;
-				cartesian = getCatesian3FromPX($this.viewer, evt.endPosition);
-				if (!cartesian) return;
-				if ($this.selectPoint.type) {
-					$this.selectPoint.position.setValue(cartesian);
-					if ($this.selectPoint.type == "firstPoint") {
-						$this.positions[1] = cartesian;
-					}
-					if ($this.selectPoint.type == "floatPoint") {
-						$this.positions[2] = cartesian;
-					}
-				}
-			} else {
-				return;
-			}
-		}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
-	},
-	//通过传入的经纬度数组 构建箭头
-	createByData: function(data) {
-		this.state = -1;
-		this.positions = [];
-		var arr = [];
-		for (var i = 0; i < data.length; i++) {
-			var cart3 = Cesium.Cartesian3.fromDegrees(data[i][0], data[i][1]);
-			arr.push(cart3);
-		}
-		this.positions = arr;
-		this.firstPoint = this.creatPoint(this.positions[1]);
-		this.firstPoint.type = "firstPoint";
-		this.floatPoint = this.creatPoint(this.positions[2]);
-		this.floatPoint.type = "floatPoint";
-		this.arrowEntity = this.showArrowOnMap(this.positions);
-		this.firstPoint.show = false;
-		this.floatPoint.show = false;
-		this.arrowEntity.objId = this.objId;
-	},
-	//清除绘制箭头
-	clear: function() {
-		this.state = 0;
-		if (this.firstPoint) this.viewer.entities.remove(this.firstPoint);
-		if (this.floatPoint) this.viewer.entities.remove(this.floatPoint);
-		if (this.arrowEntity) this.viewer.entities.remove(this.arrowEntity);
-		this.state = -1;
-	},
-	/**
-	 * 创建点
-	 * @param {Object} cartesian
-	 */
-	creatPoint: function(cartesian) {
-		var point = this.viewer.entities.add({
-			position: cartesian,
-			billboard: {
-				image: this.pointImageUrl,
-				verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
-				heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
-				disableDepthTestDistance: Number.POSITIVE_INFINITY
-			}
-		});
-		point.attr = "editPoint";
-		return point;
-	},
-	/**
-	 * 绘制箭头
-	 * @param {Object} positions
-	 */
-	showArrowOnMap: function(positions) {
-		var $this = this;
-		var update = function() {
-			if (positions.length < 2) {
-				return null;
-			}
-			var p1 = positions[1];
-			var p2 = positions[2];
-			var firstPoint = $this.cartesianToLatlng(p1);
-			var endPoints = $this.cartesianToLatlng(p2);
-			var arrow = this.arrow = [];
-
-			var res = xp.algorithm.fineArrow([firstPoint[0], firstPoint[1]], [endPoints[0], endPoints[1]]);
-			var index = JSON.stringify(res).indexOf("null");
-			if (index != -1) return [];
-			for (var i = 0; i < res.length; i++) {
-				var c3 = new Cesium.Cartesian3(res[i].x, res[i].y, res[i].z);
-				arrow.push(c3);
-			}
-
-			return new Cesium.PolygonHierarchy(arrow);
-		}
-
-		return this.viewer.entities.add({
-			polygon: new Cesium.PolygonGraphics({
-				hierarchy: new Cesium.CallbackProperty(update, false),
-				show: true,
-				fill: true,
-				material: $this.fillMaterial
-			})
-		});
-	},
-	//获取直角箭头中的关键点 经纬度
-	getLnglats: function() {
-		var arr = [];
-		for (var i = 0; i < this.positions.length; i++) {
-			var item = this.cartesianToLatlng(this.positions[i]);
-			arr.push(item);
-		}
-		return arr;
-	},
-	cartesianToLatlng: function(cartesian) {
-		var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
-		var lat = Cesium.Math.toDegrees(latlng.latitude);
-		var lng = Cesium.Math.toDegrees(latlng.longitude);
-		return [lng, lat];
-	}
-}
-
-///====================================================================================================
-//燕尾攻击箭头
-var AttackArrow = function(viewer, options) {
-	this.type = "AttackArrow";
-	this.objId = Number((new Date()).getTime() + "" + Number(Math.random() * 1000).toFixed(0))
-	this.viewer = viewer;
-	this.pointImageUrl = "jt3dSDK/imgs/point/point.png";
-	this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-
-	options = options || {};
-
-	options.color = Cesium.defaultValue(options.color, 'rgba(0,255,0,0.5)');
-	options.polygonColor = Cesium.defaultValue(options.polygonColor, 'rgba(0,255,0,0.5)');
-	options.outlineColor = Cesium.defaultValue(options.outlineColor, 'rgba(255,255,255,1)');
-	options.outlineWidth = Cesium.defaultValue(options.outlineWidth, 0);
-
-	/* 通用参数集合 */
-	this._param = {
-		id: "attackArrow",
-		color: options.color,
-		polygonColor: options.polygonColor, //面填充颜色
-		outlineColor: options.outlineColor, //边框颜色
-		outlineWidth: options.outlineWidth, //边框宽度
-	}
-
-	/* 创建面材质 */
-	this.fillMaterial = this._materialColorProperty({
-		color: this._param.polygonColor,
-	})
-	/* 创建线材质 */
-	this.outlineMaterial = this._materialColorProperty({
-		color: this._param.outlineColor,
-	})
-
-	this.positions = []; //控制点
-	this.state = -1; //state用于区分当前的状态 0 为删除 1为添加 2为编辑 
-	this.floatPoint = null;
-	this.arrowEntity = null;
-	this.pointArr = []; //中间各点
-	this.selectPoint = null;
-	this.clickStep = 0; //用于控制点的移动结束
-	this.modifyHandler = null;
-}
-AttackArrow.prototype = {
-	disable: function() {
-		this.positions = [];
-		if (this.arrowEntity) {
-			this.viewer.entities.remove(this.arrowEntity);
-			this.arrowEntity = null;
-		}
-		this.state = -1;
-		if (this.handler) {
-			this.handler.destroy();
-			this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		}
-		if (this.floatPoint) {
-			this.viewer.entities.remove(this.floatPoint);
-			this.floatPoint = null;
-		}
-		if (this.selectPoint) {
-			this.viewer.entities.remove(this.selectPoint);
-			this.selectPoint = null;
-		}
-		for (var i = 0; i < this.pointArr.length; i++) {
-			if (this.pointArr[i]) this.viewer.entities.remove(this.pointArr[i]);
-		}
-		if (this.modifyHandler) {
-			this.modifyHandler.destroy();
-			this.modifyHandler = null;
-		}
-		this.clickStep = 0;
-	},
-	/**
-	 * 取消鼠标事件
-	 * @param {Object} options
-	 */
-	disableHandler: function() {
-		if (this.handler) {
-			this.handler.destroy();
-			this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		}
-		if (this.modifyHandler) {
-			this.modifyHandler.destroy();
-			this.modifyHandler = null;
-		}
-
-		this.state = -1;
-		if (this.pointArr) {
-			for (var i = 0; i < this.pointArr.length; i++) {
-				this.pointArr[i].show = false;
-			}
-		}
-		if (this.floatPoint) {
-			this.floatPoint.show = false;
-		}
-
-	},
-	/**
-	 * 更新面的属性
-	 * @ignore 不公开方法
-	 * @param {Object} params
-	 */
-	_updatePolygonProperty: function(params) {
-		let material = this.arrowEntity.polygon.material;
-		if (material instanceof Cesium.ColorMaterialProperty) {
-			let newMaterial = this._materialColorProperty({
-				color: params.polygonColor,
-			});
-			this.arrowEntity.polygon.material = newMaterial;
-		}
-		if (this.arrowEntity.polyline !== undefined) {
-			let newMaterial = this._materialColorProperty({
-				color: params.outlineColor,
-			});
-			this.arrowEntity.polyline.material = newMaterial;
-			this.arrowEntity.polyline.width = parseFloat(params.outlineWidth);
-		}
-
-		/* 重新关联属性 */
-		this._param = params;
-	},
-
-	/**
-	 * 颜色材质
-	 * @ignore 生成方法时不对外公开
-	 * @param {JSON} options 配置项
-	 * @param {String} options.color 文字颜色 rgba(r,g,b,a)
-	 */
-	_materialColorProperty(options) {
-		let mColor = 'rgba(0,255,0,1)';
-		if (options !== undefined && options.color !== undefined) mColor = options.color;
-		/* 创建材质 */
-		let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
-		colorMaterial._param = {
-			color: mColor,
-		}
-		/* 返回材质 */
-		return colorMaterial;
-	},
-	/**
-	 * 开始绘制
-	 * @param {Object} options
-	 */
-	startDraw: function(options) {
-		var $this = this;
-		let toolTip = "单击开始绘制";
-		if (_isRuntimeApp()) {
-			toolTip = "点击开始绘制";
-			_showTooltipMessage(toolTip);
-		}
-
-		this.state = 1;
-		this.handler.setInputAction(function(evt) { //单机开始绘制
-
-			var cartesian;
-			cartesian = getCatesian3FromPX($this.viewer, evt.position);
-			if (!cartesian) return;
-
-			if ($this.positions.length == 0) {
-				toolTip = "单击添加点";
-				if (_isRuntimeApp()) {
-					toolTip = "点击添加点";
-					_showTooltipMessage(toolTip);
-				}
-				$this.floatPoint = $this.creatPoint(cartesian);
-				$this.floatPoint.wz = -1;
-			}
-			$this.positions.push(cartesian);
-
-			var point = $this.creatPoint(cartesian);
-			if ($this.positions.length > 2) {
-				toolTip = "单击添加点,右键结束绘制";
-				if (_isRuntimeApp()) {
-					toolTip = "点击添加点";
-					_showTooltipMessage(toolTip);
-
-					point.wz = $this.positions.length; //点对应的在positions中的位置  屏蔽mouseMove里往postions添加时 未创建点
-
-					if ($this.positions.length === 3) {
-						//创建按钮
-						_createOperationMainDom();
-
-						//完成绘制
-						document.getElementById("btnDrawComplete").onclick = () => {
-
-							for (var i = 0; i < $this.pointArr.length; i++) {
-								$this.pointArr[i].show = false;
-							}
-							$this.floatPoint.show = false;
-							$this.viewer.entities.remove($this.floatPoint);
-							$this.floatPoint = null;
-
-							$this.handler.destroy();
-
-							CreateRemindertip(toolTip, evt.endPosition, false);
-
-							let buttonDiv = document.getElementById("drawButtonDiv");
-							if (buttonDiv) {
-								//从页面移除
-								document.body.removeChild(buttonDiv);
-							}
-
-							/* 回调返回 */
-							if (options.onComplete) options.onComplete($this.positions, $this.getLnglats());
-						}
-					}
-
-				} else {
-					point.wz = $this.positions.length - 1; //点对应的在positions中的位置  屏蔽mouseMove里往postions添加时 未创建点
-				}
-
-			} else {
-				toolTip = "单击添加点";
-				if (_isRuntimeApp()) {
-					toolTip = "点击添加点";
-					_showTooltipMessage(toolTip);
-
-					if ($this.positions.length === 2) {
-						if (!Cesium.defined($this.arrowEntity)) {
-							$this.arrowEntity = $this.showArrowOnMap($this.positions);
-							$this.arrowEntity.objId = $this.objId;
-						}
-					}
-				}
-
-				point.wz = $this.positions.length; //点对应的在positions中的位置 
-			}
-			$this.pointArr.push(point);
-
-		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
-		this.handler.setInputAction(function(evt) { //移动时绘制面
-
-			/* 如果运行环境是App 则禁止使用移动事件 */
-			if (_isRuntimeApp()) return;
-
-			CreateRemindertip(toolTip, evt.endPosition, true);
-
-			if ($this.positions.length < 2) return;
-
-			var cartesian;
-			cartesian = getCatesian3FromPX($this.viewer, evt.endPosition);
-			if (!cartesian) return;
-			$this.floatPoint.position.setValue(cartesian);
-			if ($this.positions.length >= 2) {
-				toolTip = "单击添加点,右键结束绘制";
-				if (!Cesium.defined($this.arrowEntity)) {
-					$this.positions.push(cartesian);
-					$this.arrowEntity = $this.showArrowOnMap($this.positions);
-					$this.arrowEntity.objId = $this.objId;
-				} else {
-					$this.positions.pop();
-					$this.positions.push(cartesian);
-				}
-			} else {
-				toolTip = "单击添加点";
-			}
-		}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
-
-		//双击击结束绘制
-		this.handler.setInputAction(function(evt) {
-
-			/* 如果运行环境是App 则禁止使用双击事件 */
-			if (_isRuntimeApp()) return;
-
-			CreateRemindertip(toolTip, evt.endPosition, false);
-
-			var cartesian;
-			cartesian = getCatesian3FromPX($this.viewer, evt.position);
-			if (!cartesian) return;
-			for (var i = 0; i < $this.pointArr.length; i++) {
-				$this.pointArr[i].show = false;
-			}
-			$this.floatPoint.show = false;
-			$this.viewer.entities.remove($this.floatPoint);
-			$this.floatPoint = null;
-
-			var point = $this.creatPoint(cartesian);
-			point.show = false;
-			point.wz = $this.positions.length;
-			$this.pointArr.push(point);
-
-			$this.handler.destroy();
-
-
-			/* 回调返回 */
-			if (options.onComplete) options.onComplete($this.positions, $this.getLnglats());
-
-		}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
-	},
-	//根据传入的数据构建箭头
-	createByData: function(data) {
-		this.positions = []; //控制点
-		this.state = -1; //state用于区分当前的状态 0 为删除 1为添加 2为编辑 
-		this.floatPoint = null;
-		this.pointArr = []; //中间各点
-		this.selectPoint = null;
-		this.clickStep = 0; //用于控制点的移动结束
-		this.modifyHandler = null;
-		var arr = [];
-		for (var i = 0; i < data.length; i++) {
-			var cart3 = Cesium.Cartesian3.fromDegrees(data[i][0], data[i][1]);
-			arr.push(cart3);
-		}
-		this.positions = arr;
-		//构建控制点
-		for (var i = 0; i < this.positions.length; i++) {
-			var point = this.creatPoint(this.positions[i]);
-			point.show = false;
-			point.wz = i + 1;
-			this.pointArr.push(point);
-		}
-		this.arrowEntity = this.showArrowOnMap(this.positions);
-		this.arrowEntity.objId = this.objId;
-	},
-	/**
-	 * 图形修改
-	 */
-	startModify: function(options) {
-
-		this.state = 2;
-		var $this = this;
-		for (var i = 0; i < $this.pointArr.length; i++) {
-			$this.pointArr[i].show = true;
-		}
-		if (!this.modifyHandler) this.modifyHandler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		this.modifyHandler.setInputAction(function(evt) { //单机开始绘制
-
-			var pick = $this.viewer.scene.pick(evt.position);
-			if (Cesium.defined(pick) && pick.id) {
-				$this.clickStep++;
-				if (!pick.id.objId) {
-					$this.selectPoint = pick.id;
-				} else {
-					$this.selectPoint = pick.id;
-
-					for (var i = 0; i < $this.pointArr.length; i++) {
-						$this.pointArr[i].show = false;
-					}
-					if ($this.floatPoint) $this.floatPoint.show = false;
-					$this.state = -1;
-					$this.modifyHandler.destroy();
-					$this.modifyHandler = null;
-
-					/* 回调返回 */
-					if (options.onComplete) options.onComplete(pick.id.objId);
-				}
-			} else { //激活移动点之后 单机面之外 移除这个事件
-				for (var i = 0; i < $this.pointArr.length; i++) {
-					$this.pointArr[i].show = false;
-				}
-				if ($this.floatPoint) $this.floatPoint.show = false;
-				$this.state = -1;
-				$this.modifyHandler.destroy();
-				$this.modifyHandler = null;
-			}
-			if ($this.clickStep == 2) {
-				$this.clickStep = 0;
-				var cartesian;
-				cartesian = getCatesian3FromPX($this.viewer, evt.position);
-				if (!cartesian) return;
-				if ($this.selectPoint) {
-					$this.selectPoint.position.setValue(cartesian);
-					$this.selectPoint = null;
-				}
-			};
-		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
-		this.modifyHandler.setInputAction(function(evt) { //单机开始绘制
-			var cartesian;
-			cartesian = getCatesian3FromPX($this.viewer, evt.endPosition);
-			if (!cartesian) return;
-			if ($this.selectPoint) {
-				$this.selectPoint.position.setValue(cartesian);
-				$this.positions[$this.selectPoint.wz - 1] = cartesian; //上方的wz用于此处辨识修改positions数组里的哪个元素
-			} else {
-				return;
-			}
-		}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
-	},
-	//清除绘制箭头
-	clear: function() {
-		this.state = 0;
-		for (var i = 0; i < this.pointArr.length; i++) {
-			if (this.pointArr[i]) this.viewer.entities.remove(this.pointArr[i]);
-		}
-		if (this.floatPoint) this.viewer.entities.remove(this.floatPoint);
-		if (this.arrowEntity) this.viewer.entities.remove(this.arrowEntity);
-		this.state = -1;
-	},
-	/**
-	 * 创建点
-	 * @param {Object} cartesian
-	 */
-	creatPoint: function(cartesian) {
-		var point = this.viewer.entities.add({
-			position: cartesian,
-			billboard: {
-				image: this.pointImageUrl,
-				verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
-				heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
-				disableDepthTestDistance: Number.POSITIVE_INFINITY
-			}
-		});
-		point.attr = "editPoint";
-		return point;
-	},
-	/**
-	 * 绘制箭头
-	 * @param {Object} positions
-	 */
-	showArrowOnMap: function(positions) {
-		var $this = this;
-		var update = function() {
-			//计算面
-			if (positions.length < 3) {
-				return null;
-			}
-			var lnglatArr = [];
-			for (var i = 0; i < positions.length; i++) {
-				var lnglat = $this.cartesianToLatlng(positions[i]);
-				lnglatArr.push(lnglat)
-			}
-			var res = xp.algorithm.tailedAttackArrow(lnglatArr);
-			var index = JSON.stringify(res.polygonalPoint).indexOf("null");
-			var returnData = [];
-			if (index == -1) returnData = res.polygonalPoint;
-			return new Cesium.PolygonHierarchy(returnData);
-		}
-		return this.viewer.entities.add({
-			polygon: new Cesium.PolygonGraphics({
-				hierarchy: new Cesium.CallbackProperty(update, false),
-				show: true,
-				fill: true,
-				material: $this.fillMaterial
-			})
-		});
-	},
-	//获取直角箭头中的关键点 经纬度
-	getLnglats: function() {
-		var arr = [];
-		for (var i = 0; i < this.positions.length; i++) {
-			var item = this.cartesianToLatlng(this.positions[i]);
-			arr.push(item);
-		}
-		return arr;
-	},
-	cartesianToLatlng: function(cartesian) {
-		var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
-		var lat = Cesium.Math.toDegrees(latlng.latitude);
-		var lng = Cesium.Math.toDegrees(latlng.longitude);
-		return [lng, lat];
-	}
-}
-
-///====================================================================================================
-//钳击箭头
-var PincerArrow = function(viewer, options) {
-	this.type = "PincerArrow";
-	this.objId = Number((new Date()).getTime() + "" + Number(Math.random() * 1000).toFixed(0))
-	this.viewer = viewer;
-	this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-	this.pointImageUrl = "jt3dSDK/imgs/point/point.png";
-
-	options = options || {};
-
-	options.color = Cesium.defaultValue(options.color, 'rgba(0,255,0,0.5)');
-	options.polygonColor = Cesium.defaultValue(options.polygonColor, 'rgba(0,255,0,0.5)');
-	options.outlineColor = Cesium.defaultValue(options.outlineColor, 'rgba(255,255,255,1)');
-	options.outlineWidth = Cesium.defaultValue(options.outlineWidth, 1);
-
-	/* 通用参数集合 */
-	this._param = {
-		id: "pincerArrow",
-		color: options.color,
-		polygonColor: options.polygonColor, //面填充颜色
-		outlineColor: options.outlineColor, //边框颜色
-		outlineWidth: options.outlineWidth, //边框宽度
-	}
-
-	/* 创建面材质 */
-	this.fillMaterial = this._materialColorProperty({
-		color: this._param.polygonColor,
-	})
-	/* 创建线材质 */
-	this.outlineMaterial = this._materialColorProperty({
-		color: this._param.outlineColor,
-	})
-
-	this.positions = [];
-	this.state = -1; //state用于区分当前的状态 0 为删除 1为添加 2为编辑 
-	this.floatPoint = null;
-	this.pointArr = [];
-	this.selectPoint = null;
-	this.clickStep = 0; //用于控制点的移动结束
-	this.modifyHandler = null;
-}
-PincerArrow.prototype = {
-	disable: function() {
-		this.positions = [];
-		if (this.arrowEntity) {
-			this.viewer.entities.remove(this.arrowEntity);
-			this.arrowEntity = null;
-		}
-		this.state = -1;
-		if (this.handler) {
-			this.handler.destroy();
-			this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		}
-		if (this.floatPoint) {
-			this.viewer.entities.remove(this.floatPoint);
-			this.floatPoint = null;
-		}
-		if (this.selectPoint) {
-			this.viewer.entities.remove(this.selectPoint);
-			this.selectPoint = null;
-		}
-		for (var i = 0; i < this.pointArr.length; i++) {
-			if (this.pointArr[i]) this.viewer.entities.remove(this.pointArr[i]);
-		}
-		if (this.modifyHandler) {
-			this.modifyHandler.destroy();
-			this.modifyHandler = null;
-		}
-		this.clickStep = 0;
-	},
-	/**
-	 * 取消鼠标事件
-	 * @param {Object} options
-	 */
-	disableHandler: function() {
-		if (this.handler) {
-			this.handler.destroy();
-			this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		}
-		if (this.modifyHandler) {
-			this.modifyHandler.destroy();
-			this.modifyHandler = null;
-		}
-
-		this.state = -1;
-		if (this.pointArr) {
-			for (var i = 0; i < this.pointArr.length; i++) {
-				this.pointArr[i].show = false;
-			}
-		}
-	},
-	/**
-	 * 更新面的属性
-	 * @ignore 不公开方法
-	 * @param {Object} params
-	 */
-	_updatePolygonProperty: function(params) {
-		let material = this.arrowEntity.polygon.material;
-		if (material instanceof Cesium.ColorMaterialProperty) {
-			let newMaterial = this._materialColorProperty({
-				color: params.polygonColor,
-			});
-			this.arrowEntity.polygon.material = newMaterial;
-		}
-		if (this.arrowEntity.polyline !== undefined) {
-			let newMaterial = this._materialColorProperty({
-				color: params.outlineColor,
-			});
-			this.arrowEntity.polyline.material = newMaterial;
-			this.arrowEntity.polyline.width = parseFloat(params.outlineWidth);
-		}
-
-		/* 重新关联属性 */
-		this._param = params;
-	},
-
-	/**
-	 * 颜色材质
-	 * @ignore 生成方法时不对外公开
-	 * @param {JSON} options 配置项
-	 * @param {String} options.color 文字颜色 rgba(r,g,b,a)
-	 */
-	_materialColorProperty(options) {
-		let mColor = 'rgba(0,255,0,1)';
-		if (options !== undefined && options.color !== undefined) mColor = options.color;
-		/* 创建材质 */
-		let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
-		colorMaterial._param = {
-			color: mColor,
-		}
-		/* 返回材质 */
-		return colorMaterial;
-	},
-	/**
-	 * 开始绘制
-	 * @param {Object} options
-	 */
-	startDraw: function(options) {
-		var $this = this;
-		let toolTip = "单击开始绘制";
-		if (_isRuntimeApp()) {
-			toolTip = "点击开始绘制";
-			_showTooltipMessage(toolTip);
-		}
-
-		this.state = 1;
-
-		//左键单击开始绘制
-		this.handler.setInputAction(function(evt) {
-
-			var cartesian;
-			cartesian = getCatesian3FromPX($this.viewer, evt.position);
-			if (!cartesian) return;
-
-			if ($this.positions.length == 0) {
-				$this.floatPoint = $this.creatPoint(cartesian);
-				toolTip = "单击添加点";
-				if (_isRuntimeApp()) {
-					toolTip = "点击添加点";
-					_showTooltipMessage(toolTip);
-				}
-			}
-
-			$this.positions.push(cartesian);
-			var point = $this.creatPoint(cartesian);
-			if ($this.positions.length > 2) {
-				if ($this.positions.length == 3) {
-					toolTip = "再次单击结束绘制";
-					if (_isRuntimeApp()) {
-						toolTip = "再次点击结束绘制";
-						_showTooltipMessage(toolTip);
-					}
-				}
-
-				if (_isRuntimeApp()) {
-					point.wz = $this.positions.length; //点对应的在positions中的位置  屏蔽mouseMove里往postions添加时 未创建点
-
-					if ($this.positions.length === 4) {
-
-						for (var i = 0; i < $this.pointArr.length; i++) {
-							$this.pointArr[i].show = false;
-						}
-						if ($this.floatPoint) { //移除动态点
-							$this.floatPoint.show = false;
-							$this.viewer.entities.remove($this.floatPoint);
-							$this.floatPoint = null;
-						}
-
-						$this.handler.destroy();
-
-						CreateRemindertip(toolTip, evt.endPosition, false);
-
-						/* 回调返回 */
-						if (options.onComplete) options.onComplete($this.positions, $this.getLnglats());
-					}
-				} else {
-					point.wz = $this.positions.length - 1; //点对应的在positions中的位置  屏蔽mouseMove里往postions添加时 未创建点
-					if ($this.positions.length === 5) {
-
-						$this.positions.pop();
-						for (var i = 0; i < $this.pointArr.length; i++) {
-							$this.pointArr[i].show = false;
-						}
-						if ($this.floatPoint) { //移除动态点
-							$this.floatPoint.show = false;
-							$this.viewer.entities.remove($this.floatPoint);
-							$this.floatPoint = null;
-						}
-
-						$this.handler.destroy();
-
-						CreateRemindertip(toolTip, evt.endPosition, false);
-
-						/* 回调返回 */
-						if (options.onComplete) options.onComplete($this.positions, $this.getLnglats());
-					}
-				}
-			} else {
-				point.wz = $this.positions.length; //点对应的在positions中的位置 
-
-				if (_isRuntimeApp()) {
-					toolTip = "点击添加点";
-					_showTooltipMessage(toolTip);
-
-					if ($this.positions.length === 2) {
-						if (!Cesium.defined($this.arrowEntity)) {
-							$this.arrowEntity = $this.showArrowOnMap($this.positions);
-							$this.arrowEntity.objId = $this.objId;
-						}
-					}
-				}
-			}
-			$this.pointArr.push(point);
-
-		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
-
-		//移动时绘制面
-		this.handler.setInputAction(function(evt) {
-			/* 如果运行环境是App 则禁止使用移动事件 */
-			if (_isRuntimeApp()) return;
-
-			CreateRemindertip(toolTip, evt.endPosition, true);
-
-			if ($this.positions.length < 2) return;
-
-			var cartesian;
-			cartesian = getCatesian3FromPX($this.viewer, evt.endPosition);
-			if (!cartesian) return;
-
-			$this.floatPoint.position.setValue(cartesian);
-			if ($this.positions.length >= 2) {
-				if (!Cesium.defined($this.arrowEntity)) {
-					$this.positions.push(cartesian);
-					$this.arrowEntity = $this.showArrowOnMap($this.positions);
-					$this.arrowEntity.objId = $this.objId;
-				} else {
-					$this.positions.pop();
-					$this.positions.push(cartesian);
-				}
-			}
-
-		}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
-	},
-
-	//根据传入的数据构建箭头
-	createByData: function(data) {
-		this.positions = []; //控制点
-		this.state = -1; //state用于区分当前的状态 0 为删除 1为添加 2为编辑 
-		this.floatPoint = null;
-		this.pointArr = []; //中间各点
-		this.selectPoint = null;
-		this.clickStep = 0; //用于控制点的移动结束
-		this.modifyHandler = null;
-		var arr = [];
-		for (var i = 0; i < data.length; i++) {
-			var cart3 = Cesium.Cartesian3.fromDegrees(data[i][0], data[i][1]);
-			arr.push(cart3);
-		}
-		this.positions = arr;
-		//构建控制点
-		for (var i = 0; i < this.positions.length; i++) {
-			var point = this.creatPoint(this.positions[i]);
-			point.show = false;
-			point.wz = i + 1;
-			this.pointArr.push(point);
-		}
-		this.arrowEntity = this.showArrowOnMap(this.positions);
-		this.arrowEntity.objId = this.objId;
-	},
-	/**
-	 * 图形修改
-	 */
-	startModify: function(options) {
-
-		this.state = 2;
-		var $this = this;
-		for (var i = 0; i < $this.pointArr.length; i++) {
-			$this.pointArr[i].show = true;
-		}
-		if (!this.modifyHandler) this.modifyHandler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
-		this.modifyHandler.setInputAction(function(evt) { //单机开始绘制
-
-			var pick = $this.viewer.scene.pick(evt.position);
-			if (Cesium.defined(pick) && pick.id) {
-
-				$this.clickStep++;
-				if (!pick.id.objId) {
-					$this.selectPoint = pick.id;
-				} else {
-					$this.selectPoint = pick.id;
-
-					for (var i = 0; i < $this.pointArr.length; i++) {
-						$this.pointArr[i].show = false;
-					}
-					$this.state = -1;
-					$this.modifyHandler.destroy(); //激活移动点之后 单机面之外 移除这个事件
-					$this.modifyHandler = null;
-
-					/* 回调返回 */
-					if (options.onComplete) options.onComplete(pick.id.objId);
-				}
-			} else {
-				for (var i = 0; i < $this.pointArr.length; i++) {
-					$this.pointArr[i].show = false;
-				}
-				$this.state = -1;
-				$this.modifyHandler.destroy(); //激活移动点之后 单机面之外 移除这个事件
-				$this.modifyHandler = null;
-			}
-			if ($this.clickStep == 2) {
-				$this.clickStep = 0;
-				var cartesian;
-				cartesian = getCatesian3FromPX($this.viewer, evt.position);
-				if (!cartesian) return;
-				if ($this.selectPoint) {
-					$this.selectPoint.position.setValue(cartesian);
-					$this.selectPoint = null;
-				}
-
-			};
-		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
-		this.modifyHandler.setInputAction(function(evt) { //单机开始绘制
-			var cartesian;
-			cartesian = getCatesian3FromPX($this.viewer, evt.endPosition);
-			if (!cartesian) return;
-			if ($this.selectPoint) {
-				$this.selectPoint.position.setValue(cartesian);
-				$this.positions[$this.selectPoint.wz - 1] = cartesian; //上方的wz用于此处辨识修改positions数组里的哪个元素
-			} else {
-				return;
-			}
-		}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
-	},
-	//清除绘制箭头
-	clear: function() {
-		this.state = 0;
-		for (var i = 0; i < this.pointArr.length; i++) {
-			if (this.pointArr[i]) this.viewer.entities.remove(this.pointArr[i]);
-		}
-		if (this.floatPoint) this.viewer.entities.remove(this.floatPoint);
-		if (this.arrowEntity) this.viewer.entities.remove(this.arrowEntity);
-		this.state = -1;
-	},
-
-	/**
-	 * 创建点
-	 * @param {Object} cartesian
-	 */
-	creatPoint: function(cartesian) {
-		return this.viewer.entities.add({
-			position: cartesian,
-			billboard: {
-				image: this.pointImageUrl,
-				verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
-				heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
-				disableDepthTestDistance: Number.POSITIVE_INFINITY
-			}
-		});
-	},
-	/**
-	 * 绘制箭头
-	 * @param {Object} positions
-	 */
-	showArrowOnMap: function(positions) {
-		var $this = this;
-		var update = function() {
-			//计算面
-			if (positions.length < 3) {
-				return null;
-			}
-			var lnglatArr = [];
-			for (var i = 0; i < positions.length; i++) {
-				var lnglat = $this.cartesianToLatlng(positions[i]);
-				lnglatArr.push(lnglat)
-			}
-			var res = xp.algorithm.doubleArrow(lnglatArr);
-			var returnData = [];
-			var index = JSON.stringify(res.polygonalPoint).indexOf("null");
-			if (index == -1) returnData = res.polygonalPoint;
-			return new Cesium.PolygonHierarchy(returnData);
-		}
-		return this.viewer.entities.add({
-			polygon: new Cesium.PolygonGraphics({
-				hierarchy: new Cesium.CallbackProperty(update, false),
-				show: true,
-				fill: true,
-				material: $this.fillMaterial
-			})
-		});
-	},
-	//获取直角箭头中的关键点 经纬度
-	getLnglats: function() {
-		var arr = [];
-		for (var i = 0; i < this.positions.length; i++) {
-			var item = this.cartesianToLatlng(this.positions[i]);
-			arr.push(item);
-		}
-		return arr;
-	},
-	cartesianToLatlng: function(cartesian) {
-		var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
-		var lat = Cesium.Math.toDegrees(latlng.latitude);
-		var lng = Cesium.Math.toDegrees(latlng.longitude);
-		return [lng, lat];
-	}
-}
-
-function getCatesian3FromPX(viewer, px) {
-	var picks = viewer.scene.drillPick(px);
-	viewer.render();
-	var cartesian;
-	var isOn3dtiles = true;
-	for (var i = 0; i < picks.length; i++) {
-		if ((picks[i] && picks[i].primitive) || picks[i] instanceof Cesium.Cesium3DTileFeature) { //模型上拾取
-			isOn3dtiles = true;
-		}
-	}
-	if (isOn3dtiles) {
-		cartesian = viewer.scene.pickPosition(px);
-	} else {
-		var ray = viewer.camera.getPickRay(px);
-		if (!ray) return null;
-		cartesian = viewer.scene.globe.pick(ray, viewer.scene);
-	}
-	return cartesian;
-}
-
-
-export {
-	StraightArrow,
-	AttackArrow,
-	PincerArrow
-}

+ 0 - 215
src/jtMap3d/Widgets/DrawTools/drawArrow/plotUtil.js

@@ -1,215 +0,0 @@
-var P = {
-	version: "1.0.0"
-}
-P.PlotUtils = {}, P.PlotUtils.distance = function(t, o) {
-	return Math.sqrt(Math.pow(t[0] - o[0], 2) + Math.pow(t[1] - o[1], 2))
-}, P.PlotUtils.wholeDistance = function(t) {
-	for (var o = 0, e = 0; e < t.length - 1; e++) o += P.PlotUtils.distance(t[e], t[e + 1]);
-	return o
-}, P.PlotUtils.getBaseLength = function(t) {
-	return Math.pow(P.PlotUtils.wholeDistance(t), .99)
-}, P.PlotUtils.mid = function(t, o) {
-	return [(t[0] + o[0]) / 2, (t[1] + o[1]) / 2]
-}, P.PlotUtils.getCircleCenterOfThreePoints = function(t, o, e) {
-	var r = [(t[0] + o[0]) / 2, (t[1] + o[1]) / 2],
-		n = [r[0] - t[1] + o[1], r[1] + t[0] - o[0]],
-		g = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2],
-		i = [g[0] - t[1] + e[1], g[1] + t[0] - e[0]];
-	return P.PlotUtils.getIntersectPoint(r, n, g, i)
-}, P.PlotUtils.getIntersectPoint = function(t, o, e, r) {
-	if (t[1] == o[1]) {
-		var n = (r[0] - e[0]) / (r[1] - e[1]),
-			g = n * (t[1] - e[1]) + e[0],
-			i = t[1];
-		return [g, i]
-	}
-	if (e[1] == r[1]) {
-		var s = (o[0] - t[0]) / (o[1] - t[1]);
-		return g = s * (e[1] - t[1]) + t[0], i = e[1], [g, i]
-	}
-	return s = (o[0] - t[0]) / (o[1] - t[1]), n = (r[0] - e[0]) / (r[1] - e[1]), i = (s * t[1] - t[0] - n * e[1] + e[0]) / (s - n), g = s * i - s * t[1] + t[0], [g, i]
-}, P.PlotUtils.getAzimuth = function(t, o) {
-	var e, r = Math.asin(Math.abs(o[1] - t[1]) / P.PlotUtils.distance(t, o));
-	return o[1] >= t[1] && o[0] >= t[0] ? e = r + Math.PI : o[1] >= t[1] && o[0] < t[0] ? e = P.Constants.TWO_PI - r : o[1] < t[1] && o[0] < t[0] ? e = r : o[1] < t[1] && o[0] >= t[0] && (e = Math.PI - r), e
-}, P.PlotUtils.getAngleOfThreePoints = function(t, o, e) {
-	var r = P.PlotUtils.getAzimuth(o, t) - P.PlotUtils.getAzimuth(o, e);
-	return 0 > r ? r + P.Constants.TWO_PI : r
-}, P.PlotUtils.isClockWise = function(t, o, e) {
-	return (e[1] - t[1]) * (o[0] - t[0]) > (o[1] - t[1]) * (e[0] - t[0])
-}, P.PlotUtils.getPointOnLine = function(t, o, e) {
-	var r = o[0] + t * (e[0] - o[0]),
-		n = o[1] + t * (e[1] - o[1]);
-	return [r, n]
-}, P.PlotUtils.getCubicValue = function(t, o, e, r, n) {
-	t = Math.max(Math.min(t, 1), 0);
-	var g = 1 - t,
-		i = t * t,
-		s = i * t,
-		a = g * g,
-		l = a * g,
-		u = l * o[0] + 3 * a * t * e[0] + 3 * g * i * r[0] + s * n[0],
-		c = l * o[1] + 3 * a * t * e[1] + 3 * g * i * r[1] + s * n[1];
-	return [u, c]
-}, P.PlotUtils.getThirdPoint = function(t, o, e, r, n) {
-	var g = P.PlotUtils.getAzimuth(t, o),
-		i = n ? g + e : g - e,
-		s = r * Math.cos(i),
-		a = r * Math.sin(i);
-	return [o[0] + s, o[1] + a]
-}, P.PlotUtils.getArcPoints = function(t, o, e, r) {
-	var n, g, i = [],
-		s = r - e;
-	s = 0 > s ? s + P.Constants.TWO_PI : s;
-	for (var a = 0; a <= P.Constants.FITTING_COUNT; a++) {
-		var l = e + s * a / P.Constants.FITTING_COUNT;
-		n = t[0] + o * Math.cos(l), g = t[1] + o * Math.sin(l), i.push([n, g])
-	}
-	return i
-}, P.PlotUtils.getBisectorNormals = function(t, o, e, r) {
-	var n = P.PlotUtils.getNormal(o, e, r),
-		g = Math.sqrt(n[0] * n[0] + n[1] * n[1]),
-		i = n[0] / g,
-		s = n[1] / g,
-		a = P.PlotUtils.distance(o, e),
-		l = P.PlotUtils.distance(e, r);
-	if (g > P.Constants.ZERO_TOLERANCE)
-		if (P.PlotUtils.isClockWise(o, e, r)) {
-			var u = t * a,
-				c = e[0] - u * s,
-				p = e[1] + u * i,
-				h = [c, p];
-			u = t * l, c = e[0] + u * s, p = e[1] - u * i;
-			var d = [c, p]
-		} else u = t * a, c = e[0] + u * s, p = e[1] - u * i, h = [c, p], u = t * l, c = e[0] - u * s, p = e[1] + u * i, d = [c, p];
-	else c = e[0] + t * (o[0] - e[0]), p = e[1] + t * (o[1] - e[1]), h = [c, p], c = e[0] + t * (r[0] - e[0]), p = e[1] + t * (r[1] - e[1]), d = [c, p];
-	return [h, d]
-}, P.PlotUtils.getNormal = function(t, o, e) {
-	var r = t[0] - o[0],
-		n = t[1] - o[1],
-		g = Math.sqrt(r * r + n * n);
-	r /= g, n /= g;
-	var i = e[0] - o[0],
-		s = e[1] - o[1],
-		a = Math.sqrt(i * i + s * s);
-	i /= a, s /= a;
-	var l = r + i,
-		u = n + s;
-	return [l, u]
-}, P.PlotUtils.getCurvePoints = function(t, o) {
-	for (var e = P.PlotUtils.getLeftMostControlPoint(o), r = [e], n = 0; n < o.length - 2; n++) {
-		var g = o[n],
-			i = o[n + 1],
-			s = o[n + 2],
-			a = P.PlotUtils.getBisectorNormals(t, g, i, s);
-		r = r.concat(a)
-	}
-	var l = P.PlotUtils.getRightMostControlPoint(o);
-	r.push(l);
-	var u = [];
-	for (n = 0; n < o.length - 1; n++) {
-		g = o[n], i = o[n + 1], u.push(g);
-		for (var t = 0; t < P.Constants.FITTING_COUNT; t++) {
-			var c = P.PlotUtils.getCubicValue(t / P.Constants.FITTING_COUNT, g, r[2 * n], r[2 * n + 1], i);
-			u.push(c)
-		}
-		u.push(i)
-	}
-	return u
-}, P.PlotUtils.getLeftMostControlPoint = function(o) {
-	var e = o[0],
-		r = o[1],
-		n = o[2],
-		g = P.PlotUtils.getBisectorNormals(0, e, r, n),
-		i = g[0],
-		s = P.PlotUtils.getNormal(e, r, n),
-		a = Math.sqrt(s[0] * s[0] + s[1] * s[1]);
-	if (a > P.Constants.ZERO_TOLERANCE) var l = P.PlotUtils.mid(e, r),
-		u = e[0] - l[0],
-		c = e[1] - l[1],
-		p = P.PlotUtils.distance(e, r),
-		h = 2 / p,
-		d = -h * c,
-		f = h * u,
-		E = d * d - f * f,
-		v = 2 * d * f,
-		A = f * f - d * d,
-		_ = i[0] - l[0],
-		y = i[1] - l[1],
-		m = l[0] + E * _ + v * y,
-		O = l[1] + v * _ + A * y;
-	else m = e[0] + t * (r[0] - e[0]), O = e[1] + t * (r[1] - e[1]);
-	return [m, O]
-}, P.PlotUtils.getRightMostControlPoint = function(o) {
-	var e = o.length,
-		r = o[e - 3],
-		n = o[e - 2],
-		g = o[e - 1],
-		i = P.PlotUtils.getBisectorNormals(0, r, n, g),
-		s = i[1],
-		a = P.PlotUtils.getNormal(r, n, g),
-		l = Math.sqrt(a[0] * a[0] + a[1] * a[1]);
-	if (l > P.Constants.ZERO_TOLERANCE) var u = P.PlotUtils.mid(n, g),
-		c = g[0] - u[0],
-		p = g[1] - u[1],
-		h = P.PlotUtils.distance(n, g),
-		d = 2 / h,
-		f = -d * p,
-		E = d * c,
-		v = f * f - E * E,
-		A = 2 * f * E,
-		_ = E * E - f * f,
-		y = s[0] - u[0],
-		m = s[1] - u[1],
-		O = u[0] + v * y + A * m,
-		T = u[1] + A * y + _ * m;
-	else O = g[0] + t * (n[0] - g[0]), T = g[1] + t * (n[1] - g[1]);
-	return [O, T]
-}, P.PlotUtils.getBezierPoints = function(t) {
-	if (t.length <= 2) return t;
-	for (var o = [], e = t.length - 1, r = 0; 1 >= r; r += .01) {
-		var y = 0;
-		for (var n = y = 0, g = 0; e >= g; g++) {
-			var i = P.PlotUtils.getBinomialFactor(e, g),
-				s = Math.pow(r, g),
-				a = Math.pow(1 - r, e - g);
-			n += i * s * a * t[g][0], y += i * s * a * t[g][1]
-		}
-		o.push([n, y])
-	}
-	return o.push(t[e]), o
-}, P.PlotUtils.getBinomialFactor = function(t, o) {
-	return P.PlotUtils.getFactorial(t) / (P.PlotUtils.getFactorial(o) * P.PlotUtils.getFactorial(t - o))
-}, P.PlotUtils.getFactorial = function(t) {
-	if (1 >= t) return 1;
-	if (2 == t) return 2;
-	if (3 == t) return 6;
-	if (4 == t) return 24;
-	if (5 == t) return 120;
-	for (var o = 1, e = 1; t >= e; e++) o *= e;
-	return o
-}, P.PlotUtils.getQBSplinePoints = function(t) {
-	if (t.length <= 2) return t;
-	var o = 2,
-		e = [],
-		r = t.length - o - 1;
-	e.push(t[0]);
-	for (var n = 0; r >= n; n++)
-		for (var g = 0; 1 >= g; g += .05) {
-			var y = 0;
-			for (var i = y = 0, s = 0; o >= s; s++) {
-				var a = P.PlotUtils.getQuadricBSplineFactor(s, g);
-				i += a * t[n + s][0], y += a * t[n + s][1]
-			}
-			e.push([i, y])
-		}
-	return e.push(t[t.length - 1]), e
-}, P.PlotUtils.getQuadricBSplineFactor = function(t, o) {
-	return 0 == t ? Math.pow(o - 1, 2) / 2 : 1 == t ? (-2 * Math.pow(o, 2) + 2 * o + 1) / 2 : 2 == t ? Math.pow(o, 2) / 2 : 0
-}, P.Constants = {
-	TWO_PI: 2 * Math.PI,
-	HALF_PI: Math.PI / 2,
-	FITTING_COUNT: 100,
-	ZERO_TOLERANCE: 1e-4
-}
-
-export default P