Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile error #537

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions example/lib/click_annotations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ class ClickAnnotationBodyState extends State<ClickAnnotationBody> {
}

Future<void> _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),
Expand Down
5 changes: 2 additions & 3 deletions example/lib/layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,10 @@ class LayerState extends State {
controller.onFeatureTapped.add(onFeatureTap);
}

void onFeatureTap(
dynamic featureId, Point<double> point, LatLng latLng, String layerId) {
void onFeatureTap(dynamic featureId, Point<double> 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,
Expand Down
4 changes: 3 additions & 1 deletion example/lib/sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ class FullMapState extends State<FullMap> {

_onStyleLoadedCallback() async {
final styleInfo = _stylesAndLoaders[selectedStyleId];
styleInfo.addDetails(controller!);
if (controller != null) {
styleInfo.addDetails(controller!);
}
controller!
.animateCamera(CameraUpdate.newCameraPosition(styleInfo.position));
}
Expand Down
Loading