Skip to content

Commit 8f8c67b

Browse files
committed
fix little bug with versions
1 parent c7ca8aa commit 8f8c67b

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ var _leaflet = require("leaflet");
2525

2626
var _leaflet2 = _interopRequireDefault(_leaflet);
2727

28-
var _reactLeafletControl = require("react-leaflet-control");
28+
var _reactLeafletCustomControl = require("@skyeer/react-leaflet-custom-control");
2929

30-
var _reactLeafletControl2 = _interopRequireDefault(_reactLeafletControl);
30+
var _reactLeafletCustomControl2 = _interopRequireDefault(_reactLeafletCustomControl);
3131

3232
var _dots = require("./dots");
3333

@@ -79,7 +79,7 @@ var LeafletReactTrackPlayer = function (_MapLayer) {
7979
var _this = _possibleConstructorReturn(this, (LeafletReactTrackPlayer.__proto__ || Object.getPrototypeOf(LeafletReactTrackPlayer)).call(this, props));
8080

8181
_this.initSnake = function () {
82-
_this.leafletElement.snakePolyline.snakeIn({
82+
_this.leafletElement.snakePolyline.snakePlayer({
8383
fly: function fly(point) {
8484
return _this.flyTrack(point);
8585
},
@@ -393,7 +393,7 @@ var LeafletReactTrackPlayer = function (_MapLayer) {
393393
var _this4 = this;
394394

395395
return _react2.default.createElement(
396-
_reactLeafletControl2.default,
396+
_reactLeafletCustomControl2.default,
397397
{ position: "bottomleft" },
398398
this.props.useControl ? _react2.default.createElement(
399399
"div",

lib/snake.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "leaflet-react-track-player",
33
"description": "This is plugin to react-leaflet. It create player for control of track.",
4-
"version": "1.3.3",
4+
"version": "1.3.4",
55
"private": false,
66
"main": "lib/index.js",
77
"homepage": "https://github.com/argonavt11/leaflet-react-track-player",

src/laeflet-react-track-player/snake.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ L.Polyline.include({
206206
}
207207
this.setLatLngs(this._latlngs);
208208
this.fire("snake");
209-
L.Util.requestAnimFrame(this._snake, this);
209+
L.Util.requestAnimFrame(this._snakeRun, this);
210210
}
211211
},
212212

0 commit comments

Comments
 (0)