class MapUtility {
static Future<void> openLocation(String placeId) async {
Uri googleUrl =
Uri.parse('https://www.google.com/maps/place/?q=place_id:$placeId');
if (!await launchUrl(googleUrl)) {
throw Exception("Could not open google map");
}
}
}
字符串
我尝试用place id打开google map,但是android不支持,在ios中Map可以完美的打开,但是在android中我在搜索栏得到place_id:<place's id>
。
屏幕截图从android设备:
的数据
1条答案
按热度按时间9rygscc11#
你可以使用map_launcher flutter来启动带有place_id的googleMap。
看看这里的额外参数。
编辑:不要忘记遵循URL指南here