Вход Регистрация
Файл: CloudBox-main/CloudBox/admin_assets/js/jvectormap/jquery-jvectormap-1.2.2.min.js
Строк: 1655
<?php
/**
 * jVectorMap version 1.2.2
 *
 * Copyright 2011-2013, Kirill Lebedev
 * Licensed under the MIT license.
 *
 */
(function (e) {
    var 
= {set: {colors1values1backgroundColor1scaleColors1normalizeFunction1focus1}, get: {selectedRegions1selectedMarkers1mapObject1regionName1}};
    
e.fn.vectorMap = function (e) {
        var 
nrithis.children(".jvectormap-container").data("mapObject");
        if (
=== "addMap")jvm.WorldMap.maps[arguments[1]] = arguments[2]; else {
            if (!(
!== "set" && !== "get" || !t[e][arguments[1]]))return arguments[1].charAt(0).toUpperCase() + arguments[1].substr(1), n[r].apply(n, Array.prototype.slice.call(arguments2));
            
|| {}, e.container this= new jvm.WorldMap(e)
        }
        return 
this
    
}
})(
jQuery), function (e) {
    function 
r(t) {
        var 
|| window.event= [].slice.call(arguments1), 0= !000;
        return 
e.event.fix(n), t.type "mousewheel"n.wheelDelta && (n.wheelDelta 120), n.detail && (= -n.detail 3), in.axis !== undefined && n.axis === n.HORIZONTAL_AXIS && (0= -i), n.wheelDeltaY !== undefined && (n.wheelDeltaY 120), n.wheelDeltaX !== undefined && (= -n.wheelDeltaX 120), r.unshift(tiou), (e.event.dispatch || e.event.handle).apply(thisr)
    }

    var 
= ["DOMMouseScroll""mousewheel"];
    if (
e.event.fixHooks)for (var t.lengthn;)e.event.fixHooks[t[--n]] = e.event.mouseHooks;
    
e.event.special.mousewheel = {setup: function () {
        if (
this.addEventListener)for (var t.lengthe;)this.addEventListener(t[--e], r, !1); else this.onmousewheel r
    
}, teardown: function () {
        if (
this.removeEventListener)for (var t.lengthe;)this.removeEventListener(t[--e], r, !1); else this.onmousewheel null
    
}}, e.fn.extend({mousewheel: function (e) {
        return 
this.bind("mousewheel"e) : this.trigger("mousewheel")
    }, 
unmousewheel: function (e) {
        return 
this.unbind("mousewheel"e)
    }})
}(
jQuery);
var 
jvm = {inherits: function (et) {
    function 
n() {
    }

    
n.prototype t.prototypee.prototype = new ne.prototype.constructor ee.parentClass t
}, mixin: function (et) {
    var 
n;
    for (
n in t.prototype)t.prototype.hasOwnProperty(n) && (e.prototype[n] = t.prototype[n])
}, 
min: function (e) {
    var 
Number.MAX_VALUEn;
    if (
instanceof Array)for (0e.lengthn++)e[n] < && (e[n]); else for (n in e)e[n] < && (e[n]);
    return 
t
}, max: function (e) {
    var 
Number.MIN_VALUEn;
    if (
instanceof Array)for (0e.lengthn++)e[n] > && (e[n]); else for (n in e)e[n] > && (e[n]);
    return 
t
}, keys: function (e) {
    var 
= [], n;
    for (
n in e)t.push(n);
    return 
t
}, values: function (e) {
    var 
= [], nr;
    for (
0arguments.lengthr++) {
        
arguments[r];
        for (
n in e)t.push(e[n])
    }
    return 
t
}};
jvm.$ = jQueryjvm.AbstractElement = function (et) {
    
this.node this.createElement(e), this.name ethis.properties = {}, && this.set(t)
}, 
jvm.AbstractElement.prototype.set = function (et) {
    var 
n;
    if (
typeof e == "object")for (n in e)this.properties[n] = e[n], this.applyAttr(ne[n]); else this.properties[e] = tthis.applyAttr(et)
}, 
jvm.AbstractElement.prototype.get = function (e) {
    return 
this.properties[e]
}, 
jvm.AbstractElement.prototype.applyAttr = function (et) {
    
this.node.setAttribute(et)
}, 
jvm.AbstractElement.prototype.remove = function () {
    
jvm.$(this.node).remove()
}, 
jvm.AbstractCanvasElement = function (etn) {
    
this.container ethis.setSize(tn), this.rootElement = new jvm[this.classPrefix "GroupElement"], this.node.appendChild(this.rootElement.node), this.container.appendChild(this.node)
}, 
jvm.AbstractCanvasElement.prototype.add = function (et) {
    
|| this.rootElementt.add(e), e.canvas this
}, jvm.AbstractCanvasElement.prototype.addPath = function (etn) {
    var 
= new jvm[this.classPrefix "PathElement"](et);
    return 
this.add(rn), r
}, jvm.AbstractCanvasElement.prototype.addCircle = function (etn) {
    var 
= new jvm[this.classPrefix "CircleElement"](et);
    return 
this.add(rn), r
}, jvm.AbstractCanvasElement.prototype.addGroup = function (e) {
    var 
= new jvm[this.classPrefix "GroupElement"];
    return 
e.node.appendChild(t.node) : this.node.appendChild(t.node), t.canvas thist
}, jvm.AbstractShapeElement = function (etn) {
    
this.style || {}, this.style.current = {}, this.isHovered = !1this.isSelected = !1this.updateStyle()
}, 
jvm.AbstractShapeElement.prototype.setHovered = function (e) {
    
this.isHovered !== && (this.isHovered ethis.updateStyle())
}, 
jvm.AbstractShapeElement.prototype.setSelected = function (e) {
    
this.isSelected !== && (this.isSelected ethis.updateStyle(), jvm.$(this.node).trigger("selected", [e]))
}, 
jvm.AbstractShapeElement.prototype.setStyle = function (et) {
    var 
= {};
    
typeof e == "object" n[e] = tjvm.$.extend(this.style.currentn), this.updateStyle()
}, 
jvm.AbstractShapeElement.prototype.updateStyle = function () {
    var 
= {};
    
jvm.AbstractShapeElement.mergeStyles(ethis.style.initial), jvm.AbstractShapeElement.mergeStyles(ethis.style.current), this.isHovered && jvm.AbstractShapeElement.mergeStyles(ethis.style.hover), this.isSelected && (jvm.AbstractShapeElement.mergeStyles(ethis.style.selected), this.isHovered && jvm.AbstractShapeElement.mergeStyles(ethis.style.selectedHover)), this.set(e)
}, 
jvm.AbstractShapeElement.mergeStyles = function (et) {
    var 
n;
    
|| {};
    for (
n in t)t[n] === null delete e[n] : e[n] = t[n]
}, 
jvm.SVGElement = function (et) {
    
jvm.SVGElement.parentClass.apply(thisarguments)
}, 
jvm.inherits(jvm.SVGElementjvm.AbstractElement), jvm.SVGElement.svgns "http://www.w3.org/2000/svg"jvm.SVGElement.prototype.createElement = function (e) {
    return 
document.createElementNS(jvm.SVGElement.svgnse)
}, 
jvm.SVGElement.prototype.addClass = function (e) {
    
this.node.setAttribute("class"e)
}, 
jvm.SVGElement.prototype.getElementCtr = function (e) {
    return 
jvm["SVG" e]
}, 
jvm.SVGElement.prototype.getBBox = function () {
    return 
this.node.getBBox()
}, 
jvm.SVGGroupElement = function () {
    
jvm.SVGGroupElement.parentClass.call(this"g")
}, 
jvm.inherits(jvm.SVGGroupElementjvm.SVGElement), jvm.SVGGroupElement.prototype.add = function (e) {
    
this.node.appendChild(e.node)
}, 
jvm.SVGCanvasElement = function (etn) {
    
this.classPrefix "SVG"jvm.SVGCanvasElement.parentClass.call(this"svg"), jvm.AbstractCanvasElement.apply(thisarguments)
}, 
jvm.inherits(jvm.SVGCanvasElementjvm.SVGElement), jvm.mixin(jvm.SVGCanvasElementjvm.AbstractCanvasElement), jvm.SVGCanvasElement.prototype.setSize = function (et) {
    
this.width ethis.height tthis.node.setAttribute("width"e), this.node.setAttribute("height"t)
}, 
jvm.SVGCanvasElement.prototype.applyTransformParams = function (etn) {
    
this.scale ethis.transX tthis.transY nthis.rootElement.node.setAttribute("transform""scale(" ") translate(" ", " ")")
}, 
jvm.SVGShapeElement = function (etn) {
    
jvm.SVGShapeElement.parentClass.call(thiset), jvm.AbstractShapeElement.apply(thisarguments)
}, 
jvm.inherits(jvm.SVGShapeElementjvm.SVGElement), jvm.mixin(jvm.SVGShapeElementjvm.AbstractShapeElement), jvm.SVGPathElement = function (et) {
    
jvm.SVGPathElement.parentClass.call(this"path"et), this.node.setAttribute("fill-rule""evenodd")
}, 
jvm.inherits(jvm.SVGPathElementjvm.SVGShapeElement), jvm.SVGCircleElement = function (et) {
    
jvm.SVGCircleElement.parentClass.call(this"circle"et)
}, 
jvm.inherits(jvm.SVGCircleElementjvm.SVGShapeElement), jvm.VMLElement = function (et) {
    
jvm.VMLElement.VMLInitialized || jvm.VMLElement.initializeVML(), jvm.VMLElement.parentClass.apply(thisarguments)
}, 
jvm.inherits(jvm.VMLElementjvm.AbstractElement), jvm.VMLElement.VMLInitialized = !1jvm.VMLElement.initializeVML = function () {
    try {
        
document.namespaces.rvml || document.namespaces.add("rvml""urn:schemas-microsoft-com:vml"), jvm.VMLElement.prototype.createElement = function (e) {
            return 
document.createElement("<rvml:" ' class="rvml">')
        }
    } catch (
e) {
        
jvm.VMLElement.prototype.createElement = function (e) {
            return 
document.createElement("<" ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')
        }
    }
    
document.createStyleSheet().addRule(".rvml""behavior:url(#default#VML)"), jvm.VMLElement.VMLInitialized = !0
}, jvm.VMLElement.prototype.getElementCtr = function (e) {
    return 
jvm["VML" e]
}, 
jvm.VMLElement.prototype.addClass = function (e) {
    
jvm.$(this.node).addClass(e)
}, 
jvm.VMLElement.prototype.applyAttr = function (et) {
    
this.node[e] = t
}, jvm.VMLElement.prototype.getBBox = function () {
    var 
jvm.$(this.node);
    return{
xe.position().left this.canvas.scaleye.position().top this.canvas.scalewidthe.width() / this.canvas.scaleheighte.height() / this.canvas.scale}
}, 
jvm.VMLGroupElement = function () {
    
jvm.VMLGroupElement.parentClass.call(this"group"), this.node.style.left "0px"this.node.style.top "0px"this.node.coordorigin "0 0"
}, jvm.inherits(jvm.VMLGroupElementjvm.VMLElement), jvm.VMLGroupElement.prototype.add = function (e) {
    
this.node.appendChild(e.node)
}, 
jvm.VMLCanvasElement = function (etn) {
    
this.classPrefix "VML"jvm.VMLCanvasElement.parentClass.call(this"group"), jvm.AbstractCanvasElement.apply(thisarguments), this.node.style.position "absolute"
}, jvm.inherits(jvm.VMLCanvasElementjvm.VMLElement), jvm.mixin(jvm.VMLCanvasElementjvm.AbstractCanvasElement), jvm.VMLCanvasElement.prototype.setSize = function (et) {
    var 
nris;
    
this.width ethis.height tthis.node.style.width "px"this.node.style.height "px"this.node.coordsize " " tthis.node.coordorigin "0 0";
    if (
this.rootElement) {
        
this.rootElement.node.getElementsByTagName("shape");
        for (
0n.lengthsi++)n[i].coordsize " " tn[i].style.width "px"n[i].style.height "px";
        
this.node.getElementsByTagName("group");
        for (
0r.lengthsi++)r[i].coordsize " " tr[i].style.width "px"r[i].style.height "px"
    
}
}, 
jvm.VMLCanvasElement.prototype.applyTransformParams = function (etn) {
    
this.scale ethis.transX tthis.transY nthis.rootElement.node.coordorigin this.width this.width 100 "," + (this.height this.height 100), this.rootElement.node.coordsize this.width "," this.height e
}, jvm.VMLShapeElement = function (et) {
    
jvm.VMLShapeElement.parentClass.call(thiset), this.fillElement = new jvm.VMLElement("fill"), this.strokeElement = new jvm.VMLElement("stroke"), this.node.appendChild(this.fillElement.node), this.node.appendChild(this.strokeElement.node), this.node.stroked = !1jvm.AbstractShapeElement.apply(thisarguments)
}, 
jvm.inherits(jvm.VMLShapeElementjvm.VMLElement), jvm.mixin(jvm.VMLShapeElementjvm.AbstractShapeElement), jvm.VMLShapeElement.prototype.applyAttr = function (et) {
    switch (
e) {
        case
"fill":
            
this.node.fillcolor t;
            break;
        case
"fill-opacity":
            
this.fillElement.node.opacity Math.round(100) + "%";
            break;
        case
"stroke":
            
=== "none" this.node.stroked = !this.node.stroked = !0this.node.strokecolor t;
            break;
        case
"stroke-opacity":
            
this.strokeElement.node.opacity Math.round(100) + "%";
            break;
        case
"stroke-width":
            
parseInt(t10) === this.node.stroked = !this.node.stroked = !0this.node.strokeweight t;
            break;
        case
"d":
            
this.node.path jvm.VMLPathElement.pathSvgToVml(t);
            break;
        default:
            
jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(thisarguments)
    }
}, 
jvm.VMLPathElement = function (et) {
    var 
= new jvm.VMLElement("skew");
    
jvm.VMLPathElement.parentClass.call(this"shape"et), this.node.coordorigin "0 0"n.node.on = !0n.node.matrix "0.01,0,0,0.01,0,0"n.node.offset "0,0"this.node.appendChild(n.node)
}, 
jvm.inherits(jvm.VMLPathElementjvm.VMLShapeElement), jvm.VMLPathElement.prototype.applyAttr = function (et) {
    
=== "d" this.node.path jvm.VMLPathElement.pathSvgToVml(t) : jvm.VMLShapeElement.prototype.applyAttr.call(thiset)
}, 
jvm.VMLPathElement.pathSvgToVml = function (e) {
    var 
""00is;
    return 
e.replace(/(-?d+)e(-?d+)/g"0"), e.replace(/([MmLlHhVvCcSs])s*((?:-?d*(?:.d+)?s*,?s*)+)/g,function (etou) {
        
o.replace(/(d)-/g"$1,-").replace(/^s+/g"").replace(/s+$/g"").replace(/s+/g",").split(","), o[0] || o.shift();
        for (var 
0o.lengthfa++)o[a] = Math.round(100 o[a]);
        switch (
t) {
            case
"m":
                return 
+= o[0], += o[1], "t" o.join(",");
            case
"M":
                return 
o[0], o[1], "m" o.join(",");
            case
"l":
                return 
+= o[0], += o[1], "r" o.join(",");
            case
"L":
                return 
o[0], o[1], "l" o.join(",");
            case
"h":
                return 
+= o[0], "r" o[0] + ",0";
            case
"H":
                return 
o[0], "l" "," r;
            case
"v":
                return 
+= o[0], "r0," o[0];
            case
"V":
                return 
o[0], "l" "," r;
            case
"c":
                return 
o[o.length 4], o[o.length 3], += o[o.length 2], += o[o.length 1], "v" o.join(",");
            case
"C":
                return 
o[o.length 4], o[o.length 3], o[o.length 2], o[o.length 1], "c" o.join(",");
            case
"s":
                return 
o.unshift(s), o.unshift(i), o[o.length 4], o[o.length 3], += o[o.length 2], += o[o.length 1], "v" o.join(",");
            case
"S":
                return 
o.unshift(s), o.unshift(i), o[o.length 4], o[o.length 3], o[o.length 2], o[o.length 1], "c" o.join(",")
        }
        return
""
    
}).replace(/z/g"e")
}, 
jvm.VMLCircleElement = function (et) {
    
jvm.VMLCircleElement.parentClass.call(this"oval"et)
}, 
jvm.inherits(jvm.VMLCircleElementjvm.VMLShapeElement), jvm.VMLCircleElement.prototype.applyAttr = function (et) {
    switch (
e) {
        case
"r":
            
this.node.style.width "px"this.node.style.height "px"this.applyAttr("cx"this.get("cx") || 0), this.applyAttr("cy"this.get("cy") || 0);
            break;
        case
"cx":
            if (!
t)return;
            
this.node.style.left - (this.get("r") || 0) + "px";
            break;
        case
"cy":
            if (!
t)return;
            
this.node.style.top - (this.get("r") || 0) + "px";
            break;
        default:
            
jvm.VMLCircleElement.parentClass.prototype.applyAttr.call(thiset)
    }
}, 
jvm.VectorCanvas = function (etn) {
    return 
this.mode window.SVGAngle "svg" "vml"this.mode == "svg" this.impl = new jvm.SVGCanvasElement(etn) : this.impl = new jvm.VMLCanvasElement(etn), this.impl
}, jvm.SimpleScale = function (e) {
    
this.scale e
}, jvm.SimpleScale.prototype.getValue = function (e) {
    return 
e
}, jvm.OrdinalScale = function (e) {
    
this.scale e
}, jvm.OrdinalScale.prototype.getValue = function (e) {
    return 
this.scale[e]
}, 
jvm.NumericScale = function (etnr) {
    
this.scale = [], || "linear"&& this.setScale(e), && this.setNormalizeFunction(t), && this.setMin(n), && this.setMax(r)
}, 
jvm.NumericScale.prototype = {setMin: function (e) {
    
this.clearMinValue etypeof this.normalize == "function" this.minValue this.normalize(e) : this.minValue e
}, setMax: function (e) {
    
this.clearMaxValue etypeof this.normalize == "function" this.maxValue this.normalize(e) : this.maxValue e
}, setScale: function (e) {
    var 
t;
    for (
0e.lengtht++)this.scale[t] = [e[t]]
}, 
setNormalizeFunction: function (e) {
    
=== "polynomial" this.normalize = function (e) {
        return 
Math.pow(e.2)
    } : 
=== "linear" delete this.normalize this.normalize ethis.setMin(this.clearMinValue), this.setMax(this.clearMaxValue)
}, 
getValue: function (e) {
    var 
= [], 0r0s;
    
typeof this.normalize == "function" && (this.normalize(e));
    for (
0this.scale.length 1i++)this.vectorLength(this.vectorSubtract(this.scale[1], this.scale[i])), t.push(r), += r;
    
= (this.maxValue this.minValue) / n;
    for (
0t.lengthi++)t[i] *= s;
    
0-= this.minValue;
    while (
t[i] >= 0)-= t[i], i++;
    return 
== this.scale.length this.vectorToNum(this.scale[i]) : this.vectorToNum(this.vectorAdd(this.scale[i], this.vectorMult(this.vectorSubtract(this.scale[1], this.scale[i]), t[i]))), e
}, vectorToNum: function (e) {
    var 
0n;
    for (
0e.lengthn++)+= Math.round(e[n]) * Math.pow(256e.length 1);
    return 
t
}, vectorSubtract: function (et) {
    var 
= [], r;
    for (
0e.lengthr++)n[r] = e[r] - t[r];
    return 
n
}, vectorAdd: function (et) {
    var 
= [], r;
    for (
0e.lengthr++)n[r] = e[r] + t[r];
    return 
n
}, vectorMult: function (et) {
    var 
= [], r;
    for (
0e.lengthr++)n[r] = e[r] * t;
    return 
n
}, vectorLength: function (e) {
    var 
0n;
    for (
0e.lengthn++)+= e[n] * e[n];
    return 
Math.sqrt(t)
}}, 
jvm.ColorScale = function (etnr) {
    
jvm.ColorScale.parentClass.apply(thisarguments)
}, 
jvm.inherits(jvm.ColorScalejvm.NumericScale), jvm.ColorScale.prototype.setScale = function (e) {
    var 
t;
    for (
0e.lengtht++)this.scale[t] = jvm.ColorScale.rgbToArray(e[t])
}, 
jvm.ColorScale.prototype.getValue = function (e) {
    return 
jvm.ColorScale.numToRgb(jvm.ColorScale.parentClass.prototype.getValue.call(thise))
}, 
jvm.ColorScale.arrayToRgb = function (e) {
    var 
"#"nr;
    for (
0e.lengthr++)e[r].toString(16), += n.length == "0" n;
    return 
t
}, jvm.ColorScale.numToRgb = function (e) {
    
e.toString(16);
    while (
e.length 6)"0" e;
    return
"#" e
}, jvm.ColorScale.rgbToArray = function (e) {
    return 
e.substr(1), [parseInt(e.substr(02), 16), parseInt(e.substr(22), 16), parseInt(e.substr(42), 16)]
}, 
jvm.DataSeries = function (et) {
    var 
n;
    
|| {}, e.attribute e.attribute || "fill"this.elements tthis.params ee.attributes && this.setAttributes(e.attributes), jvm.$.isArray(e.scale) ? (e.attribute === "fill" || e.attribute === "stroke" jvm.ColorScale jvm.NumericScalethis.scale = new n(e.scalee.normalizeFunctione.mine.max)) : e.scale this.scale = new jvm.OrdinalScale(e.scale) : this.scale = new jvm.SimpleScale(e.scale), this.values e.values || {}, this.setValues(this.values)
}, 
jvm.DataSeries.prototype = {setAttributes: function (et) {
    var 
er;
    if (
typeof e == "string")this.elements[e] && this.elements[e].setStyle(this.params.attributet); else for (r in n)this.elements[r] && this.elements[r].element.setStyle(this.params.attributen[r])
}, 
setValues: function (e) {
    var 
Number.MIN_VALUENumber.MAX_VALUEri= {};
    if (
this.scale instanceof jvm.OrdinalScale || this.scale instanceof jvm.SimpleScale)for (i in e)e[i] ? s[i] = this.scale.getValue(e[i]) : s[i] = this.elements[i].element.style.initial[this.params.attribute]; else {
        if (!
this.params.min || !this.params.max) {
            for (
i in e)parseFloat(e[i]), && (e[i]), && (r);
            
this.params.min || this.scale.setMin(n), this.params.max || this.scale.setMax(t), this.params.min nthis.params.max t
        
}
        for (
i in e)parseFloat(e[i]), isNaN(r) ? s[i] = this.elements[i].element.style.initial[this.params.attribute] : s[i] = this.scale.getValue(r)
    }
    
this.setAttributes(s), jvm.$.extend(this.valuese)
}, 
clear: function () {
    var 
e= {};
    for (
e in this.values)this.elements[e] && (t[e] = this.elements[e].element.style.initial[this.params.attribute]);
    
this.setAttributes(t), this.values = {}
}, 
setScale: function (e) {
    
this.scale.setScale(e), this.values && this.setValues(this.values)
}, 
setNormalizeFunction: function (e) {
    
this.scale.setNormalizeFunction(e), this.values && this.setValues(this.values)
}}, 
jvm.Proj = {degRad180 Math.PIradDegMath.PI 180radius6381372sgn: function (e) {
    return 
? -e
}, mill: function (etn) {
    return{
xthis.radius * (n) * this.radDegy: -this.radius Math.log(Math.tan((45 .4 e) * this.radDeg)) / .8}
}, 
mill_inv: function (etn) {
    return{
lat: (2.5 Math.atan(Math.exp(.8 this.radius)) - Math.PI 8) * this.degRadlng: (this.radDeg this.radius) * this.degRad}
}, 
merc: function (etn) {
    return{
xthis.radius * (n) * this.radDegy: -this.radius Math.log(Math.tan(Math.PI Math.PI 360))}
}, 
merc_inv: function (etn) {
    return{
lat: (Math.atan(Math.exp(this.radius)) - Math.PI 2) * this.degRadlng: (this.radDeg this.radius) * this.degRad}
}, 
aea: function (etn) {
    var 
0this.radDeg29.5 this.radDeg45.5 this.radDegthis.radDegthis.radDeg= (Math.sin(s) + Math.sin(o)) / 2Math.cos(s) * Math.cos(s) + Math.sin(s), * (i), Math.sqrt(Math.sin(u)) / fMath.sqrt(Math.sin(r)) / f;
    return{
xMath.sin(c) * this.radiusy: -(Math.cos(c)) * this.radius}
}, 
aea_inv: function (etn) {
    var 
this.radiusthis.radius0this.radDeg29.5 this.radDeg45.5 this.radDeg= (Math.sin(u) + Math.sin(a)) / 2Math.cos(u) * Math.cos(u) + Math.sin(u), Math.sqrt(Math.sin(s)) / fMath.sqrt(+ (i) * (i)), Math.atan(/ (i));
    return{
latMath.asin((f) / (f)) * this.degRadlng: (f) * this.degRad}
}, 
lcc: function (etn) {
    var 
0this.radDegthis.radDeg33 this.radDeg45 this.radDegthis.radDegMath.log(Math.cos(o) * (Math.cos(u))) / Math.log(Math.tan(Math.PI 2) * (Math.tan(Math.PI 2))), Math.cos(o) * Math.pow(Math.tan(Math.PI 2), f) / fMath.pow(Math.tan(Math.PI 2), f), Math.pow(Math.tan(Math.PI 2), f);
    return{
xMath.sin(* (i)) * this.radiusy: -(Math.cos(* (i))) * this.radius}
}, 
lcc_inv: function (etn) {
    var 
this.radiusthis.radius0this.radDeg33 this.radDeg45 this.radDegMath.log(Math.cos(u) * (Math.cos(a))) / Math.log(Math.tan(Math.PI 2) * (Math.tan(Math.PI 2))), Math.cos(u) * Math.pow(Math.tan(Math.PI 2), f) / fMath.pow(Math.tan(Math.PI 2), f), this.sgn(f) * Math.sqrt(+ (i) * (i)), Math.atan(/ (i));
    return{
lat: (Math.atan(Math.pow(hf)) - Math.PI 2) * this.degRadlng: (f) * this.degRad}
}}, 
jvm.WorldMap = function (e) {
    var 
thisn;
    
this.params jvm.$.extend(!0, {}, jvm.WorldMap.defaultParamse);
    if (!
jvm.WorldMap.maps[this.params.map])throw new Error("Attempt to use map which was not loaded: " this.params.map);
    
this.mapData jvm.WorldMap.maps[this.params.map], this.markers = {}, this.regions = {}, this.regionsColors = {}, this.regionsData = {}, this.container jvm.$("<div>").css({width"100%"height"100%"}).addClass("jvectormap-container"), this.params.container.append(this.container), this.container.data("mapObject"this), this.container.css({position"relative"overflow"hidden"}), this.defaultWidth this.mapData.widththis.defaultHeight this.mapData.heightthis.setBackgroundColor(this.params.backgroundColor), this.onResize = function () {
        
t.setSize()
    }, 
jvm.$(window).resize(this.onResize);
    for (
n in jvm.WorldMap.apiEvents)this.params[n] && this.container.bind(jvm.WorldMap.apiEvents[n] + ".jvectormap"this.params[n]);
    
this.canvas = new jvm.VectorCanvas(this.container[0], this.widththis.height), "ontouchstart"in window || window.DocumentTouch && document instanceof DocumentTouch this.params.bindTouchEvents && this.bindContainerTouchEvents() : this.bindContainerEvents(), this.bindElementEvents(), this.createLabel(), this.params.zoomButtons && this.bindZoomButtons(), this.createRegions(), this.createMarkers(this.params.markers || {}), this.setSize(), this.params.focusOn && (typeof this.params.focusOn == "object" this.setFocus.call(thisthis.params.focusOn.scalethis.params.focusOn.xthis.params.focusOn.y) : this.setFocus.call(thisthis.params.focusOn)), this.params.selectedRegions && this.setSelectedRegions(this.params.selectedRegions), this.params.selectedMarkers && this.setSelectedMarkers(this.params.selectedMarkers), this.params.series && this.createSeries()
}, 
jvm.WorldMap.prototype = {transX0transY0scale1baseTransX0baseTransY0baseScale1width0height0setBackgroundColor: function (e) {
    
this.container.css("background-color"e)
}, 
resize: function () {
    var 
this.baseScale;
    
this.width this.height this.defaultWidth this.defaultHeight ? (this.baseScale this.height this.defaultHeightthis.baseTransX Math.abs(this.width this.defaultWidth this.baseScale) / (this.baseScale)) : (this.baseScale this.width this.defaultWidththis.baseTransY Math.abs(this.height this.defaultHeight this.baseScale) / (this.baseScale)), this.scale *= this.baseScale ethis.transX *= this.baseScale ethis.transY *= this.baseScale e
}, setSize: function () {
    
this.width this.container.width(), this.height this.container.height(), this.resize(), this.canvas.setSize(this.widththis.height), this.applyTransform()
}, 
reset: function () {
    var 
et;
    for (
e in this.series)for (0this.series[e].lengtht++)this.series[e][t].clear();
    
this.scale this.baseScalethis.transX this.baseTransXthis.transY this.baseTransYthis.applyTransform()
}, 
applyTransform: function () {
    var 
etnr;
    
this.defaultWidth this.scale <= this.width ? (= (this.width this.defaultWidth this.scale) / (this.scale), = (this.width this.defaultWidth this.scale) / (this.scale)) : (0= (this.width this.defaultWidth this.scale) / this.scale), this.defaultHeight this.scale <= this.height ? (= (this.height this.defaultHeight this.scale) / (this.scale), = (this.height this.defaultHeight this.scale) / (this.scale)) : (0= (this.height this.defaultHeight this.scale) / this.scale), this.transY this.transY this.transY && (this.transY r), this.transX this.transX this.transX && (this.transX n), this.canvas.applyTransformParams(this.scalethis.transXthis.transY), this.markers && this.repositionMarkers(), this.container.trigger("viewportChange", [this.scale this.baseScalethis.transXthis.transY])
}, 
bindContainerEvents: function () {
    var 
= !1tnthis;
    
this.container.mousemove(function (i) {
        return 
&& (r.transX -= (i.pageX) / r.scaler.transY -= (i.pageY) / r.scaler.applyTransform(), i.pageXi.pageY), !1
    
}).mousedown(function (r) {
        return 
= !0r.pageXr.pageY, !1
    
}), jvm.$("body").mouseup(function () {
        
= !1
    
}), this.params.zoomOnScroll && this.container.mousewheel(function (etni) {
        var 
jvm.$(r.container).offset(), e.pageX s.lefte.pageY s.topMath.pow(1.3i);
        
r.label.hide(), r.setScale(r.scale aou), e.preventDefault()
    })
}, 
bindContainerTouchEvents: function () {
    var 
etthisrisou= function (a) {
        var 
a.originalEvent.toucheslchp;
        
a.type == "touchstart" && (0), f.length == ? (== && (n.transXn.transYn.transX -= (f[0].pageX) / n.scalen.transY -= (f[0].pageY) / n.scalen.applyTransform(), n.label.hide(), (!= n.transX || != n.transY) && a.preventDefault()), f[0].pageXf[0].pageY) : f.length == && (== ? (Math.sqrt(Math.pow(f[0].pageX f[1].pageX2) + Math.pow(f[0].pageY f[1].pageY2)) / tn.setScale(cso), n.label.hide(), a.preventDefault()) : (jvm.$(n.container).offset(), f[0].pageX f[1].pageX f[1].pageX + (f[0].pageX f[1].pageX) / f[0].pageX + (f[1].pageX f[0].pageX) / 2f[0].pageY f[1].pageY f[1].pageY + (f[0].pageY f[1].pageY) / f[0].pageY + (f[1].pageY f[0].pageY) / 2-= l.left-= l.topn.scaleMath.sqrt(Math.pow(f[0].pageX f[1].pageX2) + Math.pow(f[0].pageY f[1].pageY2)))), f.length
    
};
    
jvm.$(this.container).bind("touchstart"a), jvm.$(this.container).bind("touchmove"a)
}, 
bindElementEvents: function () {
    var 
thist;
    
this.container.mousemove(function () {
        
= !0
    
}), this.container.delegate("[class~='jvectormap-element']""mouseover mouseout", function (t) {
        var 
thisjvm.$(this).attr("class").baseVal jvm.$(this).attr("class").baseVal jvm.$(this).attr("class"), r.indexOf("jvectormap-region") === -"marker" "region"== "region" jvm.$(this).attr("data-code") : jvm.$(this).attr("data-index"), == "region" e.regions[s].element e.markers[s].element== "region" e.mapData.paths[s].name e.markers[s].config.name || ""jvm.$.Event("LabelShow.jvectormap"), jvm.$.Event("Over.jvectormap");
        
t.type == "mouseover" ? (e.container.trigger(f, [s]), f.isDefaultPrevented() || o.setHovered(!0), e.label.text(u), e.container.trigger(a, [e.labels]), a.isDefaultPrevented() || (e.label.show(), e.labelWidth e.label.width(), e.labelHeight e.label.height())) : (o.setHovered(!1), e.label.hide(), e.container.trigger("Out.jvectormap", [s]))
    }), 
this.container.delegate("[class~='jvectormap-element']""mousedown", function (e) {
        
= !1
    
}), this.container.delegate("[class~='jvectormap-element']""mouseup", function (n) {
        var 
thisjvm.$(this).attr("class").baseVal jvm.$(this).attr("class").baseVal jvm.$(this).attr("class"), i.indexOf("jvectormap-region") === -"marker" "region"== "region" jvm.$(this).attr("data-code") : jvm.$(this).attr("data-index"), jvm.$.Event("Click.jvectormap"), == "region" e.regions[o].element e.markers[o].element;
        if (!
t) {
            
e.container.trigger(u, [o]);
            if (
=== "region" && e.params.regionsSelectable || === "marker" && e.params.markersSelectable)u.isDefaultPrevented() || (e.params["sSelectableOne"] && e.clearSelected("s"), a.setSelected(!a.isSelected))
        }
    })
}, 
bindZoomButtons: function () {
    var 
this;
    
jvm.$("<div/>").addClass("jvectormap-zoomin").text("+").appendTo(this.container), jvm.$("<div/>").addClass("jvectormap-zoomout").html("&#x2212;").appendTo(this.container), this.container.find(".jvectormap-zoomin").click(function () {
        
e.setScale(e.scale e.params.zoomStepe.width 2e.height 2)
    }), 
this.container.find(".jvectormap-zoomout").click(function () {
        
e.setScale(e.scale e.params.zoomStepe.width 2e.height 2)
    })
}, 
createLabel: function () {
    var 
this;
    
this.label jvm.$("<div/>").addClass("jvectormap-label").appendTo(jvm.$("body")), this.container.mousemove(function (t) {
        var 
t.pageX 15 e.labelWidtht.pageY 15 e.labelHeight;
        
&& (t.pageX 15), && (t.pageY 15), e.label.is(":visible") && e.label.css({leftntopr})
    })
}, 
setScale: function (etnr) {
    var 
ijvm.$.Event("zoom.jvectormap");
    
this.params.zoomMax this.baseScale this.params.zoomMax this.baseScale this.params.zoomMin this.baseScale && (this.params.zoomMin this.baseScale), typeof t != "undefined" && typeof n != "undefined" && (this.scale? (this.transX this.defaultWidth * (this.width / (this.defaultWidth e)) / 2this.transY this.defaultHeight * (this.height / (this.defaultHeight e)) / 2) : (this.transX -= (1) / tthis.transY -= (1) / n)), this.scale ethis.applyTransform(), this.container.trigger(s, [this.baseScale])
}, 
setFocus: function (etn) {
    var 
risou;
    if (
jvm.$.isArray(e) || this.regions[e]) {
        
jvm.$.isArray(e) ? = [e];
        for (
0o.lengthu++)this.regions[o[u]] && (this.regions[o[u]].element.getBBox(), && (typeof r == "undefined" : (= {xMath.min(r.xi.x), yMath.min(r.yi.y), widthMath.max(r.r.widthi.i.width) - Math.min(r.xi.x), heightMath.max(r.r.heighti.i.height) - Math.min(r.yi.y)}, s)));
        
this.setScale(Math.min(this.width r.widththis.height r.height), -(r.r.width 2), -(r.r.height 2), !0)
    } else 
*= this.baseScalethis.setScale(e, -this.defaultWidth, -this.defaultHeight, !0)
}, 
getSelected: function (e) {
    var 
t= [];
    for (
t in this[e])this[e][t].element.isSelected && n.push(t);
    return 
n
}, getSelectedRegions: function () {
    return 
this.getSelected("regions")
}, 
getSelectedMarkers: function () {
    return 
this.getSelected("markers")
}, 
setSelected: function (et) {
    var 
n;
    
typeof t != "object" && (= [t]);
    if (
jvm.$.isArray(t))for (0t.lengthn++)this[e][t[n]].element.setSelected(!0); else for (n in t)this[e][n].element.setSelected(!!t[n])
}, 
setSelectedRegions: function (e) {
    
this.setSelected("regions"e)
}, 
setSelectedMarkers: function (e) {
    
this.setSelected("markers"e)
}, 
clearSelected: function (e) {
    var 
= {}, this.getSelected(e), r;
    for (
0n.lengthr++)t[n[r]] = !1;
    
this.setSelected(et)
}, 
clearSelectedRegions: function () {
    
this.clearSelected("regions")
}, 
clearSelectedMarkers: function () {
    
this.clearSelected("markers")
}, 
getMapObject: function () {
    return 
this
}, getRegionName: function (e) {
    return 
this.mapData.paths[e].name
}, createRegions: function () {
    var 
etthis;
    for (
e in this.mapData.paths)this.canvas.addPath({dthis.mapData.paths[e].path"data-code"e}, jvm.$.extend(!0, {}, this.params.regionStyle)), jvm.$(t.node).bind("selected", function (et) {
        
n.container.trigger("regionSelected.jvectormap", [jvm.$(this).attr("data-code"), tn.getSelectedRegions()])
    }), 
t.addClass("jvectormap-region jvectormap-element"), this.regions[e] = {elementtconfigthis.mapData.paths[e]}
}, 
createMarkers: function (e) {
    var 
tnristhis;
    
this.markersGroup this.markersGroup || this.canvas.addGroup();
    if (
jvm.$.isArray(e)) {
        
e.slice(), = {};
        for (
0s.lengtht++)e[t] = s[t]
    }
    for (
t in e)e[t]instanceof Array ? {latLnge[t]} : e[t], this.getMarkerPosition(i), !== !&& (this.canvas.addCircle({"data-index"tcxr.xcyr.y}, jvm.$.extend(!0, {}, this.params.markerStyle, {initiali.style || {}}), this.markersGroup), n.addClass("jvectormap-marker jvectormap-element"), jvm.$(n.node).bind("selected", function (et) {
        
o.container.trigger("markerSelected.jvectormap", [jvm.$(this).attr("data-index"), to.getSelectedMarkers()])
    }), 
this.markers[t] && this.removeMarkers([t]), this.markers[t] = {elementnconfigi})
}, 
repositionMarkers: function () {
    var 
et;
    for (
e in this.markers)this.getMarkerPosition(this.markers[e].config), !== !&& this.markers[e].element.setStyle({cxt.xcyt.y})
}, 
getMarkerPosition: function (e) {
    return 
jvm.WorldMap.maps[this.params.map].projection this.latLngToPoint.apply(thise.latLng || [00]) : {xe.coords[0] * this.scale this.transX this.scaleye.coords[1] * this.scale this.transY this.scale}
}, 
addMarker: function (etn) {
    var 
= {}, = [], so|| [];
    
r[e] = t;
    for (
0n.lengtho++)= {}, s[e] = n[o], i.push(s);
    
this.addMarkers(ri)
}, 
addMarkers: function (et) {
    var 
n;
    
|| [], this.createMarkers(e);
    for (
0t.lengthn++)this.series.markers[n].setValues(t[n] || {})
}, 
removeMarkers: function (e) {
    var 
t;
    for (
0e.lengtht++)this.markers[e[t]].element.remove(), delete this.markers[e[t]]
}, 
removeAllMarkers: function () {
    var 
e= [];
    for (
e in this.markers)t.push(e);
    
this.removeMarkers(t)
}, 
latLngToPoint: function (et) {
    var 
njvm.WorldMap.maps[this.params.map].projectionr.centralMeridianthis.width this.baseTransX this.baseScalethis.height this.baseTransY this.baseScaleuathis.scale this.baseScale;
    return 
< -180 && (+= 360), jvm.Proj[r.type](eti), this.getInsetForPoint(n.xn.y), ? (u.bboxn.= (n.a[0].x) / (a[1].a[0].x) * u.width this.scalen.= (n.a[0].y) / (a[1].a[0].y) * u.height this.scale, {xn.this.transX this.scale u.left this.scaleyn.this.transY this.scale u.top this.scale}) : !1
}, pointToLatLng: function (et) {
    var 
jvm.WorldMap.maps[this.params.map].projectionn.centralMeridianjvm.WorldMap.maps[this.params.map].insetssouaf;
    for (
0i.lengths++) {
        
i[s], o.bbox- (this.transX this.scale o.left this.scale), - (this.transY this.scale o.top this.scale), / (o.width this.scale) * (u[1].u[0].x) + u[0].x/ (o.height this.scale) * (u[1].u[0].y) + u[0].y;
        if (
u[0].&& u[1].&& u[0].&& u[1].y)return jvm.Proj[n.type "_inv"](a, -fr)
    }
    return!
1
}, getInsetForPoint: function (et) {
    var 
jvm.WorldMap.maps[this.params.map].insetsri;
    for (
0n.lengthr++) {
        
n[r].bbox;
        if (
i[0].&& i[1].&& i[0].&& i[1].y)return n[r]
    }
}, 
createSeries: function () {
    var 
et;
    
this.series = {markers: [], regions: []};
    for (
t in this.params.series)for (0this.params.series[t].lengthe++)this.series[t][e] = new jvm.DataSeries(this.params.series[t][e], this[t])
}, 
remove: function () {
    
this.label.remove(), this.container.remove(), jvm.$(window).unbind("resize"this.onResize)
}}, 
jvm.WorldMap.maps = {}, jvm.WorldMap.defaultParams = {map"world_mill_en"backgroundColor"#505050"zoomButtons: !0zoomOnScroll: !0zoomMax8zoomMin1zoomStep1.6regionsSelectable: !1markersSelectable: !1bindTouchEvents: !0regionStyle: {initial: {fill"white""fill-opacity"1stroke"none""stroke-width"0"stroke-opacity"1}, hover: {"fill-opacity".8}, selected: {fill"yellow"}, selectedHover: {}}, markerStyle: {initial: {fill"grey"stroke"#505050""fill-opacity"1"stroke-width"1"stroke-opacity"1r5}, hover: {stroke"black""stroke-width"2}, selected: {fill"blue"}, selectedHover: {}}}, jvm.WorldMap.apiEvents = {onRegionLabelShow"regionLabelShow"onRegionOver"regionOver"onRegionOut"regionOut"onRegionClick"regionClick"onRegionSelected"regionSelected"onMarkerLabelShow"markerLabelShow"onMarkerOver"markerOver"onMarkerOut"markerOut"onMarkerClick"markerClick"onMarkerSelected"markerSelected"onViewportChange"viewportChange"};
?>
Онлайн: 3
Реклама