我想使用geo:显示一些标记:意图在指定位置和缩放级别显示地图。但是我不知道如何在此处添加标记?有人可以帮我吗?
// Creates an Intent that will load a map of San Francisco
Uri gmmIntentUri = Uri.parse("geo:37.7749,-122.4194");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
感谢您的帮助。
尝试以下示例:
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("geo:37.7749,-122.4194?q=37.7749,-122.4194 (San Francisco)"));
// the following line should be used if you want use only Google maps
intent.setComponent(new ComponentName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"));
startActivity(intent);