Skip to content

Commit baec562

Browse files
committed
Restore the disable interaction button
1 parent a1b4b62 commit baec562

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

arcgis_map/example/lib/main.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class _ExampleMapState extends State<ExampleMap> {
6969
bool _baseMapToggled = false;
7070
final initialCenter = LatLng(51.16, 10.45);
7171
final tappedHQ = LatLng(48.1234963, 11.5910182);
72+
var _isInteractionEnabled = true;
7273

7374
@override
7475
void dispose() {
@@ -451,6 +452,20 @@ class _ExampleMapState extends State<ExampleMap> {
451452
),
452453
],
453454
),
455+
ElevatedButton(
456+
onPressed: () {
457+
_controller?.setInteraction(
458+
isEnabled: !_isInteractionEnabled,
459+
);
460+
461+
setState(() {
462+
_isInteractionEnabled = !_isInteractionEnabled;
463+
});
464+
},
465+
child: Text(
466+
"${_isInteractionEnabled ? "Disable" : "Enable"} Interaction",
467+
),
468+
),
454469
ElevatedButton(
455470
onPressed: () {
456471
_routeToVectorLayerMap();

0 commit comments

Comments
 (0)