Im using below code to launch map in flutter of specified location but the map showing coordinates instead.
launchUrl(
Uri.parse('https://www.google.com/maps/search/?api=1&query=${locationLat},${locationLong}'),
mode: LaunchMode.externalApplication);
How to show place name while displaying map.
2
Answers
If you want the map to show the location, you should specify the location name instead of the coordinates in the query argument, start by encoding the name.
If you only have the coordinates and do not know the location name, then you can use geocoding https://pub.dev/packages/geocoding to get places infos:
BONUS
If the Google map application is installed on the device, you can use intent action for Android https://developers.google.com/maps/documentation/urls/android-intents and IOS https://developers.google.com/maps/documentation/urls/ios-urlscheme so it will open the Google map application instead of the web page.
The full code will look like:
I hope it will help 🙂
Try this simple code