Polyline
You can animating the polyline with easier code. There is a feature to determine the draw of the animation.
Download#
Create Instance#
Configuration builder#
| Param | type | desc |
|---|---|---|
withPrimaryPolyline(PolylineOptions.() -> Unit) | PolylineAnimatorBuilder | DSL param for add primary polyline |
withAccentPolyline(PolylineOptions.() -> Unit) | PolylineAnimatorBuilder | DSL param for add accent polyline |
withCameraAutoFocus(Boolean) | PolylineAnimatorBuilder | Set for auto zoom camera |
withStackAnimationMode(StackAnimationMode) | PolylineAnimatorBuilder | Set for animate type polyline |
createAnimatePolyline() | PolylineAnimator | to create PolylineAnimator |
Animating polyline#
Start animate polyline#
To start animate use startAnimate(geometries: List<LatLng>, duration: Long) and result is PointPolyline
Start with existing Polyline#
With PolylineOptions
Or with PolylineAnimator
Add points in polyline#
You can added polyline in existing polyline
Remove polyline#
Remove polyline on PointPolyline
Or by geometries
Configuration with DSL#
| Param | return | desc |
|---|---|---|
withPrimaryPolyline(PolylineOptions.() -> Unit) | Unit | DSL param for add primary polyline |
withAccentPolyline(PolylineOptions.() -> Unit) | Unit | DSL param for add accent polyline |
duration | Long | Duration of animation |
cameraAutoUpdate | Boolean | Set for auto zoom camera |
stackAnimationMode | StackAnimationMode | Set for animate type polyline |
polylineDrawMode | PolylineDrawMode | Set for draw type polyline |
enableBorder(isEnable: Boolean, color: Int, width: Int) | Unit | Set for border of polyline |
doOnStartAnimation(action: (LatLng) -> Unit) | Unit | Do action when animation is start |
doOnEndAnimation(action: (LatLng) -> Unit) | Unit | Do action when animation is finish |
doOnUpdateAnimation(action: (latLng: LatLng, mapCameraDuration: Int) -> Unit) | Unit | Do action when animation is update with duration for camera movement |
Stack Animation Mode#
This is animation type of polyline

- Button 1:
StackAnimationMode.BlockStackAnimation(this default configuration) - Button 2:
StackAnimationMode.WaitStackEndAnimation - Button 2:
StackAnimationMode.OffStackAnimation
Polyline draw mode#
This library able to customize polyline draw mode

- Button 1:
PolylineDrawMode.Normal(this default configuration) - Button 2:
PolylineDrawMode.Curved - Button 2:
PolylineDrawMode.Lank