【发布时间】:2021-07-03 21:29:37
【问题描述】:
有人知道如何在我的多边形坐标中设置不透明度颜色,我只希望我的多边形中的黑色背景将颜色设置为具有不透明度颜色的紫色 和多边形的边界也是一样的。有可能吗?如果有人能弄清楚,那就太好了,非常感谢您!
我的多边形
Set<Polygon> myPolygon() {
List<LatLng> polygonCoords = new List();
polygonCoords.add(LatLng(8.9442, 125.5321));
polygonCoords.add(LatLng(8.9486, 125.5364));
polygonCoords.add(LatLng(8.9303, 125.5384));
polygonCoords.add(LatLng(8.9442, 125.5321));
Set<Polygon> polygonSet = new Set();
polygonSet.add(Polygon(
polygonId: PolygonId('test'),
points: polygonCoords,
strokeColor: Colors.red)); //color of the border
return polygonSet;
}
我的谷歌地图
@override
Widget build(BuildContext context){
return Scaffold(
backgroundColor: Colors.deepOrange,
appBar: AppBar(
title: Text('Google Map API'),
),
body:Padding(
padding: EdgeInsets.only(bottom: 16.0),
child: GoogleMap(
onMapCreated: _onMapCreated,
polygons: myPolygon(), markers: _markers,
mapType: MapType.normal,
initialCameraPosition:CameraPosition(target: LatLng(8.9405, 125.5364),
zoom: 15,
))
),
);
}
【问题讨论】:
标签: android api flutter android-studio google-maps