-
-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf!: add simplification and segment culling to
PolylineLayer
& si…
…mplification to `PolygonLayer` (#1704) Co-authored-by: Luka S <[email protected]>
- Loading branch information
1 parent
b94de88
commit 24ceb32
Showing
13 changed files
with
840 additions
and
324 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:latlong2/latlong.dart'; | ||
import 'package:meta/meta.dart'; | ||
|
||
/// Result emmitted by hit notifiers (see [LayerHitNotifier]) when a hit is | ||
/// detected on a feature within the respective layer | ||
/// | ||
/// Not emitted if the hit was not over a feature. | ||
@immutable | ||
class LayerHitResult<R extends Object> { | ||
/// `hitValue`s from all features hit (which have `hitValue`s defined) | ||
/// | ||
/// If a feature is hit but has no `hitValue` defined, it will not be included. | ||
/// | ||
/// Ordered by their corresponding feature, first-to-last, visually | ||
/// top-to-bottom. | ||
final List<R> hitValues; | ||
|
||
/// Coordinates of the detected hit | ||
/// | ||
/// Note that this may not lie on a feature. | ||
final LatLng point; | ||
|
||
@internal | ||
const LayerHitResult({required this.hitValues, required this.point}); | ||
} | ||
|
||
/// A [ValueNotifier] that notifies: | ||
/// | ||
/// * a [LayerHitResult] when a hit is detected on a feature in a layer | ||
/// * `null` when a hit is detected on the layer but not on a feature | ||
typedef LayerHitNotifier<R extends Object> = ValueNotifier<LayerHitResult<R>?>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.