@@ -318,13 +318,13 @@ var LeafletReactTrackPlayer = function (_MapLayer) {
318
318
iconSize : [ 35 , 35 ]
319
319
} ) ;
320
320
} ;
321
+ var course = this . props . customMarker && this . props . customCourse && this . state . track [ 0 ] && this . state . track [ 0 ] . course ? this . state . track [ 0 ] . course : null ;
321
322
var finishMarker = _leaflet2 . default . marker ( this . props . track [ 0 ] , {
322
- icon : this . createIcon ( this . props . track [ 0 ] . course )
323
+ icon : this . createIcon ( course )
323
324
} ) ;
324
325
this . props . leaflet . map . addLayer ( finishMarker ) ;
325
-
326
326
// polyline
327
- var snakePolyline = _leaflet2 . default . multiOptionsPolyline ( this . props . track , _extends ( { } , paramsForMultiPolyline ( this . props ) , {
327
+ var snakePolyline = _leaflet2 . default . multiColorsPolyline ( this . props . track , _extends ( { } , paramsForMultiPolyline ( this . props ) , {
328
328
timeFormat : this . props . timeFormat ,
329
329
progressFormat : this . props . progressFormat ,
330
330
startPosition : this . props . startPosition
@@ -352,7 +352,7 @@ var LeafletReactTrackPlayer = function (_MapLayer) {
352
352
353
353
if ( fromProps . track . length !== toProps . track . length && this . state . activeStream ) {
354
354
this . setState ( { active : true } ) ;
355
- var newPointsPolyline = this . props . progressFormat === "default" || this . props . progressFormat === "distance" ? _leaflet2 . default . multiOptionsPolyline ( toProps . track . slice ( fromProps . track . length - 1 ) , paramsForMultiPolyline ( this . props ) ) : _leaflet2 . default . multiOptionsPolyline ( toProps . track . filter ( function ( item ) {
355
+ var newPointsPolyline = this . props . progressFormat === "default" || this . props . progressFormat === "distance" ? _leaflet2 . default . multiColorsPolyline ( toProps . track . slice ( fromProps . track . length - 1 ) , paramsForMultiPolyline ( this . props ) ) : _leaflet2 . default . multiColorsPolyline ( toProps . track . filter ( function ( item ) {
356
356
return Number ( item . t ) > Number ( fromProps . track [ fromProps . track . length - 1 ] . t ) ;
357
357
} ) , paramsForMultiPolyline ( this . props ) ) ;
358
358
var keys = Object . keys ( newPointsPolyline . _layers ) ;
@@ -475,7 +475,7 @@ var LeafletReactTrackPlayer = function (_MapLayer) {
475
475
className : "tp_track-line_active"
476
476
} )
477
477
) ,
478
- _react2 . default . createElement (
478
+ this . props . showDots ? _react2 . default . createElement (
479
479
"div" ,
480
480
{
481
481
className : "tp_track-points" ,
@@ -491,7 +491,7 @@ var LeafletReactTrackPlayer = function (_MapLayer) {
491
491
maxDistance : this . state . maxDistance ,
492
492
durationTrack : this . state . durationTrack
493
493
} )
494
- )
494
+ ) : null
495
495
)
496
496
) : null
497
497
) ;
@@ -502,7 +502,6 @@ var LeafletReactTrackPlayer = function (_MapLayer) {
502
502
} ( _reactLeaflet . MapLayer ) ;
503
503
504
504
LeafletReactTrackPlayer . defaultProps = {
505
- track : [ ] ,
506
505
useControl : true ,
507
506
useInformationPanel : false ,
508
507
optionMultyIdxFn : function optionMultyIdxFn ( ) { } ,
@@ -516,6 +515,7 @@ LeafletReactTrackPlayer.defaultProps = {
516
515
progressFormat : "default" ,
517
516
startPosition : 0 ,
518
517
streamData : false ,
518
+ showDots : false ,
519
519
callbackFinish : function callbackFinish ( ) { } ,
520
520
callbackPrev : function callbackPrev ( ) { } ,
521
521
callbackNext : function callbackNext ( ) { } ,
@@ -541,6 +541,7 @@ LeafletReactTrackPlayer.propTypes = {
541
541
callbackFinish : _propTypes2 . default . func ,
542
542
startPosition : _propTypes2 . default . oneOfType ( [ _propTypes2 . default . string , _propTypes2 . default . number ] ) ,
543
543
streamData : _propTypes2 . default . bool ,
544
+ showDots : _propTypes2 . default . bool ,
544
545
callbackNext : _propTypes2 . default . func ,
545
546
callbackPrev : _propTypes2 . default . func ,
546
547
callbackSpeed : _propTypes2 . default . func ,
0 commit comments