tianditu-map
Version:
1,439 lines • 251 kB
JavaScript
window.T = window.T || {};
(function() {
function each(t, i) {
for (var n in t)
t.hasOwnProperty(n) && i(t[n], n, t)
}
function find(t, i) {
if (t.length) {
for (var n = 0; n < t.length; n++)
if (i(t[n]))
return t[n]
} else
for (var e in t)
if (t.hasOwnProperty(e) && i(t[e]))
return t[e]
}
function first(t) {
for (var i in t)
if (t.hasOwnProperty(i))
return t[i]
}
function length(t) {
var i = 0;
for (var n in t)
t.hasOwnProperty(n) && i++;
return i
}
function prepend(t, i) {
t.children.length ? t.insertBefore(i, t.children[0]) : t.appendChild(i)
}
T.Version = "4.1.6",
T.q = {
W: function(t, i) {
switch (arguments.length) {
case 1:
return parseInt(Math.random() * t + 1);
case 2:
return parseInt(Math.random() * (i - t + 1) + t);
default:
return 0
}
}
},
T.Protocol = {
value: null,
protocol: function() {
var t = "http"
, i = document.location.protocol;
"https:" == i && (t = "https"),
T.Protocol.value = t + "://"
}
},
T.Protocol.protocol(),
T.tk = "tk=" + window.TMAP_AUTHKEY + "&",
T.Domain = "com",
T.DomainType = 1,
T.DomainFun = function() {
1 == T.DomainType ? T.Domain = "gov.cn" : 2 == T.DomainType && (T.Domain = "com")
}
,
T.DomainFun(),
T.w = {
TMAP_AUTHKEY: window.TMAP_AUTHKEY,
E: T.Protocol.value + "api.tianditu." + T.Domain,
e: T.Protocol.value + "api.tianditu." + T.Domain + "/v4.0/image",
IPSERVER: T.Protocol.value + "location.tianditu.gov.cn/data/getCityName",
R: T.Protocol.value + "api.tianditu." + T.Domain + "/apiserver/ajaxproxy?proxyReqUrl=",
r: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/vec_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&" + T.tk
},
T: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/cva_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&" + T.tk
},
t: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&" + T.tk
},
Y: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&" + T.tk
},
U: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/img_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&" + T.tk
},
u: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/cia_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&" + T.tk
},
I: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&" + T.tk
},
i: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&" + T.tk
},
O: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/ter_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ter&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&" + T.tk
},
o: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/cta_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cta&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&" + T.tk
},
P: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/ter_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ter&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&" + T.tk
},
p: function() {
return T.Protocol.value + "t" + T.q.W(0, 7) + ".tianditu." + T.Domain + "/cta_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cta&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&" + T.tk
},
A: ["/v4.0/components.js", "/v4.0/service.js", "/v4.0/military.js"],
a: ["/v4.0/css/tianditu4.0.css"],
TMAP_DEFAULT_MAPTYPES: []
},
window.T_ANCHOR_TOP_LEFT = "topleft",
window.T_ANCHOR_TOP_RIGHT = "topright",
window.T_ANCHOR_BOTTOM_LEFT = "bottomleft",
window.T_ANCHOR_BOTTOM_RIGHT = "bottomright",
window.TMAP_NORMAL_MAP = null,
window.TMAP_SATELLITE_MAP = null,
window.TMAP_HYBRID_MAP = null,
window.TMAP_TERRAIN_MAP = null,
window.TMAP_TERRAIN_HYBRID_MAP = null,
T.S = {
extend: function(t) {
var i, n, e, o;
for (n = 1,
e = arguments.length; n < e; n++) {
o = arguments[n];
for (i in o)
t[i] = o[i]
}
return t
},
s: Object.create || function() {
function t() {}
return function(i) {
return t.prototype = i,
new t
}
}(),
D: function(t, i) {
var n = Array.prototype.slice;
if (t.D)
return t.D.apply(t, n.call(arguments, 1));
var e = n.call(arguments, 2);
return function() {
return t.apply(i, e.length ? e.concat(n.call(arguments)) : arguments)
}
},
d: function(t) {
return t.F = t.F || ++T.S.f,
t.F
},
f: 0,
G: function(t, i, n) {
var e, o, s, r;
return r = function() {
e = !1,
o && (s.apply(n, o),
o = !1)
}
,
s = function() {
e ? o = arguments : (t.apply(n, arguments),
setTimeout(r, i),
e = !0)
}
},
g: function(t, i, n) {
var e = i[1]
, o = i[0]
, s = e - o;
return t === e && n ? t : ((t - o) % s + s) % s + o
},
H: function() {
return !1
},
h: function(t, i) {
var n = Math.pow(10, i || 5);
return Math.round(t * n) / n
},
J: function(t) {
return t.J ? t.J() : t.replace(/^\s+|\s+$/g, "")
},
j: function(t) {
return T.S.J(t).split(/\s+/)
},
setOptions: function(t, i) {
t.hasOwnProperty("options") || (t.options = t.options ? T.S.s(t.options) : {});
for (var n in i)
t.options[n] = i[n];
return t.options
},
K: function(t, i, n) {
var e = [];
for (var o in t)
e.push(encodeURIComponent(n ? o.toUpperCase() : o) + "=" + encodeURIComponent(t[o]));
return (i && i.indexOf("?") !== -1 ? "&" : "?") + e.join("&")
},
k: function(t, i) {
return t.replace(T.S.L, function(t, n) {
var e = i[n];
return void 0 === e || "function" == typeof e && (e = e(i)),
e
})
},
L: /\{ *([\w_\-]+) *\}/g,
l: Array.l || function(t) {
return "[object Array]" === Object.prototype.toString.call(t)
}
,
indexOf: function(t, i) {
for (var n = 0; n < t.length; n++)
if (t[n] === i)
return n;
return -1
},
Z: "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
},
function() {
function t(t) {
return window["webkit" + t] || window["moz" + t] || window["ms" + t]
}
function i(t) {
var i = +new Date
, e = Math.max(0, 16 - (i - n));
return n = i + e,
window.setTimeout(t, e)
}
var n = 0
, e = window.requestAnimationFrame || t("RequestAnimationFrame") || i
, o = window.cancelAnimationFrame || t("CancelAnimationFrame") || t("CancelRequestAnimationFrame") || function(t) {
window.clearTimeout(t)
}
;
T.S.C = function(t, n, o) {
return o && e === i ? void t.call(n) : e.call(window, T.D(t, n))
}
,
T.S.V = function(t) {
t && o.call(window, t)
}
}(),
T.extend = T.S.extend,
T.D = T.S.D,
T.d = T.S.d,
T.setOptions = T.S.setOptions,
T.c = function() {}
,
T.c.extend = function(t) {
var i = function() {
this.initialize && this.initialize.apply(this, arguments),
this.B()
}
, n = i.__super__ = this.prototype
, e = T.S.s(n);
e.constructor = i,
i.prototype = e;
for (var o in this)
this.hasOwnProperty(o) && "prototype" !== o && (i[o] = this[o]);
return t.v && (T.extend(i, t.v),
delete t.v),
t.includes && (T.S.extend.apply(null, [e].concat(t.includes)),
delete t.includes),
e.options && (t.options = T.S.extend(T.S.s(e.options), t.options)),
T.extend(e, t),
e.N = [],
e.B = function() {
if (!this.b) {
n.B && n.B.call(this),
this.b = !0;
for (var t = 0, i = e.N.length; t < i; t++)
e.N[t].call(this)
}
}
,
i
}
,
T.c.M = function(t) {
return T.extend(this.prototype, t),
this
}
,
T.c.n = function(t) {
return T.extend(this.prototype.options, t),
this
}
,
T.c._ = function(t) {
var i = Array.prototype.slice.call(arguments, 1)
, n = "function" == typeof t ? t : function() {
this[t].apply(this, i)
}
;
return this.prototype.N = this.prototype.N || [],
this.prototype.N.push(n),
this
}
,
T.m = T.c.extend({
on: function(t, i, n) {
if ("object" == typeof t)
for (var e in t)
this.QQ(e, t[e], i);
else {
t = T.S.j(t);
for (var o = 0, s = t.length; o < s; o++)
this.QQ(t[o], i, n)
}
return this
},
off: function(t, i, n) {
if (t)
if ("object" == typeof t)
for (var e in t)
this.WQ(e, t[e], i);
else {
t = T.S.j(t);
for (var o = 0, s = t.length; o < s; o++)
this.WQ(t[o], i, n)
}
else
delete this.qQ;
return this
},
QQ: function(t, i, n) {
var e = this.qQ = this.qQ || {}
, o = n && n !== this && T.d(n);
if (o) {
var s = t + "_idx"
, r = t + "_len"
, h = e[s] = e[s] || {}
, a = T.d(i) + "_" + o;
h[a] || (h[a] = {
fn: i,
ctx: n
},
e[r] = (e[r] || 0) + 1)
} else
e[t] = e[t] || [],
e[t].push({
fn: i
})
},
WQ: function(t, i, n) {
var e, o, s, r, h = this.qQ, a = t + "_idx", u = t + "_len";
if (h) {
if (!i) {
o = h[a];
for (s in o)
o[s].fn = T.S.H;
for (o = h[t] || [],
s = 0,
r = o.length; s < r; s++)
o[s].fn = T.S.H;
return delete h[t],
delete h[a],
void delete h[u]
}
var c, l = n && n !== this && T.d(n);
if (l)
c = T.d(i) + "_" + l,
o = h[a],
o && o[c] && (e = o[c],
delete o[c],
h[u]--);
else if (o = h[t]) {
for (s = 0,
r = o.length; s < r; s++)
if (o[s].fn === i) {
e = o[s],
o.splice(s, 1);
break
}
0 === o.length && delete h[t]
}
e && (e.fn = T.S.H)
}
},
wQ: function(t, i, n) {
if (!this.EQ(t, n))
return this;
var e = T.S.extend({}, i, {
type: t,
target: this
})
, o = this.qQ;
if (o) {
var s, r, h, a, u = o[t + "_idx"];
if (o[t])
for (h = o[t].slice(),
s = 0,
r = h.length; s < r; s++)
h[s].fn.call(this, e);
for (a in u)
u[a].fn.call(u[a].ctx, e)
}
return n && this.eQ(e),
this
},
trigger: function(t, i, n) {
return this.wQ(t, i, n),
this
},
EQ: function(t, i) {
var n = this.qQ;
if (n && (n[t] || n[t + "_len"]))
return !0;
if (i)
for (var e in this.RQ)
if (this.RQ[e].EQ(t, i))
return !0;
return !1
},
rQ: function(t, i, n) {
if ("object" == typeof t) {
for (var e in t)
this.rQ(e, t[e], i);
return this
}
var o = T.D(function() {
this.off(t, i, n).off(t, o, n)
}, this);
return this.on(t, i, n).on(t, o, n)
},
TQ: function(t) {
return this.RQ = this.RQ || {},
this.RQ[T.d(t)] = t,
this
},
tQ: function(t) {
return this.RQ && delete this.RQ[T.d(t)],
this
},
eQ: function(t) {
for (var i in this.RQ)
this.RQ[i].wQ(t.type, T.extend({
layer: t.target
}, t), !0)
}
});
var pro = T.m.prototype;
pro.addEventListener = pro.on,
pro.removeEventListener = pro.YQ = pro.off,
pro.UQ = pro.rQ,
pro.uQ = pro.trigger,
pro.IQ = pro.EQ,
T.iQ = {
OQ: pro
},
function() {
var t = navigator.userAgent.toLowerCase()
, i = document.documentElement
, n = "ActiveXObject"in window
, e = "Microsoft Internet Explorer" == navigator.appName && "MSIE8.0" == navigator.appVersion.split(";")[1].replace(new RegExp("[ ]","g"), "")
, o = "Microsoft Internet Explorer" == navigator.appName && "MSIE7.0" == navigator.appVersion.split(";")[1].replace(new RegExp("[ ]","g"), "")
, s = "Microsoft Internet Explorer" == navigator.appName && "MSIE6.0" == navigator.appVersion.split(";")[1].replace(new RegExp("[ ]","g"), "")
, r = t.indexOf("webkit") !== -1
, h = t.indexOf("phantom") !== -1
, a = t.search("android [23]") !== -1
, u = t.indexOf("chrome") !== -1
, c = t.indexOf("gecko") !== -1 && !r && !window.opera && !n
, l = 0 === navigator.platform.indexOf("Win")
, f = "undefined" != typeof orientation || t.indexOf("mobile") !== -1
, d = !window.PointerEvent && window.MSPointerEvent
, p = window.PointerEvent || d
, m = n && "transition"in i.style
, v = "WebKitCSSMatrix"in window && "m11"in new window.WebKitCSSMatrix && !a
, w = "MozPerspective"in i.style
, y = "OTransition"in i.style
, g = !window.L_NO_TOUCH && (p || "ontouchstart"in window || window.DocumentTouch && document instanceof window.DocumentTouch);
T.oQ = {
ie: n,
ie8: e,
ie7: o,
ie6: s,
ielt9: n && !document.addEventListener,
edge: "msLaunchUri"in navigator && !("documentMode"in document),
webkit: r,
gecko: c,
android: t.indexOf("android") !== -1,
android23: a,
chrome: u,
safari: !u && t.indexOf("safari") !== -1,
win: l,
ie3d: m,
webkit3d: v,
gecko3d: w,
opera12: y,
any3d: !window.L_DISABLE_3D && (m || v || w) && !y && !h,
mobile: f,
mobileWebkit: f && r,
mobileWebkit3d: f && v,
mobileOpera: f && window.opera,
mobileGecko: f && c,
touch: !!g,
msPointer: !!d,
pointer: !!p,
retina: (window.PQ || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1
}
}(),
T.Point = function(t, i, n) {
this.x = n ? Math.round(t) : t,
this.y = n ? Math.round(i) : i
}
,
T.Point.prototype = {
pQ: function() {
return new T.Point(this.x,this.y)
},
AQ: function(t) {
return this.pQ().aQ(T.SQ(t))
},
aQ: function(t) {
return this.x += t.x,
this.y += t.y,
this
},
sQ: function(t) {
return this.pQ().DQ(T.SQ(t))
},
DQ: function(t) {
return this.x -= t.x,
this.y -= t.y,
this
},
dQ: function(t) {
return this.pQ().FQ(t)
},
FQ: function(t) {
return this.x /= t,
this.y /= t,
this
},
fQ: function(t) {
return this.pQ().GQ(t)
},
GQ: function(t) {
return this.x *= t,
this.y *= t,
this
},
gQ: function(t) {
return new T.Point(this.x * t.x,this.y * t.y)
},
HQ: function(t) {
return new T.Point(this.x / t.x,this.y / t.y)
},
hQ: function() {
return this.pQ().JQ()
},
JQ: function() {
return this.x = Math.round(this.x),
this.y = Math.round(this.y),
this
},
jQ: function() {
return this.pQ().KQ()
},
KQ: function() {
return this.x = Math.floor(this.x),
this.y = Math.floor(this.y),
this
},
kQ: function() {
return this.pQ().LQ()
},
LQ: function() {
return this.x = Math.ceil(this.x),
this.y = Math.ceil(this.y),
this
},
distanceTo: function(t) {
t = T.SQ(t);
var i = t.x - this.x
, n = t.y - this.y;
return Math.sqrt(i * i + n * n)
},
equals: function(t) {
return t = T.SQ(t),
t.x === this.x && t.y === this.y
},
contains: function(t) {
return t = T.SQ(t),
Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y)
},
lQ: function() {
return "Point(" + T.S.h(this.x) + ", " + T.S.h(this.y) + ")"
}
},
T.SQ = function(t, i, n) {
return t instanceof T.Point ? t : T.S.l(t) ? new T.Point(t[0],t[1]) : void 0 === t || null === t ? t : "object" == typeof t && "x"in t && "y"in t ? new T.Point(t.x,t.y) : new T.Point(t,i,n)
}
,
T.ZQ = function(t, i) {
if (t)
for (var n = i ? [t, i] : t, e = 0, o = n.length; e < o; e++)
this.extend(n[e])
}
,
T.ZQ.prototype = {
extend: function(t) {
return t = T.SQ(t),
this.min || this.max ? (this.min.x = Math.min(t.x, this.min.x),
this.max.x = Math.max(t.x, this.max.x),
this.min.y = Math.min(t.y, this.min.y),
this.max.y = Math.max(t.y, this.max.y)) : (this.min = t.pQ(),
this.max = t.pQ()),
this
},
getCenter: function(t) {
return new T.Point((this.min.x + this.max.x) / 2,(this.min.y + this.max.y) / 2,t)
},
CQ: function() {
return new T.Point(this.min.x,this.max.y)
},
VQ: function() {
return new T.Point(this.max.x,this.min.y)
},
getSize: function() {
return this.max.sQ(this.min)
},
contains: function(t) {
var i, n;
return t = "number" == typeof t[0] || t instanceof T.Point ? T.SQ(t) : T.cQ(t),
t instanceof T.ZQ ? (i = t.min,
n = t.max) : i = n = t,
i.x >= this.min.x && n.x <= this.max.x && i.y >= this.min.y && n.y <= this.max.y
},
intersects: function(t) {
t = T.cQ(t);
var i = this.min
, n = this.max
, e = t.min
, o = t.max
, s = o.x >= i.x && e.x <= n.x
, r = o.y >= i.y && e.y <= n.y;
return s && r
},
BQ: function(t) {
t = T.cQ(t);
var i = this.min
, n = this.max
, e = t.min
, o = t.max
, s = o.x > i.x && e.x < n.x
, r = o.y > i.y && e.y < n.y;
return s && r
},
vQ: function() {
return !(!this.min || !this.max)
}
},
T.cQ = function(t, i) {
return !t || t instanceof T.ZQ ? t : new T.ZQ(t,i)
}
,
T.NQ = function(t, i, n, e) {
this._a = t,
this._b = i,
this._c = n,
this._d = e
}
,
T.NQ.prototype = {
bQ: function(t, i) {
return this.MQ(t.pQ(), i)
},
MQ: function(t, i) {
return i = i || 1,
t.x = i * (this._a * t.x + this._b),
t.y = i * (this._c * t.y + this._d),
t
},
nQ: function(t, i) {
return i = i || 1,
new T.Point((t.x / i - this._b) / this._a,(t.y / i - this._d) / this._c)
}
},
T._Q = {
mQ: function(t) {
return "string" == typeof t ? document.getElementById(t) : t
},
getStyle: function(t, i) {
var n = t.style[i] || t.currentStyle && t.currentStyle[i];
if ((!n || "auto" === n) && document.defaultView) {
var e = document.defaultView.getComputedStyle(t, null);
n = e ? e[i] : null
}
return "auto" === n ? null : n
},
s: function(t, i, n) {
var e = document.createElement(t);
return e.className = i || "",
n && n.appendChild(e),
e
},
Qq: function(t) {
var i = t.parentNode;
i && i.removeChild(t)
},
qq: function(t) {
for (; t.firstChild; )
t.removeChild(t.firstChild)
},
Wq: function(t) {
t.parentNode.appendChild(t)
},
wq: function(t) {
var i = t.parentNode;
i.insertBefore(t, i.firstChild)
},
Eq: function(t, i) {
if (void 0 !== t.classList)
return t.classList.contains(i);
var n = T._Q.eq(t);
return n.length > 0 && new RegExp("(^|\\s)" + i + "(\\s|$)").test(n)
},
Rq: function(t, i) {
if (void 0 !== t.classList)
for (var n = T.S.j(i), e = 0, o = n.length; e < o; e++)
t.classList.add(n[e]);
else if (!T._Q.Eq(t, i)) {
var s = T._Q.eq(t);
T._Q.rq(t, (s ? s + " " : "") + i)
}
},
Tq: function(t, i) {
void 0 !== t.classList ? t.classList.remove(i) : T._Q.rq(t, T.S.J((" " + T._Q.eq(t) + " ").replace(" " + i + " ", " ")))
},
rq: function(t, i) {
void 0 === t.className.baseVal ? t.className = i : t.className.baseVal = i
},
eq: function(t) {
return void 0 === t.className.baseVal ? t.className : t.className.baseVal
},
setOpacity: function(t, i) {
"opacity"in t.style ? t.style.opacity = i : "filter"in t.style && T._Q.tq(t, i)
},
tq: function(t, i) {
var n = !1
, e = "DXImageTransform.Microsoft.Alpha";
try {
n = t.filters.item(e)
} catch (AO) {
if (1 === i)
return
}
i = Math.round(100 * i),
n ? (n.Enabled = 100 !== i,
n.Opacity = i) : t.style.filter += " progid:" + e + "(opacity=" + i + ")"
},
Yq: function(t) {
for (var i = document.documentElement.style, n = 0; n < t.length; n++)
if (t[n]in i)
return t[n];
return !1
},
Uq: function(t, i, n) {
var e = i || new T.Point(0,0);
t.style[T._Q.uq] = (T.oQ.ie3d ? "translate(" + e.x + "px," + e.y + "px)" : "translate3d(" + e.x + "px," + e.y + "px,0)") + (n ? " scale(" + n + ")" : "")
},
setPosition: function(t, i) {
t._tdt_pos = i,
T.oQ.any3d ? T._Q.Uq(t, i) : (t.style.left = i.x + "px",
t.style.top = i.y + "px")
},
getPosition: function(t) {
return t._tdt_pos || new T.Point(0,0)
}
},
function() {
T._Q.uq = T._Q.Yq(["bQ", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]);
var t = T._Q.Iq = T._Q.Yq(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
if (T._Q.iq = "webkitTransition" === t || "OTransition" === t ? t + "End" : "transitionend",
"onselectstart"in document)
T._Q.Oq = function() {
T.oq.on(window, "selectstart", T.oq.preventDefault)
}
,
T._Q.Pq = function() {
T.oq.off(window, "selectstart", T.oq.preventDefault)
}
;
else {
var i = T._Q.Yq(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
T._Q.Oq = function() {
if (i) {
var t = document.documentElement.style;
this.pq = t[i],
t[i] = "none"
}
}
,
T._Q.Pq = function() {
i && (document.documentElement.style[i] = this.pq,
delete this.pq)
}
}
T._Q.Aq = function() {
T.oq.on(window, "dragstart", T.oq.preventDefault)
}
,
T._Q.aq = function() {
T.oq.off(window, "dragstart", T.oq.preventDefault)
}
,
T._Q.Sq = function(t) {
for (; t.tabIndex === -1; )
t = t.parentNode;
t && t.style && (T._Q.sq(),
this.Dq = t,
this._outlineStyle = t.style.outline,
t.style.outline = "none",
T.oq.on(window, "keydown", T._Q.sq, this))
}
,
T._Q.sq = function() {
this.Dq && (this.Dq.style.outline = this._outlineStyle,
delete this.Dq,
delete this._outlineStyle,
T.oq.off(window, "keydown", T._Q.sq, this))
}
}(),
T.dq = function(t, i, n) {
isNaN(t) || isNaN(i),
this.lat = +parseFloat(t).toFixed(5),
this.lng = +parseFloat(i).toFixed(5),
void 0 !== n && (this.Fq = +n)
}
,
T.dq.prototype = {
equals: function(t, i) {
if (!t)
return !1;
t = T.fq(t);
var n = Math.max(Math.abs(this.lat - t.lat), Math.abs(this.lng - t.lng));
return n <= (void 0 === i ? 1e-9 : i)
},
lQ: function(t) {
return "LngLat(" + T.S.h(this.lng, t) + ", " + T.S.h(this.lat, t) + ")"
},
distanceTo: function(t) {
return T.gq.Gq.distance(this, T.fq(t))
},
Hq: function() {
return T.gq.Gq.hq(this)
},
Jq: function(t) {
var i = 180 * t / 40075017
, n = i / Math.cos(Math.PI / 180 * this.lat);
return T.jq([this.lat - i, this.lng - n], [this.lat + i, this.lng + n])
},
pQ: function() {
return new T.dq(this.lat,this.lng,this.Fq)
},
getLng: function() {
return this.lng
},
getLat: function() {
return this.lat
}
},
T.fq = function(t, i, n) {
return t instanceof T.dq ? t : T.S.l(t) && "object" != typeof t[0] ? 3 === t.length ? new T.dq(t[0],t[1],t[2]) : 2 === t.length ? new T.dq(t[0],t[1]) : null : void 0 === t || null === t ? t : "object" == typeof t && "lat"in t ? new T.dq(t.lat,"lng"in t ? t.lng : t.lon,t.Fq) : void 0 === i ? null : new T.dq(t,i,n)
}
,
T.LngLat = function(t, i, n) {
return new T.dq(i,t,n)
}
,
T.Kq = function(t, i) {
if (t)
for (var n = i ? [t, i] : t, e = 0, o = n.length; e < o; e++)
this.extend(n[e])
}
,
T.Kq.prototype = {
extend: function(t) {
var i, n, e = this.kq, o = this.Lq;
if (t instanceof T.dq)
i = t,
n = t;
else {
if (!(t instanceof T.Kq))
return t ? this.extend(T.fq(t) || T.jq(t)) : this;
if (i = t.kq,
n = t.Lq,
!i || !n)
return this
}
return e || o ? (e.lat = Math.min(i.lat, e.lat),
e.lng = Math.min(i.lng, e.lng),
o.lat = Math.max(n.lat, o.lat),
o.lng = Math.max(n.lng, o.lng)) : (this.kq = new T.dq(i.lat,i.lng),
this.Lq = new T.dq(n.lat,n.lng)),
this
},
lq: function(t) {
var i = this.kq
, n = this.Lq
, e = Math.abs(i.lat - n.lat) * t
, o = Math.abs(i.lng - n.lng) * t;
return new T.Kq(new T.dq(i.lat - e,i.lng - o),new T.dq(n.lat + e,n.lng + o))
},
getCenter: function() {
return new T.dq((this.kq.lat + this.Lq.lat) / 2,(this.kq.lng + this.Lq.lng) / 2)
},
getSouthWest: function() {
return this.kq
},
getNorthEast: function() {
return this.Lq
},
Zq: function() {
return new T.dq(this.Cq(),this.Vq())
},
cq: function() {
return new T.dq(this.Bq(),this.vq())
},
Vq: function() {
return this.kq.lng
},
Bq: function() {
return this.kq.lat
},
vq: function() {
return this.Lq.lng
},
Cq: function() {
return this.Lq.lat
},
contains: function(t) {
t = "number" == typeof t[0] || t instanceof T.dq ? T.fq(t) : T.jq(t);
var i, n, e = this.kq, o = this.Lq;
return t instanceof T.Kq ? (i = t.getSouthWest(),
n = t.getNorthEast()) : i = n = t,
i.lat >= e.lat && n.lat <= o.lat && i.lng >= e.lng && n.lng <= o.lng
},
intersects: function(t) {
t = T.jq(t);
var i = this.kq
, n = this.Lq
, e = t.getSouthWest()
, o = t.getNorthEast()
, s = o.lat >= i.lat && e.lat <= n.lat
, r = o.lng >= i.lng && e.lng <= n.lng;
return s && r
},
BQ: function(t) {
t = T.jq(t);
var i = this.kq
, n = this.Lq
, e = t.getSouthWest()
, o = t.getNorthEast()
, s = o.lat > i.lat && e.lat < n.lat
, r = o.lng > i.lng && e.lng < n.lng;
return s && r
},
Nq: function() {
return [this.Vq(), this.Bq(), this.vq(), this.Cq()].join(",")
},
equals: function(t) {
return !!t && (t = T.jq(t),
this.kq.equals(t.getSouthWest()) && this.Lq.equals(t.getNorthEast()))
},
vQ: function() {
return !(!this.kq || !this.Lq)
}
},
T.jq = function(t, i) {
return t instanceof T.Kq ? t : new T.Kq(t,i)
}
,
T.LngLatBounds = function(t, i) {
return t instanceof T.Kq ? t : new T.Kq(t,i)
}
,
T.bq = {},
T.bq.Mq = {
nq: function(t) {
return new T.Point(t.lng,t.lat)
},
_q: function(t) {
return new T.dq(t.y,t.x)
},
bounds: T.cQ([-180, -90], [180, 90])
},
T.bq.mq = {
R: 6378137,
QW: 85.0511287798,
nq: function(t) {
var i = Math.PI / 180
, n = this.QW
, e = Math.max(Math.min(n, t.lat), -n)
, o = Math.sin(e * i);
return new T.Point(this.R * t.lng * i,this.R * Math.log((1 + o) / (1 - o)) / 2)
},
_q: function(t) {
var i = 180 / Math.PI;
return new T.dq((2 * Math.atan(Math.exp(t.y / this.R)) - Math.PI / 2) * i,t.x * i / this.R)
},
bounds: function() {
var t = 6378137 * Math.PI;
return T.cQ([-t, -t], [t, t])
}()
},
T.gq = {
qW: function(t, i) {
var n = this.projection.nq(t)
, e = this.scale(i);
return this.WW.MQ(n, e)
},
wW: function(t, i) {
var n = this.scale(i)
, e = this.WW.nQ(t, n);
return this.projection._q(e)
},
nq: function(t) {
return this.projection.nq(t)
},
_q: function(t) {
return this.projection._q(t)
},
scale: function(t) {
return 256 * Math.pow(2, t - T.gq.EW)
},
EW: 0,
zoom: function(t) {
return Math.log(t / 256) / Math.LN2
},
eW: function(t) {
if (this.RW)
return null;
var i = this.projection.bounds
, n = this.scale(t)
, e = this.WW.bQ(i.min, n)
, o = this.WW.bQ(i.max, n);
return T.cQ(e, o)
},
RW: !1,
hq: function(t) {
var i = this.rW ? T.S.g(t.lng, this.rW, !0) : t.lng
, n = this.wrapLat ? T.S.g(t.lat, this.wrapLat, !0) : t.lat
, e = t.Fq;
return T.fq(n, i, e)
}
},
T.gq.TW = T.extend({}, T.gq, {
projection: T.bq.Mq,
WW: new T.NQ(1,0,-1,0),
scale: function(t) {
return Math.pow(2, t)
},
zoom: function(t) {
return Math.log(t) / Math.LN2
},
distance: function(t, i) {
var n = i.lng - t.lng
, e = i.lat - t.lat;
return Math.sqrt(n * n + e * e)
},
RW: !0
}),
T.gq.Gq = T.extend({}, T.gq, {
rW: [-180, 180],
R: 6371e3,
distance: function(t, i) {
var n = Math.PI / 180
, e = t.lat * n
, o = i.lat * n
, s = Math.sin(e) * Math.sin(o) + Math.cos(e) * Math.cos(o) * Math.cos((i.lng - t.lng) * n);
return this.R * Math.acos(Math.min(s, 1))
}
}),
T.gq.tW = T.extend({}, T.gq.Gq, {
code: "YW",
projection: T.bq.mq,
WW: function() {
var t = .5 / (Math.PI * T.bq.mq.R);
return new T.NQ(t,.5,-t,.5)
}()
}),
T.gq.UW = T.extend({}, T.gq.tW, {
code: "EPSG:900913"
}),
T.gq.uW = T.extend({}, T.gq.Gq, {
code: "EPSG:4326",
projection: T.bq.Mq,
WW: new T.NQ(1 / 180,1,-1 / 180,.5)
}),
T.Map = T.m.extend({
options: {
IW: T.gq.UW,
center: void 0,
zoom: void 0,
minZoom: void 0,
maxZoom: void 0,
layers: [],
maxBounds: void 0,
iW: void 0,
OW: !0,
oW: !0,
PW: !0,
pW: 8388608,
AW: 1,
aW: 1,
datasourcesControl: !1
},
initialize: function(t, i) {
i = T.setOptions(this, i),
this.SW = "EPSG:900913",
i.projection ? "EPSG:4326" == i.projection ? (i.IW = T.gq.uW,
this.SW = "EPSG:4326",
T.gq.EW = 1) : (i.IW = T.gq.UW,
this.SW = "EPSG:900913",
i.projection = this.SW,
T.gq.EW = 0) : i.projection = this.SW,
this.sW(t),
this.DW(),
this.dW = T.D(this.dW, this),
this.FW(),
i.maxBounds && this.setMaxBounds(i.maxBounds),
void 0 !== i.zoom && (this.fW = this.GW(i.zoom)),
i.center && void 0 !== i.zoom && this.gW(T.fq(i.center), i.zoom, {
reset: !0
}),
this.HW = [],
this.hW = {},
this.JW = [],
this.jW = [],
this.KW = {},
this.kW = !0,
this.initLayers = [],
this.B(),
this.defaultMapType = null,
this.LW(this),
this.lW(this.options.layers)
},
getCode: function() {
return this.SW
},
gW: function(t, i) {
return i = void 0 === i ? this.getZoom() : i,
this.ZW(T.fq(t), i),
this
},
setZoom: function(t, i) {
return this.CW ? this.gW(this.getCenter(), t, {
zoom: i
}) : (this.fW = t,
this)
},
zoomIn: function(t, i) {
return t = t || (T.oQ.any3d ? this.options.aW : 1),
this.setZoom(this.fW + t, i)
},
zoomOut: function(t, i) {
return t = t || (T.oQ.any3d ? this.options.aW : 1),
this.setZoom(this.fW - t, i)
},
VW: function(t, i, n) {
var e = this.cW(i)
, o = this.getSize().dQ(2)
, s = t instanceof T.Point ? t : this.BW(t)
, r = s.sQ(o).fQ(1 - 1 / e)
, h = this.vW(o.AQ(r));
return this.gW(h, i, {
zoom: n
})
},
NW: function(t, i) {
i = i || {},
t = t.getBounds ? t.getBounds() : T.jq(t);
var n = T.SQ(i.bW || i.MW || [0, 0])
, e = T.SQ(i.paddingBottomRight || i.MW || [0, 0])
, o = this.nW(t, !1, n.AQ(e));
o = "number" == typeof i.maxZoom ? Math.min(i.maxZoom, o) : o;
var s = e.sQ(n).dQ(2)
, r = this.nq(t.getSouthWest(), o)
, h = this.nq(t.getNorthEast(), o)
, a = this._q(r.AQ(h).dQ(2).AQ(s), o);
return {
center: a,
zoom: o
}
},
_W: function(t, i) {
if (t = T.jq(t),
!t.vQ())
throw new Error("Bounds are not valid.");
var n = this.NW(t, i);
return this.gW(n.center, n.zoom, i)
},
mW: function(t) {
return this._W([[-90, -180], [90, 180]], t)
},
getViewport: function(t) {
if (T.S.l(t) && 0 != t.length) {
var i = this.Qw(t);
return {
center: i.getCenter(),
zoom: this.nW(i, !1)
}
}
},
setViewport: function(t) {
if (T.S.l(t) && 0 != t.length) {
var i = this.Qw(t);
this.panTo(i.getCenter(), this.nW(i, !1))
}
},
Qw: function(t) {
for (var i = new T.LngLatBounds(new T.LngLat(0,0)), n = 0, e = t.length; n < e; n++) {
var o = T.fq(t[n]);
i.extend(o)
}
return i
},
panTo: function(t, i, n) {
return i && (this.fW = i),
this.centerAndZoom(t, this.fW, {
qw: n
})
},
panBy: function(t) {
return this.wQ("movestart"),
this.Ww(T.SQ(t)),
this.wQ("move"),
this.wQ("moveend")
},
setMaxBounds: function(t) {
return t = T.jq(t),
t.vQ() ? (this.options.maxBounds && this.off("moveend", this.ww),
this.options.maxBounds = t,
this.CW && this.ww(),
this.on("moveend", this.ww)) : (this.options.maxBounds = null,
this.off("moveend", this.ww))
},
setMinZoom: function(t) {
return this.options.minZoom = t,
this.CW && this.getZoom() < this.options.minZoom ? this.setZoom(t) : (this.wQ("minzoom", {
minZoom: this.options.minZoom,
maxZoom: this.options.maxZoom
}),
this)
},
setMaxZoom: function(t) {
return this.options.maxZoom = t,
this.CW && this.getZoom() > this.options.maxZoom ? this.setZoom(t) : (this.wQ("maxzoom", {
minZoom: this.options.minZoom,
maxZoom: this.options.maxZoom
}),
this)
},
Ew: function(t, i) {
this.ew = !0;
var n = this.getCenter()
, e = this.Rw(n, this.fW, T.jq(t));
return n.equals(e) || this.panTo(e, i),
this.ew = !1,
this
},
rw: function(t) {
if (!this.CW)
return this;
t = T.extend({
Tw: !1,
qw: !0
}, t === !0 ? {
Tw: !0
} : t);
var i = this.getSize();
this.kW = !0,
this.tw = null;
var n = this.getSize()
, e = i.dQ(2).hQ()
, o = n.dQ(2).hQ()
, s = e.sQ(o);
return s.x || s.y ? (t.Tw && t.qw ? this.panBy(s) : (t.qw && this.Ww(s),
this.wQ("move"),
t.Yw ? (clearTimeout(this.Uw),
this.Uw = setTimeout(T.D(this.wQ, this, "moveend"), 200)) : this.wQ("moveend")),
this.wQ("resize", {
oldSize: i,
newSize: n
})) : this
},
checkResize: function() {
this.rw()
},
uw: function() {
return this.setZoom(this.GW(this.fW)),
this.options.AW || this.wQ("viewreset"),
this.Iw()
},
iw: function(t, i) {
if (!i)
return this;
var n = this[t] = new i(this);
return this.HW.push(n),
this.options[t] && n.enable(),
this
},
Qq: function() {
this.FW(!0);
try {
delete this.Ow._tdt
} catch (AO) {
this.Ow._tdt = void 0
}
T._Q.Qq(this.ow),
this.Pw && this.Pw(),
this.pw(),
this.CW && this.wQ("unload");
for (var t in this.hW)
this.hW[t].Qq();
return this
},
Aw: function(t, i) {
var n = "tdt-pane" + (t ? " tdt-" + t.replace("Pane", "") + "-pane" : "")
, e = T._Q.s("div", n, i || this.ow);
return t && (this.aw[t] = e),
e
},
getCenter: function() {
return this.Sw(),
this.tw && !this.sw() ? this.tw : this.Dw(this.dw())
},
getZoom: function() {
return this.fW
},
getBounds: function() {
var t = this.Fw()
, i = this._q(t.CQ())
, n = this._q(t.VQ());
return new T.Kq(i,n)
},
getMinZoom: function() {
return void 0 === this.options.minZoom ? this.fw || 0 : this.options.minZoom
},
getMaxZoom: function() {
return void 0 === this.options.maxZoom ? void 0 === this.Gw ? 1 / 0 : this.Gw : this.options.maxZoom
},
nW: function(t, i, n) {
t = T.jq(t),
n = T.SQ(n || [0, 0]);
var e = this.getZoom() || 0
, o = this.getMinZoom()
, s = this.getMaxZoom()
, r = t.Zq()
, h = t.cq()
, a = this.getSize().sQ(n)
, u = this.nq(h, e).sQ(this.nq(r, e))
, c = T.oQ.any3d ? this.options.AW : 1
, l = Math.min(a.x / u.x, a.y / u.y);
return e = this.gw(l, e),
c && (e = Math.round(e / (c / 100)) * (c / 100),
e = i ? Math.ceil(e / c) * c : Math.floor(e / c) * c),
Math.max(o, Math.min(s, e))
},
getSize: function() {
return this.Hw && !this.kW || (this.Hw = new T.Point(this.Ow.clientWidth,this.Ow.clientHeight),
this.kW = !1),
this.Hw.pQ()
},
Fw: function(t, i) {
var n = this.hw(t, i);
return new T.ZQ(n,n.AQ(this.getSize()))
},
Jw: function() {
return this.Sw(),
this.jw
},
Kw: function(t) {
return this.options.IW.eW(void 0 === t ? this.getZoom() : t)
},
getPane: function(t) {
return "string" == typeof t ? this.aw[t] : t
},
getPanes: function() {
return this.aw
},
getContainer: function() {
return this.Ow
},
cW: function(t, i) {
var n = this.options.IW;
return i = void 0 === i ? this.fW : i,
n.scale(t) / n.scale(i)
},
gw: function(t, i) {
var n = this.options.IW;
return i = void 0 === i ? this.fW : i,
n.zoom(t * n.scale(i + T.gq.EW))
},
setCrs: function(t) {
if (t == this.getCode())
return !1;
var i = this.getCenter();
"EPSG:900913" == t ? (this.options.IW = T.gq.UW,
this.SW = t,
T.gq.EW = 0) : (this.options.IW = T.gq.uW,
this.SW = t,
T.gq.EW = 1),
this.setMapType(this.getMapType()),
this.ZW(i, this.getZoom())
},
switchingMaps: function(t) {
this.setCrs(t)
},
nq: function(t, i) {
return i = void 0 === i ? this.fW : i,
this.options.IW.qW(T.fq(t), i)
},
_q: function(t, i) {
return i = void 0 === i ? this.fW : i,
this.options.IW.wW(T.SQ(t), i)
},
Dw: function(t) {
var i = T.SQ(t).AQ(this.Jw());
return this._q(i)
},
kw: function(t) {
var i = this.nq(T.fq(t)).JQ();
return i.DQ(this.Jw())
},
layerPointToLngLat: function(t) {
return this.Dw(t)
},
lngLatToLayerPoint: function(t) {
return this.kw(t)
},
hq: function(t) {
return this.options.IW.hq(T.fq(t))
},
distance: function(t, i) {
return this.options.IW.distance(T.fq(t), T.fq(i))
},
getDistance: function(t, i) {
return this.distance(t, i)
},
Lw: function(t) {
return T.SQ(t).