【问题标题】:How to create a Mini Map in Android Google Maps API v2?如何在 Android Google Maps API v2 中创建迷你地图?
【发布时间】:2014-02-04 20:01:07
【问题描述】:

我想在我的 GoogleMap 上使用一种“迷你地图”。最低要求是创建标记并动态更改缩放(两者)。有没有比用两个片段创建两个 GoogleMap 更简单的方法?

我认为同时使用两个 GoogleMap 会降低性能,我还没有尝试过。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >


    <fragment
        android:id="@+id/miniMap"
        android:name="com.example.presentation.views.MainActivity"
        android:layout_width="300dp"
        android:layout_height="300dp"
        class="com.google.android.gms.maps.MapFragment" />
    <fragment
        android:id="@+id/bigMap"
        android:name="com.example.presentation.views.MainActivity"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        class="com.google.android.gms.maps.MapFragment" />


</RelativeLayout>

【问题讨论】:

  • 我可以告诉你,如果两个 GoogleMap 相互折叠,它们将无法协同工作。

标签: android google-maps android-maps-v2


【解决方案1】:

Google play 服务的示例应用程序自己提供了 4 张地图。 你可以在 Android-sdk 下找到它:

~\android-sdk\extras\google\google_play_services\samples\maps\src\com\example\mapdemo\MultiMapDemoAtivity.java

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-30
    • 2023-03-17
    • 2012-11-26
    相关资源
    最近更新 更多