我从这个链接找到了这个代码https://developers.google.com/maps/documentation/android/shapes#customizing_appearances https://developers.google.com/maps/documentation/android/shapes#customizing_appearances
Polyline line = map.addPolyline(new PolylineOptions()
.add(new LatLng(-37.81319, 144.96298), new LatLng(-31.95285, 115.85734))
.width(25)
.color(Color.BLUE)
.geodesic(true));
我的问题是Color in 颜色.蓝色返回错误,指出名称 Color 在当前上下文中不存在。
只需在您的中定义一种颜色colors
资源文件并执行以下操作:
PolylineOptions rectLine = new PolylineOptions().width(4).color(context.getResources().getColor(R.color.cyan));
对我来说效果很好。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)