简体   繁体   English

在圆圈内显示地图

[英]Showing map inside a circle

I am working on a project where i need to have a map to be shown inside a circle.How can i show a mapview inside a circle. 我正在做一个需要在圆圈内显示地图的项目。如何在圆圈内显示mapview。 在此处输入图片说明

You can compose the layout with a FrameLayout. 您可以使用FrameLayout构成布局。 The first item must be the MapView and then an ImageView referencing a png with that circle transparent. 第一项必须是MapView,然后是ImageView,该ImageView引用带有透明圆圈的png。 Hope that helps. 希望能有所帮助。

Edited to add an example: 编辑后添加一个示例:

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

    <com.google.android.maps.MapView
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:apiKey="whateverYourApiKeyIs"/>

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/fullSizeImageWithTransparentCircle"/>

</FrameLayout>

Since you write such a bad question. 既然你写了这么一个坏问题。 Allow me to answer in the same style. 请允许我以相同的方式回答。
Take a mapview. 进行mapview。
Style it with round corners 圆角样式

I'll even give you a link to round corners 我什至会给你一个圆角链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM