       var MapCon = function (options) {
            this.init(options);

        };
        MapCon.prototype = {
            constructor: MapCon,
            init: function (options) {
                var defaultOp = {
                    center: {
                        x: 12,
                        y: 0

                    },
                    arrow: {
                        fromColor: "#24beef",
                        toColor: "#ffce4a",
                        path: "M-12,0 A12,4,0,1,0,12,0 M-12,0 A12,4,0,1,1,12,0"//"M-11,-4L11,-4L11,4L-11,4L-11,-4"//"M-4,-4L4,-4L4,4L-4,4L-4,-4"//"M-6.5,0l11,-10.5,-6.9,10.5,6.9,10.5z"
                        //"M-8,0L-7,-1L-1,-1L5,-8L3,-1L8,-1L10,-3L9,0L10,3L8,1L3,1L5,8L-1,1L-7,1Z"

                    },
                    data: [],
                    testData: [],
                    _key: {//1
                        "id": 1,
                        "label": "主平台",
                        "x": 224,
                        "y": 316,
                        "provinceId": 6,
                        "color": "#d002f5"

                    },
                    _key1: {//2
                        "id": 2,
                        "label": "主平台",
                        "x": 270,
                        "y": 316,
                        "provinceId": 6,
                        "color": "#d002f5"
                    },
                    _key2: {//6
                        "id": 3,
                        "label": "主平台",
                        "x": 480,
                        "y": 316,
                        "provinceId": 6,
                        "color": "#d002f5"
                    },
                    _key3: {//3
                        "id": 4,
                        "label": "主平台",
                        "x": 296,
                        "y": 245,
                        "provinceId": 6,
                        "color": "#d002f5"
                    },
                    _key4: {//4
                        "id": 5,
                        "label": "主平台",
                        "x": 345,
                        "y": 245,
                        "provinceId": 6,
                        "color": "#d002f5"
                    },
                    _key5: {//5
                        "id": 6,
                        "label": "主平台",
                        "x": 370,
                        "y": 316,
                        "provinceId": 6,
                        "color": "#d002f5"
                    },
                    toPointColor: "#ffce4a",
                    fromPointColor: "#24beef",
                    toPointOpacity: 0.8,
                    fromPointOpacity: 0.8,
                    labelColor: "#FFF",
                    smallPointRadius: 4,
                    smallPointColor: "#FFF",
                    smallPointOpacity: 0.7,
                    smallLineColor: "#fff",
                    paperId: "drawpath",
                    pointCallback: null
                };
                this.options = $.extend(true, {}, defaultOp, options);
                this.paper = Raphael(this.options.paperId, "100%", "100%");
                this._initSet();
                this._data = [];
                this.highdata = {};
                this._key = this.options._key;
                this._key1 = this.options._key1;
                this._key2 = this.options._key2;
                this._key3 = this.options._key3;
                this._key4 = this.options._key4;
                this._key5 = this.options._key5;
                //this._calcData(testData,this._key);
                this._initPaper();
                var self = this;
                self._rundata = { "beijing": [], "shanghai": [], "chengdu": [], "dalian": [], "shenzhen": [], "hangzhou": [], "nanjing": [], "guangzhou": [], "nantong": [], "hefei": [], "eluosi": [], "riben": [], "yindu": [], "hanguo": [], "meiguo": [] };
                self.MaxId = "0";
                self.drawRelations(self._key, this.options.testData, "to");
            },
            timeHandler: {},
            runData: function (item) {
                var self = this;
                var i = 0;
                //var run = function(){
                //var id = item.id;
                //self[id] = setTimeout(function(){
                //for(var i=0;i<10;i++)
                var data = this._rundata[item.id];
                //item["count"] = data.length;
                //item["curcount"] = -1;
                //if (data.length > 0) {
                self._testAnim(item);
                //}
            },
            _initSet: function () {
                this._points = this.paper.set(); //paper的一个集合，可以是线或者点等等
                this._labels = this.paper.set();
                this._paths = this.paper.set();
                this._lines = this.paper.set();
                this._arrows = this.paper.set()
            },
            _initSetOrder: function () {//设置Raphael各个元素的层级，即圈、线之类的元素谁在上谁在下
                this._paths.toBack();
                this._lines.toFront();
                this._points.toFront();
                this._labels.toFront();
                this._arrows.toFront();
            },
            _eachData: function (callback) {
                var self = this;
                $(this._data).each(function (index, value) {
                    callback.call(self, value, index, self._data);
                });
            },
            _drawPoints: function (dir) {
                this._direction = dir;
                this._type = "points";
                this._calcData(a);
                this._eachData(function (a) {
                    this._drawPoint(a)
                });
                this._initSetOrder()

            },
            getPointInstance: function (dataid) {
                var data = this._data;
                var pointid;
                for (var i = 0; i < data.length; i++) {
                    if (data[i].id == dataid) {
                        pointid = data[i].pointId;
                    }
                }
                return this.paper.getById(pointid);
            },
            getLineInstance: function (lineid) {
                var data = this._data;
                var pathid;
                for (var i = 0; i < data.length; i++) {
                    if (data[i].id == lineid) {
                        pathid = data[i].pathId;
                    }
                }
                return this.paper.getById(pathid).data("line");
            },
            _highlight: function (point, pre_point) {
                var self = this;

                if (pre_point != null) {
                    var prc = [];
                    var point_p = this.highdata[pre_point.id];
                    for (var i = 0; i < point_p.length; i++) {
                        point_p[i].remove();
                    }
                    pre_point.r = 15;
                    this._drawPoint(pre_point);
                }
                var pcc = [];
                var point_m = this.highdata[point.id];
                for (var i = 0; i < point_m.length; i++) {
                    point_m[i].remove();
                }
                point.r = 20;
                this._drawPoint(point);
            },
            _drawRaphaelc: function (r_f, r_i, i, s_color, dataz, point, callback) {
                this.paper.customAttributes.fg = function (e) {
                    var sop = parseFloat(this.data("sop")), //透明度
						   sr = parseFloat(this.data("sr")), //半径
						   isrun = this.data("isrun"); //next是否已经启动
                    if (e < 0.5) {
                        this.attr({
                            "stroke-opacity": sop,
                            r: 2 * e * sr		//半径变到最大，即放大动画过程
                        });
                    } else {
                        this.attr({
                            "stroke-opacity": 2 * (1 - e) * sop,  //随e变化，透明度参数由1变为0，即为后半段消失动画
                            r: sr
                        });
                        if (isrun == "no") {

                            this.data("c2").attr({ fg2: 0 }).animate(this.data("ab"));
                            this.data("isrun", "yes");
                        }
                        if (e == 1) {
                            this.data("isrun", "no");
                        }
                    }
                };
                this.paper.customAttributes.fg2 = function (e) {
                    var sop = parseFloat(this.data("sop")),
						   sr = parseFloat(this.data("sr"));
                    isrun = this.data("isrun"); //next是否已经启动
                    if (e < 0.5) {
                        this.attr({
                            "stroke-opacity": sop,
                            r: 2 * e * sr		//半径变到最大，即放大动画过程
                        });
                    } else {
                        this.attr({
                            "stroke-opacity": 2 * (1 - e) * sop,  //随e变化，透明度参数由1变为0，即为后半段消失动画
                            r: sr
                        });
                        if (isrun == "no") {
                            this.data("c").attr({ fg: 0 }).animate(this.data("ab"));
                            this.data("isrun", "yes");
                        }
                        if (e == 1) {
                            this.data("isrun", "no");
                        }
                    }
                };
                var c = this.paper.circle(point.x, point.y, 0).attr({ fg: 0, fill: "none", "stroke-width": r_f, stroke: s_color, "stroke-opacity": 1 - (2 * i + 1) / 10 });
                c.data({ "sop": 1 - (2 * i + 1) / 10, "sr": point.r - r_i });
                var c2 = this.paper.circle(point.x, point.y, 0).attr({ fg2: 0, fill: "none", "stroke-width": r_f, stroke: s_color, "stroke-opacity": 1 - (2 * i + 1) / 10 });
                c2.data({ "sop": 1 - (2 * i + 1) / 10, "sr": point.r - r_i });
                c.data("isrun", "no");
                c2.data("isrun", "no");
                var a = Raphael.animation({ fg: 1 }, 5000, function () {
                });
                var b = Raphael.animation({ fg2: 1 }, 5000, function () {
                });
                c.data("c2", c2);
                c.data("ab", b);
                c2.data("c", c);
                c2.data("ab", a);
                dataz.push(c);
                dataz.push(c2);
                c.animate(a);
                return dataz;
            },
            _drawPoint: function (point, callback) {
                var self = this;
                var dataz = [];
                var r = point.r//最外层线宽
                var pc = this.paper.circle(point.x, point.y, 1).attr({ fill: "none", "stroke-width": 0, stroke: point.color }).click($.proxy(this, "_onclickPoint", point)).data("id", point.id);
                dataz.push(pc);
                //if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)) {
                pc = this.paper.circle(point.x, point.y, 0).attr({
                    "stroke-width": 0,
                    stroke: point.color,
                    fill: point.color,
                    title: point.label,
                    "fill-opacity": point.opacity,
                    transform: "s0",
                    cursor: "pointer"
                }).click($.proxy(this, "_onclickPoint", point)).data("id", point.id);
                //                } else {
                //                    for (var i = 0; i < 5; i++) {
                //                        var r_f, r_i; //最外层线宽
                //                        if (i == 0)
                //                            r_f = 1, r_i = 0;
                //                        else
                //                            r_f = 2, r_i = 2 * i - 1;
                //                        dataz = this._drawRaphaelc(r_f, r_i, i, point.color, dataz, point, callback); //ani(2,7,4)
                //                    }
                //                    this.highdata[point.id] = dataz;
                //                }
                point.pointId = pc.id;
                this._points.push(pc);
                this._proxyAnimation(pc, {
                    transform: "s1"
                }, 10 * point.r, function () {
                    "small" != point.type;      //&& b._drawLabel(a);
                    callback && callback.call(self,
                point)
                })
            },

            _onclickPoint: function (point) {
                if (point.id == "key-1") return;
                this.options.pointCallback && this.options.pointCallback(point);
            },
            _calcControlPoint: function (a, e, b) {
                var h = this._calcMiddlePoint(a, e),
            c = {};
                if (a.y === e.y) c.x = h.x, c.y = h.y + b;
                else {
                    var g = (a.x -
                e.x) / (a.y - e.y),
                l = -Math.atan(Math.abs(g)),
                p = b * Math.cos(l);
                    b *= Math.sin(l);
                    c.x = h.x + this.sign(g) * p;
                    c.y = h.y + b;
                    0 >= (e.x - a.x) * (c.x - a.x) && (h = this._calcLength(a, h), e = this._calcLength(a, e) * h / Math.abs(a.y - e.y), c.x = a.x, c.y = a.y - e)
                }
                return c
            },
            sign: function (a) {
                return 0 < a ? 1 : 0 > a ? -1 : 0
            },
            _calcMiddlePoint: function (a, e) {
                return {
                    x: (a.x + e.x) / 2,
                    y: (a.y + e.y) / 2
                }
            },
            _clearData: function () {

            },
            clearPaper: function () {
                this.paper.clear();
                //this.hideTip();
                this._initSet();
                this._clearData();
            },
            _calcData: function (relate, center) {
                this._clearData();
                center && (this._key = $.extend({}, center, {
                    //co: this.pointToPixel(e),
                    //r: 8, //this._calcPointRadius(e.heat),
                    type: "key",
                    //color: this.options[this._direction + "PointColor"],
                    opacity: this.options[this._direction + "PointOpacity"],
                    "stroke-width": 0
                }), this._key.id = "key-" + this._key.id);
                if (relate && relate.length)
                    for (var i = 0, len = relate.length; i < len; i++) {
                        var c = "small"; //b < this.options.bigPoints ? "big" : "small",
                        //g = this.pointToPixel(a[b]),
                        // l = "big" == c ? "points" == this._type ? this._calcPointRadius(a[b].heat) : this._calcRelationPointRadius(a[b].heat) : this.options.smallPointRadius;
                        this._data[i] = $.extend({}, relate[i], {
                            // co: g,
                            r: 15,
                            type: c,
                            "stroke-width": 0
                        });
                        "big" == c ? (g = this._direction,
                    relate && (g = "to" == g ? "from" : "to"), c = this.options[g + "PointOpacity"], g = this.options[g + "PointColor"]) : (c = this.options.smallPointOpacity, g = this.options.smallPointColor);
                        //this._data[i].color = g;
                        this._data[i].opacity = c
                    }
            },
            setFill: function (e, type) {
                var h = {};
                h["stroke-width"] = 0;
                h.stroke = "none";
                var c = this._calcLineDegree(this._key, e);
                if ("from" ==
                            this._direction) var g = this.options.fromPointColor,
                        l = this.options.toPointColor;
                //else g = this.options.toPointColor, l = this.options.fromPointColor;
                else g = this._key.color, l = e.color;
                if (type) {
                    g = '#000000';
                    l = '#ffffff';

                }
                h.fill = [c, g, l].join("-");
                //h.fill='none';
                return h;

            },
            _showPaths: function (a) {
                a = !1 !== a;
                var self = this;
                this._eachData(function (e) {
                    if (null != e.pathId) {
                        var b = this.paper.getById(e.pathId);
                        if (b) {
                            var h = {};
                            if ("big" == e.type) {
                                h = self.setFill(e);
                            } else {
                                h["stroke-width"] = 10, h.stroke = e.color, h["stroke-opacity"] = 0.5;
                                //h["stroke-width"] = 1, h.stroke = this.options.smallLineColor;
                            }


                            if (c = b.data("line")) {
                                this._reCalcLine(b, h, a);

                            } else {
                                c = this.paper.path().data("path", b).attr(h);
                               
                                //console.dir(this.paper.path().data("path", b));
                                if (a) {
                                    var p = this;
                                    c.attr({
                                        grow: 0
                                    });
                                    this._proxyAnimation(c, {
                                        grow: 1
                                    }, 3000, function () {		//画线时间
                                        "small" == e.type && (p._drawArrow(e), p._initSetOrder())
                                        //"big" == e.type && (p._drawArrow(e), p._initSetOrder())
                                        //console.log(self._paths[0].toString());
                                        // self.runData(e);
                                    })
                                } else c.attr({
                                    grow: 1
                                }), "big" == e.type && this._initSetOrder();
                                b.data("line", c);
                                this._lines.push(c)
                            }
                        }
                    }
                })
            },
            _currcount: -1,
            _isLoading: false,
            _checkLoadData: function () {
                var ac = 0,

                  rd = this._rundata;
                for (var i in rd) {
                    var temp = rd[i];
                    ac += temp.length;
                }
                if (ac > 0 && ac < (this._currcount + 10)) {

                    this._loadData();
                }

            },
            _loadData: function () {
                if (this._isLoading) return;
                var self = this;
                self._isLoading = true;
                $.post("/home/maphome/GetDataSourceJSON", {
                    Id: self.MaxId
                }, function (result) {
                    self._rundata = self.fdata(result["data"]);
                    self.MaxId = result["MaxId"];
                    self._isLoading = false;
                    self._eachData(function (a) {
                        if (!a.moving) {

                            self._testAnim(a);
                        }
                    });
                    //self.drawRelations(self._key, testData, "to");
                }, "json");

                //syyang 加入动态更新人员总量
                TotalCountBySetTimeOut();

            },
            runByCity: function (city, result) {

                // 点击某个港口的时候、高亮该城市的线及
                var self = this;
                var _rundata = this._rundata;
                // 做数据清理
                self.MaxId = result["MaxId"];
                self._eachData(function (a) {
                    var path = this.paper.getById(a.pathId),
                          line = path.data('line'),
                      point = this.paper.getById(a.pointId);
                    a.tween && a.tween.kill();
                    a.item && a.item.remove();
                    clearTimeout(a.imageHandler);
                    this._currcount = -1;
                    a.item && a.item.remove();
                    if (a.id == city) {
                        //
                        _rundata[a.id] = result.data[a.id] || [];
                        line.attr(self.setFill(a));
                        point.attr({ "fill": a.color });
                        a.curcount = -1;
                        self._testAnim(a);
                    } else {
                        point.attr({ "fill": "#000" });
                        _rundata[a.id] = [];
                        a.curcount = -1;
                        line.attr(self.setFill(a, true));

                    }
                });
            },
            resume: function () {

                var self = this;
                if (this._isLoading) return;
                var self = this;
                self._isLoading = true;
                $.post("/home/maphome/GetDataSourceJSON", {
                    Id: self.MaxId
                }, function (result) {
                    self._currcount = -1;
                    self._rundata = self.fdata(result["data"]);
                    self.MaxId = result["MaxId"];
                    self._isLoading = false;
                    self._eachData(function (a) {
                        var path = this.paper.getById(a.pathId),
                          line = path.data('line'),
                      point = this.paper.getById(a.pointId);


                        //self._testAnim(a);
                        point.attr({ "fill": a.color });
                        a.tween && a.tween.kill();
                        clearTimeout(a.imageHandler);
                        a.curcount = -1;
                        a.item && a.item.remove();
                        line.attr(self.setFill(a));
                        self._testAnim(a);
                    });
                    //self.drawRelations(self._key, testData, "to");
                }, "json");

                //syyang 加入动态更新人员总量
                TotalCountBySetTimeOut();

            },
            fdata: function (data) {
                var _rund = this._rundata;
                for (var i in _rund) {
                    var b = [];
                    _rund[i] = _rund[i].concat(data[i]);

                }
                return _rund;
            },
            _stopByPoint: function (a) {
                if (a.tween) {
                    a.moving = false;
                    a.tween.pause();
                }
            },
            _resumeByPoint: function (a) {
                if (a.tween) {
                    a.moving = true;
                    a.tween.resume();
                }
            },
            // 主控平台的动画效果
            _animateCenter: function () {

                var e = this.paper.getById(this._key.pointId);
                TweenMax.to(e, .2, { raphael: { r: 20 }, repeat: 1, yoyo: true, onComplete: function () {

                    e.attr({ "r": 30 });
                }
                });


            },
            _testAnim: function (a) {
                var datat = this._rundata[a.id];
                a["curcount"]++;
                this._currcount++;
                this._checkLoadData();
                if (a["curcount"] > (datat.length - 1)) return;
                a.moving = true;
                a.item && a.item.remove();
                var temp = datat[a["curcount"]]; //' + temp["Name"] + '<i class="po1"></i></dt></dl></div>
                var classType = temp["ToolType"];
                if (classType == "机场") {
                    classType = "po2";
                }
                else if (classType == "港口") {
                    classType = "po1";
                }
                else if (classType == "火车站") {
                    classType = "po3";
                }
                else {
                    classType = "po1";
                }
                var test = $('<div  class="item_person"><a href="/home/Maphome/Detail?Id=' + temp["Id"] + '" target="_blank"><div class="iperson_img"><img src="' + temp["HeadPhoto"] + '"></div></a><div class="iperson_info"><dl><dt><div style="float:left;line-height:100%;">' + temp["Name"] + '</div><i class="' + classType + '"></i></dt></dl></div> </div>').hide();
                $('#map').append(test);
                test.mouseenter(function () {
                    self._stopByPoint(a);


                });
                test.mouseleave(function () {
                    self._resumeByPoint(a);


                });
                //if(a.id==4){
                var path = this.paper.getById(a.pathId);
                var start = path.data("start"),
				end = path.data("end"),
                len = path.data("length"),
                data = path.data("data");
                var s = path.getPointAtLength(len),
				e = path.getPointAtLength(0),
				self = this;
                var position = { x: 0 };
                var th = 0, tw = 0;

                var update = function () {

                    var ep = position.x,
							point = path.getPointAtLength((1 - position.x) * len);

                    test.css({ width: tw * (1 - ep), height: th * (1 - ep), left: point.x - test.width() / 2, top: point.y - test.height() / 2 });

                    if (ep == 1) {
                        test.remove();
                        self._animateCenter();
                        a.moving = false;
                        a.imageHandler = setTimeout($.proxy(self, "_testAnim", a), 0);
                        delete tween;
                        delete update;
                        delete animate;
                        delete test;

                    }

                };
                var tween = new TweenMax(position, 6.5, { x: 1, onUpdate: update, onStart: function () {
                    test.show();
                    th = test.height();
                    tw = test.width();
                }
                });
                a.tween = tween;
                a.item = test;
            },

            _Anim: function () {

            },
            _drawArrow: function (a) {
                if (null != a.pathId) {
                    var e = this.paper.getById(a.pathId);
                    if (e) {
                        var b = this.options.arrow.path;
                        e.data("length");
                        if (a.x < this._key.x || a.provinceId == 1) {
                            b = this.paper.path(b).data("path", e).attr({
                                stroke: "none",
                                "stroke-width": 0,
                                fill: "#06adfa", //a.color,//this.options.arrow.fromColor,
                                along: 0
                            });
                        } else {
                            b = this.paper.path(b).data("path", e).attr({
                                stroke: "none",
                                "stroke-width": 0,
                                fill: "#90d90e", //a.color,//this.options.arrow.fromColor,
                                along: 0
                            });
                        }
                        e.data("arrow", b);
                        a.arrowHandler = setTimeout($.proxy(this, "_animateArrow", a), 10); //+ 2500 * Math.random()
                        this._arrows.push(b)
                    }
                }
            },
            _proxyAnimation: function (con, option, dur, callback, c) {

                var g = !Raphael.vml;
                "boolean" === typeof c && (g = c);
                g ? con.animate(option, dur, callback) : (con.attr(option), callback && callback.call(con, con))
            },
            drawRelations: function (center, relate, dir) {
                this._direction = dir;
                this._type = "relations";
                this.clearPaper();
                center && "number" == typeof center.id && (this._calcData(relate,
            center), this._eachData(function (cen) {
                this._drawPoint(cen)
            }), this._drawPoint(this._key, this._drawLines), this._initSetOrder())
            },
            _drawPaths: function () {

                this._eachData(function (point) {
                    if (null != point.pointId) {
                        var e = this.paper.getById(point.pointId);
                        e && (e.data("path") || this._drawPath(point))
                    }
                });
            },
            _drawPath: function (point) {
                var len = this._calcLength(this._key,
				point, 0.2),
				s = this._key, //1
				d = point,
				s1 = this._key1, //2
				s2 = this._key2, //6
				s3 = this._key3, //3
				s4 = this._key4, //4
				s5 = this._key5, //5
				cp = this._calcControlPoint(this._key, point, len),
				fdir = "from" == this._direction ? this._key : point,
				tdir = "from" == this._direction ? point : this._key;
                //pstr = "M" +s.x + "," + s.y + "Q" + cp.x + "," + cp.y + " " + d.x + "," + d.y,
                //pstr="M" +s.x + "," + s.y + "C"+ s.x + "," + s.y+","+ (s.x+30)+","+(d.y+30)+","+d.x + "," + d.y,
                var pstr;
                if (d.id == "44") {
                    if (d.provinceId == 1) {
                        pstr = "M" + s3.x + "," + s3.y + "L" + d.x + "," + d.y;
                    } else {
                        pstr = "M" + d.x + "," + d.y + "L" + s4.x + "," + s4.y;
                    }
                } else {
                    if (s.x < d.x) {
                        if (d.y < s.y)
                            pstr = "M" + d.x + "," + d.y + "L" + (s2.x + 20) + "," + d.y + "C" + (s2.x + 20) + "," + d.y + "," + (s2.x + 2) + "," + (d.y + 2) + "," + s2.x + "," + (d.y + 20) + "L" + s2.x + "," + s2.y + "L" + s5.x + "," + s5.y;
                        else {
                            pstr = "M" + d.x + "," + d.y + "L" + (s2.x + 20) + "," + d.y + "C" + (s2.x + 20) + "," + d.y + "," + (s2.x - 2) + "," + (d.y - 2) + "," + s2.x + "," + (d.y - 20) + "L" + s2.x + "," + s2.y + "L" + (s5.x-5) + "," + s5.y;
                        }
                    } else {
                        if (d.y < s.y)
                            pstr = "M" + s1.x + "," + s1.y + "L" + s.x + "," + s.y + "L" + s.x + "," + (d.y + 20) + "C" + s.x + "," + (d.y + 20) + "," + (s.x + 2) + "," + (d.y + 2) + "," + (s.x - 20) + "," + d.y + "L" + d.x + "," + d.y;
                        else {
                            pstr = "M" + s1.x + "," + s1.y + "L" + s.x + "," + s.y + "L" + s.x + "," + (d.y - 20) + "C" + s.x + "," + (d.y - 20) + "," + (s.x - 2) + "," + (d.y - 2) + "," + (s.x - 20) + "," + d.y + "L" + d.x + "," + d.y;
                        }
                    }
                }
                pa = this.paper.path(pstr).attr({
                    stroke: "#ccc",
                    "stroke-opacity": 0.5,
                    "stroke-width": 0
                });
                pa.data({
                    data: point,
                    start: fdir,
                    end: tdir,
                    pstr: pstr,
                    length: pa.getTotalLength() + point.r
                });
                null != point.pointId && (fdir = this.paper.getById(point.pointId)) && fdir.data("path", pa);
                point.pathId = pa.id;

                this._paths.push(pa)
            },
            _drawLines: function (point) {
                this._drawPaths();
                this._showPaths(point);
                this._initSetOrder()
            },
            _calcLength: function (a, e, b) {
                b || (b = 1);
                var h = e.x - a.x;
                a = e.y - a.y;
                return Math.sqrt(h * h + a * a) * b
            },
            _calcLineDegree: function (a, e) {
                if (a.x === e.x) return 180 - 90 * this.sign(e.y - a.y);
                var b = this.radianToDegree(Math.atan((e.y - a.y) / (e.x - a.x)));
                0 > e.x - a.x ? b += 180 : 0 > e.y - a.y && (b += 360);
                return 360 - b
            },
            radianToDegree: function (a) {
                return 180 * a / Math.PI
            },
            _calcMovedPath: function (a, e) {
                Raphael.parsePathString(a);
                var b = Raphael.getPointAtLength(a, 0),
            h = Raphael.getPointAtLength(a, Raphael.getTotalLength(a)),
            c = this._calcMiddlePoint(b, h),
            b = this._calcVerticalPoint(b, h, -e);
                return Raphael.transformPath(a, "t" + (b.x - c.x) + "," + (b.y - c.y))
            },
            _calcVerticalPoint: function (a, e, b) {
                var h = this._calcMiddlePoint(a, e),
            c = {};
                if (a.y === e.y) c.x = h.x;
                else {
                    a = (a.x - e.x) / (a.y - e.y);
                    var g = -Math.atan(Math.abs(a));
                    e = b * Math.cos(g);
                    b *= Math.sin(g);
                    0 > a && (e = -e);
                    c.x = h.x + e
                }
                c.y = h.y + b;
                return c
            },
            _reversePath: function (a) {
                var e = ["L", a[a.length - 1][a[a.length - 1].length - 2], ",", a[a.length - 1][a[a.length - 1].length - 1], " C"];
                a[a.length - 1].pop();
                a[a.length - 1].pop();
                for (var b = a.length - 1; 0 <= b; b--)
                    for (var h =
                a[b].length - 1; 0 < h; h -= 2) e.push(a[b][h - 1]), e.push(","), e.push(a[b][h]), e.push(" ");
                e.pop();
                return e.join("")
            },
            _animateArrow: function (a) {
                var at = this;
                if (null != a.pathId) {
                    var e = this.paper.getById(a.pathId);
                    if (e) {
                        var b = this,
                    h = e.data("length"),
                    c = e.data("arrow");
                    c.attr("transform","matrix(0.04382097,0,0,0.01754386,-3.992866,-6.714126)");
                        c && c.animate({
                            along: 1,
                            //fill: a.color//this.options.arrow.toColor
                        }, 4500, function () {   //25 * h
                            if (a.x < at._key.x || a.provinceId == 1) {
                                c.attr({
                                    along: 0,
                                    fill: "#06adfa"//a.color//b.options.arrow.fromColor
                                });
                            } else {
                                c.attr({
                                    along: 0,
                                    fill: "#90d90e"//a.color//b.options.arrow.fromColor
                                });
                            }
                            a.arrowHandler = setTimeout($.proxy(b, "_animateArrow", a), 20);
                        })
                    }
                }
            },
            _initPaper: function () {
                var a = this;
                this.paper.customAttributes.grow = function (e) {
                    if (a._key) {
                        var b = this.data("path");
                        if (b) {
                            var h = b.data("length"),
                        c = b.data("data"),
                        g = h - a._key.r - c.r;

                            if ("from" == a._direction) {
                                var h = a._key.r,
						 l = h + e * g;
                            } else {
                                l = h - c.r, h = l - e * g;
                            }
                            if (!(h >= l)) {
                                return e = b.getSubpath(h, l), "big" == c.type && (e = a._calcMovedPath(e, -1), c = a._calcMovedPath(e, 2), c = a._reversePath(c), e = e + c + "z"), {
                                    path: e
                                }
                            }
                        }
                    }
                };
                this.paper.customAttributes.along = function (e) {
                    if (a._key) {
                        var b = this.data("path");
                        if (b) {
                            var h = b.data("start"),
                        c = b.data("end"),
                        g = b.data("length"),
                        l = b.data("data"),
                        p = b.getPointAtLength("from" == a._direction ? e * g : (1 - e) * g),
                        n = "from" == a._direction ? l.r : a._key.r,
                        l = ("to" == a._direction ? l.r : a._key.r) / g,
                        q = Math.min(l + 0.1, 0.5),
                        n = 1 - n / g,
                        v = Math.max(n -
                            0.2, 0.5),
                        g = p.alpha % 360;
                            if (("to" == a._direction && h.x > c.x || "from" == a._direction && h.x < c.x) && 90 < b.getPointAtLength(0).alpha % 360 && 90 < g) g -= 180;
                            "from" == a._direction && (g += 180);
                            e <= l ? e = 0 : e > l && e < q ? e = Math.sqrt((e - l) / (q - l)) : e < n && e > v ? (e = (e - v) / (n - v), e = 1 - e * e) : e = e >= n ? 0 : 1;
                            return {
                                transform: "t" + [p.x, p.y] + "r" + g + "s" + e,
                                opacity: e
                            }
                        }
                    }
                }
            },
            _drawArrows: function () {
            }

        };
