Reputation: 1296
I'm working on an app that uses the google_maps_flutter plugin (version 0.5.7) to display a map. It was working just perfectly until yesterday. I didn't do any updates to my app, it just stopped displaying a blank map when I opened it today. Flutter Doctor doesn't show any problem, and the same with Flutter Analyze. The plugin seems to be partially working, because I'm using the GoogleMap
onTap
property to show the coordinates of the location tapped, and it works just fine (I/flutter (11935): LatLng(25.895589930847475, -80.28307791799307)
, although the marker is not created.
_handleTap(LatLng point) {
setState(() {
print(point);
_markers.add(Marker(
markerId: MarkerId(point.toString()),
position: point,
infoWindow: InfoWindow(
title: point.toString(),
),
icon: BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueMagenta),
));
});
}
Any ideas, what could be happening? Has any issue been reported for this plugin that could cause this issue?
Upvotes: 6
Views: 7302
Reputation: 173
It might be because of Connectivity problem in Emulator(wifi/internet)
Change the DNS address of your network to 8.8.8.8 (Google's DNS) or another of your preference:
MacOSX:
Open "System Preferences" Click on "Network" Select the network which your computer is connected click on "Advanced" Select "DNS", Select the "+" button, type "8.8.8.8" (Google's DNS) or if you prefer OpenDNS, "208.67.222.222" Select "Ok" and "Apply"
Windows & Linux: https://developers.google.com/speed/public-dns/docs/using
After that close the emulator and start it again.
Upvotes: 3
Reputation: 729
I would suggest going back to the API keys you created in step 3 and then restricting one to iOS apps and the Maps SDK for iOS and the other to Android and the Maps SDK for Android.
[1]: https://cloud.google.com/console/google/maps-apis/overview
Upvotes: 6
Reputation: 980
I did have a similar problem in iOS. Make sure you enable both apis in google developers console. maps for iOS and maps for Android. Key can be shared or generate for each platform.
Upvotes: 1