Android:循环Google Map片段

Android:循环Google Map片段

问题描述:

我正在Android应用中使用Google Map片段.但是,我需要像下面这样圆形.我该如何实施?

I am using Google Map fragment in my Android app. But, I need to be circular in shape like below. How can I implement it?

地图片段代码段为:

<fragment
            android:id="@+id/map"
            android:name="com.google.android.gms.maps.SupportMapFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />

如果您不需要交互式地图(无需滑动,缩放等),则可以使用Google Static Maps API,该API为您提供所请求地图的图像: https://developers.google.com/maps/documentation /static-maps/

If you don't need the map to be interactive (no swiping, zooming, etc.), then you could use the Google Static Maps API which gives you an image of the requested map: https://developers.google.com/maps/documentation/static-maps/

然后,您可以将该图像放入ImageView内,并在其上应用圆形蒙版(您可以在StackOverflow上找到很多示例)

Then you could put that image inside and ImageView, and apply a circular mask on it (you can find lot's of examples for that on StackOverflow)