Android 如何在谷歌地图上标记特定位置?
我正在创建一个以Firebase为后端的旅游应用程序。我需要知道如何在一个特定的位置使用标记Android 如何在谷歌地图上标记特定位置?,android,firebase,android-recyclerview,maps,Android,Firebase,Android Recyclerview,Maps,我正在创建一个以Firebase为后端的旅游应用程序。我需要知道如何在一个特定的位置使用标记 Intent i=new Intent(Intent.ACION\u视图)像这样,或者有其他方法可以处理上面的标记吗?尝试使用此示例启动具有特定Lat和Lng的google地图 public void gotToLocation(String markerName,Float latitude, Float longitude ) { String uri = String.format(Loc
Intent i=new Intent(Intent.ACION\u视图)
像这样,或者有其他方法可以处理上面的标记吗?尝试使用此示例启动具有特定Lat和Lng的google地图
public void gotToLocation(String markerName,Float latitude, Float longitude ) {
String uri = String.format(Locale.ENGLISH, "geo:0,0?q=%f,%f(%s)", latitude,longitude,markerName);
Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));;
mapIntent.setPackage("com.google.android.apps.maps");
if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {
startActivity(mapIntent);
}
}
那就这样说吧
gotToLocation("MyLocation",34.99,-106.61);
您好,您可以使用谷歌文档。
上面的示例在谷歌悉尼办事处的位置显示了一个标签谢谢兄弟,我会试试这个,然后告诉你Hanks兄弟,我会试试这个,然后告诉你
Uri gmmIntentUri = Uri.parse("geo:0,0?q=-33.8666,151.1957(Google+Sydney)");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);