如何在Android应用中绘制类似于Google Map的多边形? [英] How to draw a polygon like google map in android app?

查看:114
本文介绍了如何在Android应用中绘制类似于Google Map的多边形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的城市的地方创建一个地图应用,我想在该地方周围绘制一个多边形.
我在网络google地图中有一个我的应用想法示例,如下图所示:
我该怎么做?

I am creating a map app for a place for my city and i want to draw a polygon around that place.
i have a example of my app idea in web google map like this picture:
How can i do like this ?

推荐答案

原始文档对

Original documentation has clear explanation for Polygon API. All that you need to do is use this method with own coordinates and colors:

GoogleMap map;
// ... get a map.
// Add a triangle in the Gulf of Guinea
Polygon polygon = map.addPolygon(new PolygonOptions()
    .add(new LatLng(0, 0), new LatLng(0, 5), new LatLng(3, 5), new LatLng(0, 0))
    .strokeColor(Color.RED)
    .fillColor(Color.BLUE));

这篇关于如何在Android应用中绘制类似于Google Map的多边形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆