PolylineSimplifierOptions.withMaxPointsAndTolerance constructor - PolylineSimplifierOptions - core library - Dart API
PolylineSimplifierOptions.withMaxPointsAndTolerance
PolylineSimplifierOptions.withMaxPointsAndTolerance constructor
- int maxPoints,
- int simplificationToleranceInMeters
Creates options with explicitly specified PolylineSimplifierOptions.maxPoints and PolylineSimplifierOptions.simplificationToleranceInMeters.
maxPointsSets the upper limit on the resulting collection for the PolylineSimplifier.simplify. Lower value results in the lower accuracy of the resulting polyline. IfmaxPointsis less than2then resulting polyline will not have an upper limit on the size and only PolylineSimplifierOptions.simplificationToleranceInMeters will be considered. WhenmaxPointsis greater than size of the passed polyline then simplification algorithm will take into account only PolylineSimplifierOptions.simplificationToleranceInMeters.simplificationToleranceInMetersSets the accuracy limit for the PolylineSimplifier.simplify:- higher tolerance results in more simplification (fewer points);
- lower tolerance keeps the line closer to its original shape.
If removing a point produces polyline, which deviates from the
original one more than simplificationToleranceInMeters, then
this point is left in the collection.
If specified tolerance will not allow to create a polyline
conforming to PolylineSimplifierOptions.maxPoints, then simplificationToleranceInMeters
is ignored.
Default value is equal to PolylineSimplifierOptions.simplificationInMeters14ZoomLevel.
Implementation
PolylineSimplifierOptions.withMaxPointsAndTolerance(this.maxPoints, this.simplificationToleranceInMeters);