diff --git a/example/lib/click_annotations.dart b/example/lib/click_annotations.dart index 93a5a41b..b3f2bb3e 100644 --- a/example/lib/click_annotations.dart +++ b/example/lib/click_annotations.dart @@ -80,8 +80,10 @@ class ClickAnnotationBodyState extends State { } Future _onStyleLoaded() async { - await addImageFromAsset( - controller!, "custom-marker", "assets/symbols/custom-marker.png"); + if (controller != null) { + await addImageFromAsset( + controller!, "custom-marker", "assets/symbols/custom-marker.png"); + } controller!.addCircle( const CircleOptions( geometry: LatLng(-33.881979408447314, 151.171361438502117), diff --git a/example/lib/layer.dart b/example/lib/layer.dart index c2cbac78..3b515ab5 100644 --- a/example/lib/layer.dart +++ b/example/lib/layer.dart @@ -145,11 +145,10 @@ class LayerState extends State { controller.onFeatureTapped.add(onFeatureTap); } - void onFeatureTap( - dynamic featureId, Point point, LatLng latLng, String layerId) { + void onFeatureTap(dynamic featureId, Point point, LatLng latLng) { final snackBar = SnackBar( content: Text( - 'Tapped feature with id $featureId on layer $layerId', + 'Tapped feature with id $featureId on layer', style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), backgroundColor: Theme.of(context).primaryColor, diff --git a/example/lib/sources.dart b/example/lib/sources.dart index 265a7b7f..dfa5ce96 100644 --- a/example/lib/sources.dart +++ b/example/lib/sources.dart @@ -308,7 +308,9 @@ class FullMapState extends State { _onStyleLoadedCallback() async { final styleInfo = _stylesAndLoaders[selectedStyleId]; - styleInfo.addDetails(controller!); + if (controller != null) { + styleInfo.addDetails(controller!); + } controller! .animateCamera(CameraUpdate.newCameraPosition(styleInfo.position)); }