【问题标题】:How to show map in smaller android screen size?如何在较小的 android 屏幕尺寸中显示地图?
【发布时间】:2017-02-24 02:35:28
【问题描述】:

如何让我的地图仅显示在 Android 设备的上半屏上?我做了一个片段,但它显示全屏。到目前为止,我已经这样做了。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_custom_map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="br.com.medicomap.MapContainerActivity">


    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="235dp"
        android:id="@+id/containerInfo"></LinearLayout>

    <FrameLayout
    android:id="@+id/containerMap"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

</LinearLayout>[

【问题讨论】:

  • 您需要的是标记聚类。在此处阅读文档。 developers.google.com/maps/documentation/android-api/utility/…
  • t 必须是每个地方的一张地图。它类似于那些显示例如餐厅、说出地址、食物种类的应用程序,下面是显示位置的地图。
  • 分享你想要达到的目标?
  • 刚刚添加了我想要的布局的屏幕。我无法在片段顶部添加小地图。
  • 您可以在屏幕的上半部分放置地图片段,底部布局可以是动态文本。点击标记可以更改底部的文本。

标签: android google-maps containers


【解决方案1】:

您可以分配权重或使用百分比相对布局,这样它就不会占用全屏或设置一些宽度Google map in android,display in small size mapview

【讨论】:

    【解决方案2】:

    如果您正在考虑在设备上使用 Google 地图应用程序,那么您可以使用外部链接将用户重定向到具有特定位置的 Google 地图应用程序。使用这个

    https://www.google.com/maps/?q=11.4866901,99.1050785

    其中Latitude 是11.4866901,Longitude 是99.1050785。

    【讨论】:

    • 不是我想要的。我真的需要它在应用程序中打开,连同地点地址和信息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-19
    • 1970-01-01
    • 2016-01-03
    • 2019-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多