我正在使用Firebase作为后端创建一个游览应用程序。我需要知道如何在标记上指定特定的位置吗?
Intent i = new Intent (Intent.ACION_VIEW)
像这样,还是有其他与标记有关的方法吗?
尝试使用此示例来启动具有特定纬度和经度的Google map
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);
谢谢兄弟,我会尝试这个告诉你