Skip to content

Commit bbaca6e

Browse files
Disable tapping while an identify operation is in progress (#192)
1 parent 4baaf29 commit bbaca6e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/samples/identify_features_in_wms_layer/identify_features_in_wms_layer.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ class _IdentifyFeaturesInWmsLayerState extends State<IdentifyFeaturesInWmsLayer>
121121
}
122122

123123
void onTap(Offset localPosition) async {
124+
// Prevent addtional taps until the identify operation is complete.
125+
setState(() => _ready = false);
126+
124127
// When the map view is tapped, perform an identify operation on the WMS layer.
125128
final identifyLayerResult = await _mapViewController.identifyLayer(
126129
_wmsLayer,
@@ -148,6 +151,9 @@ class _IdentifyFeaturesInWmsLayerState extends State<IdentifyFeaturesInWmsLayer>
148151
showResultsDialog();
149152
}
150153
}
154+
155+
// Allow additional taps.
156+
setState(() => _ready = true);
151157
}
152158

153159
void showResultsDialog() {

0 commit comments

Comments
 (0)