UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

1 lines 4.08 kB
module.exports=function(n){function t(e){if(i[e])return i[e].exports;var r=i[e]={exports:{},id:e,loaded:!1};return n[e].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=n,t.c=i,t.p="",t(0)}({0:function(n,t,i){n.exports=i(902)},3:function(n,t){n.exports=function(){throw Error("define cannot be used indirect")}},859:function(n,t){n.exports=require("../../kendo.drawing")},902:function(n,t,i){var e,r,a;!function(s,define){r=[i(859),i(903)],e=s,a="function"==typeof e?e.apply(t,r):e,!(void 0!==a&&(n.exports=a))}(function(){!function(n,t){var i,e=Math,r=e.abs,a=e.atan,s=e.atan2,o=e.cos,l=e.max,u=e.min,c=e.sin,h=e.tan,f=window.kendo,g=f.Class,d=f.dataviz,w=f.deepExtend,m=f.drawing.util,p=m.defined,E=m.deg,v=m.rad,A=m.round,T=m.valueOrDefault,x=f.util.sqr,N=g.extend({init:function(n,t){1===arguments.length?(this.lat=n[0],this.lng=n[1]):(this.lat=n,this.lng=t)},DISTANCE_ITERATIONS:100,DISTANCE_CONVERGENCE:1e-12,DISTANCE_PRECISION:2,FORMAT:"{0:N6},{1:N6}",toArray:function(){return[this.lat,this.lng]},equals:function(n){return n&&n.lat===this.lat&&n.lng===this.lng},clone:function(){return new N(this.lat,this.lng)},round:function(n){return this.lng=A(this.lng,n),this.lat=A(this.lat,n),this},wrap:function(){return this.lng=this.lng%180,this.lat=this.lat%90,this},distanceTo:function(n,t){return this.greatCircleTo(n,t).distance},destination:function(n,t,i){var r,a,l,u,h;return t=v(t),i=i||d.map.datums.WGS84,r=v(this.lat),a=v(this.lng),l=n/f.dataviz.map.datums.WGS84.a,u=e.asin(c(r)*o(l)+o(r)*c(l)*o(t)),h=a+s(c(t)*c(l)*o(r),o(l)-c(r)*c(u)),new N(E(u),E(h))},greatCircleTo:function(n,t){var i,l,u,f,g,w,m,p,T,C,I,S,y,O,R,D,L,q,z,_,G,F,W,b,k,M,P,V,j;if(n=N.create(n),t=t||d.map.datums.WGS84,!n||this.clone().round(8).equals(n.clone().round(8)))return{distance:0,azimuthFrom:0,azimuthTo:0};for(i=t.a,l=t.b,u=t.f,f=v(n.lng-this.lng),g=a((1-u)*h(v(this.lat))),w=c(g),m=o(g),p=a((1-u)*h(v(n.lat))),T=c(p),C=o(p),I=f,y=this.DISTANCE_ITERATIONS,O=!1;!O&&y-- >0;)R=c(I),D=o(I),L=e.sqrt(x(C*R)+x(m*T-w*C*D)),z=w*T+m*C*D,G=s(L,z),F=m*C*R/L,q=1-x(F),_=0,0!==q&&(_=z-2*w*T/q),S=I,W=u/16*q*(4+u*(4-3*q)),I=f+(1-W)*u*F*(G+W*L*(_+W*z*(-1+2*x(_)))),O=r(I-S)<=this.DISTANCE_CONVERGENCE;return b=q*(x(i)-x(l))/x(l),k=1+b/16384*(4096+b*(-768+b*(320-175*b))),M=b/1024*(256+b*(-128+b*(74-47*b))),P=M*L*(_+M/4*(z*(-1+2*x(_))-M/6*_*(-3+4*x(L))*(-3+4*x(_)))),V=s(C*R,m*T-w*C*D),j=s(m*R,-w*C+m*T*D),{distance:A(l*k*(G-P),this.DISTANCE_PRECISION),azimuthFrom:E(V),azimuthTo:E(j)}}});N.fn.toString=function(){return f.format(this.FORMAT,this.lat,this.lng)},N.fromLngLat=function(n){return new N(n[1],n[0])},N.fromLatLng=function(n){return new N(n[0],n[1])},N.create=function(n,t){if(p(n))return n instanceof N?n.clone():1===arguments.length&&2===n.length?N.fromLatLng(n):new N(n,t)},i=g.extend({init:function(n,t){n=N.create(n),t=N.create(t),n.lng+180>t.lng+180&&n.lat+90<t.lat+90?(this.se=n,this.nw=t):(this.se=t,this.nw=n)},contains:function(n){var t=this.nw,i=this.se,e=T(n.lng,n[1]),r=T(n.lat,n[0]);return n&&e+180>=t.lng+180&&e+180<=i.lng+180&&r+90>=i.lat+90&&r+90<=t.lat+90},center:function(){var n=this.nw,t=this.se,i=n.lng+(t.lng-n.lng)/2,e=n.lat+(t.lat-n.lat)/2;return new N(e,i)},containsAny:function(n){var t,i=!1;for(t=0;t<n.length;t++)i=i||this.contains(n[t]);return i},include:function(n){var t=this.nw,i=this.se,e=T(n.lng,n[1]),r=T(n.lat,n[0]);t.lng=u(t.lng,e),t.lat=l(t.lat,r),i.lng=l(i.lng,e),i.lat=u(i.lat,r)},includeAll:function(n){for(var t=0;t<n.length;t++)this.include(n[t])},edges:function(){var n=this.nw,t=this.se;return{nw:this.nw,ne:new N(n.lat,t.lng),se:this.se,sw:new N(t.lat,n.lng)}},toArray:function(){var n=this.nw,t=this.se;return[n,new N(n.lat,t.lng),t,new N(t.lat,n.lng)]},overlaps:function(n){return this.containsAny(n.toArray())||n.containsAny(this.toArray())}}),i.World=new i([90,-180],[-90,180]),i.create=function(n,e){return n instanceof i?n:n&&e?new i(n,e):n&&4===n.length&&!e?new i([n[0],n[1]],[n[2],n[3]]):t},w(d,{map:{Extent:i,Location:N}})}(window.kendo.jQuery)},i(3))},903:function(n,t){n.exports=require("../../util/main")}});