@@ -24,7 +24,7 @@ _leaflet2.default.Polyline.include({
2424 _latLngAnimation : null ,
2525
2626 // It initialization polyline with animation
27- snakeIn : function snakeIn ( e ) {
27+ snakePlayer : function snakePlayer ( e ) {
2828 if ( e && ! this . _latLngAnimation ) this . _latLngAnimation = e ;
2929 for ( var i in this . _eventParents ) {
3030 if ( this . _eventParents [ i ] . _options . defaultSpeed ) {
@@ -42,7 +42,7 @@ _leaflet2.default.Polyline.include({
4242 this . _snakingVertices = this . _snakingDistance = 0 ;
4343 this . _latlngs = [ this . _snakeLatLngs [ 0 ] , this . _snakeLatLngs [ 0 ] ] ;
4444 this . _nextPoint ( ) ;
45- this . _snake ( ) ;
45+ this . _snakeRun ( ) ;
4646 this . fire ( "snakestart" ) ;
4747 return this ;
4848 } ,
@@ -113,7 +113,7 @@ _leaflet2.default.Polyline.include({
113113 this . _play = true ;
114114 this . _now = this . _snakingTime ;
115115 this . startTime ( ) ;
116- this . _snake ( ) ;
116+ this . _snakeRun ( ) ;
117117 } ,
118118
119119 changeSpeed : function changeSpeed ( xSpeed ) {
@@ -132,7 +132,7 @@ _leaflet2.default.Polyline.include({
132132 } ,
133133
134134 // new iteration of animation
135- _snake : function _snake ( ) {
135+ _snakeRun : function _snakeRun ( ) {
136136 if ( ! this . maxDistance ) {
137137 this . maxDistance = this . _snakeLatLngs [ 0 ] . distanceTo ( this . _snakeLatLngs [ 1 ] ) ;
138138 }
@@ -146,11 +146,11 @@ _leaflet2.default.Polyline.include({
146146 this . _snakingTime = this . _now ;
147147 this . _latlngs . pop ( ) ;
148148 this . _forward = forward ;
149- return this . _snakeForward ( forward ) ;
149+ return this . _snakeForwardRun ( forward ) ;
150150 }
151151 } ,
152152
153- _snakeForward : function _snakeForward ( forward ) {
153+ _snakeForwardRun : function _snakeForwardRun ( forward ) {
154154 if ( ! this . _now ) this . startTime ( ) ;
155155 if ( this . _play && this . _map ) {
156156 var currPoint = this . _map . latLngToContainerPoint ( this . _snakeLatLngs [ this . _snakingVertices ] ) ;
@@ -171,7 +171,7 @@ _leaflet2.default.Polyline.include({
171171 }
172172 this . _nextPoint ( ) ;
173173 this . _snakingDistance -= this . maxDistance ;
174- return this . _snakeForward ( forward ) ;
174+ return this . _snakeForwardRun ( forward ) ;
175175 }
176176 this . _snakingDistance += forward ;
177177 var percent = this . maxDistance ? this . _snakingDistance / this . maxDistance : 0 ;
@@ -189,7 +189,7 @@ _leaflet2.default.Polyline.include({
189189 }
190190 this . setLatLngs ( this . _latlngs ) ;
191191 this . fire ( "snake" ) ;
192- _leaflet2 . default . Util . requestAnimFrame ( this . _snake , this ) ;
192+ _leaflet2 . default . Util . requestAnimFrame ( this . _snakeRun , this ) ;
193193 }
194194 } ,
195195
@@ -220,7 +220,7 @@ _leaflet2.default.Polyline.include({
220220 this . _snaking = false ;
221221 this . setLatLngs ( this . _snakeLatLngs ) ;
222222 for ( var i in this . _eventParents ) {
223- this . _eventParents [ i ] . _snakeNext ( ) ;
223+ this . _eventParents [ i ] . _snakeNextPolyline ( ) ;
224224 }
225225 }
226226} ) ;
@@ -250,7 +250,7 @@ _leaflet2.default.LayerGroup.include({
250250 } ) ;
251251 if ( findLast ) {
252252 if ( goPlay ) goPlay . snakePlay ( ) ;
253- } else this . _snakeNext ( ) ;
253+ } else this . _snakeNextPolyline ( ) ;
254254 } ,
255255 // change position. This function stopping work of animation and initiate polylines with default state. Need timestamp
256256 changePosition : function changePosition ( value ) {
@@ -382,7 +382,7 @@ _leaflet2.default.LayerGroup.include({
382382 } ) ;
383383 } ,
384384
385- snakeIn : function snakeIn ( events ) {
385+ snakePlayer : function snakePlayer ( events ) {
386386 if ( ! this . _callbackChangePosition && events . change ) this . _callbackChangePosition = events . change ;
387387 if ( ! this . _latLngAnimation && events . fly ) {
388388 var self = this ;
@@ -408,7 +408,7 @@ _leaflet2.default.LayerGroup.include({
408408 if ( this . _options . startPosition ) {
409409 this . _initiateStartPosition ( ) ;
410410 } else {
411- return this . _snakeNext ( ) ;
411+ return this . _snakeNextPolyline ( ) ;
412412 }
413413 } ,
414414
@@ -433,7 +433,7 @@ _leaflet2.default.LayerGroup.include({
433433 }
434434 } ,
435435
436- _snakeNext : function _snakeNext ( ) {
436+ _snakeNextPolyline : function _snakeNextPolyline ( ) {
437437 if ( ! this . _snaking && this . _snakingLayersDone < this . _snakingLayers . length ) {
438438 this . _snaking = true ;
439439 }
@@ -446,7 +446,7 @@ _leaflet2.default.LayerGroup.include({
446446 this . _snakingLayersDone ++ ;
447447 if ( ! this . hasLayer ( currentLayer ) ) {
448448 this . addLayer ( currentLayer ) ;
449- currentLayer . snakeIn ( this . _latLngAnimation ) ;
449+ currentLayer . snakePlayer ( this . _latLngAnimation ) ;
450450 } else currentLayer . snakePlay ( ) ;
451451 } ,
452452
0 commit comments