You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
12 KiB
JavaScript
9 lines
12 KiB
JavaScript
|
2 weeks ago
|
/*!
|
||
|
|
*
|
||
|
|
* leaflet.motion - v0.1.5 (https://github.com/Igor-Vladyka/leaflet.motion#readme)
|
||
|
|
* Animation plugin for Leaflet.js
|
||
|
|
*
|
||
|
|
* MIT (http://www.opensource.org/licenses/mit-license.php)
|
||
|
|
* (c) 2019 Igor Vladyka <igor.vladyka@gmail.com> (https://github.com/Igor-Vladyka/)
|
||
|
|
*
|
||
|
|
*/!function(t){var n={};function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:i})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(i,o,function(n){return t[n]}.bind(null,o));return i},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=6)}([function(t,n){L.Motion.Seq=L.Motion.Group.extend({_activeLayer:null,motionStart:function(){var t=this.getFirstLayer();return t&&(this.__prepareStart(),t.motionStart(),this.fire(L.Motion.Event.Started,{layer:this},!1)),this},motionStop:function(){return this.invoke("motionStop"),this._activeLayer=null,this.fire(L.Motion.Event.Ended,{layer:this},!1),this},motionPause:function(){return this._activeLayer&&(this._activeLayer.motionPause(),this.fire(L.Motion.Event.Paused,{layer:this},!1)),this},motionResume:function(){return this._activeLayer&&(this._activeLayer.motionResume(),this.fire(L.Motion.Event.Resumed,{layer:this},!1)),this},motionToggle:function(){return this._activeLayer?this.motionPause():this.motionResume(),this},getFirstLayer:function(){var t=this.getLayers();return t.length?t[0]:null},__prepareStart:function(){var t=this;this.getLayers().forEach(function(n){n.off(L.Motion.Event.Ended,t.__clearActiveLayer__,t),n.on(L.Motion.Event.Ended,t.__clearActiveLayer__,t),n.off(L.Motion.Event.Started,t.__putActiveLayer__,t),n.on(L.Motion.Event.Started,t.__putActiveLayer__,t)})},__clearActiveLayer__:function(t){this._activeLayer=null;var n=this.getLayers(),e=t.layer._leaflet_id,i=n.filter(function(t){return t._leaflet_id==e})[0],o=n.indexOf(i)+1;n.length>o?n[o].motionStart():this.fire(L.Motion.Event.Ended,{layer:this},!1)},__putActiveLayer__:function(t){this._activeLayer=t.layer,this.fire(L.Motion.Event.Section,{layer:this._activeLayer},!1)}}),L.motion.seq=function(t,n){return new L.Motion.Seq(t,n)}},function(t,n){L.Motion.Group=L.FeatureGroup.extend({options:{pane:L.Motion.Animate.options.pane,attribution:L.Motion.Animate.options.attribution},motionStart:function(){return this.invoke("motionStart"),this.fire(L.Motion.Event.Started,{layer:this},!1),this},motionStop:function(){return this.invoke("motionStop"),this.fire(L.Motion.Event.Ended,{layer:this},!1),this},motionPause:function(){return this.invoke("motionPause"),this.fire(L.Motion.Event.Paused,{layer:this},!1),this},motionResume:function(){return this.invoke("motionResume"),this.fire(L.Motion.Event.Resumed,{layer:this},!1),this},motionToggle:function(){return this.invoke("motionToggle"),this},getMarkers:function(){return this.getLayers().map(function(t){return t.getMarkers()})}}),L.motion.group=function(t,n){return new L.Motion.Group(t,n)}},function(t,n){L.Motion.Polyline=L.Polyline.extend(L.Motion.Animate),L.motion.polyline=function(t,n,e,i){return new L.Motion.Polyline(t,n,e,i)}},function(t,n){L.Motion.Ease={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},easeInQuad:function(t,n,e,i,o){return i*(n/=o)*n+e},easeOutQuad:function(t,n,e,i,o){return-i*(n/=o)*(n-2)+e},easeInOutQuad:function(t,n,e,i,o){return(n/=o/2)<1?i/2*n*n+e:-i/2*(--n*(n-2)-1)+e},easeInCubic:function(t,n,e,i,o){return i*(n/=o)*n*n+e},easeOutCubic:function(t,n,e,i,o){return i*((n=n/o-1)*n*n+1)+e},easeInOutCubic:function(t,n,e,i,o){return(n/=o/2)<1?i/2*n*n*n+e:i/2*((n-=2)*n*n+2)+e},easeInQuart:function(t,n,e,i,o){return i*(n/=o)*n*n*n+e},easeOutQuart:function(t,n,e,i,o){return-i*((n=n/o-1)*n*n*n-1)+e},easeInOutQuart:function(t,n,e,i,o){return(n/=o/2)<1?i/2*n*n*n*n+e:-i/2*((n-=2)
|