gpt4 book ai didi

jquery - `fillColor` 在谷歌地图中不起作用

转载 作者:行者123 更新时间:2023-12-01 08:41:53 24 4
gpt4 key购买 nike

我正在尝试对这样的折线应用fillColorenter image description here

但我做不到。这里出了什么问题?

poly = new google.maps.Polyline({
strokeColor: '#00DB00',
strokeOpacity: 1.0,
strokeWeight: 3,
fillColor: 'green',
fillOpacity: 0.05
});
poly.setMap(map);

fiddle :https://jsfiddle.net/vL6qpn4w/

疑问:如何使用我的代码绘制多边形?

最佳答案

多段线不支持填充颜色,因为它们是简单的线。尝试使用具有填充和描边属性的多边形 - 给出您在上面尝试的内容。 https://developers.google.com/maps/documentation/javascript/shapes#polygons

poly = new google.maps.Polygon({
strokeColor: '#00DB00',
strokeOpacity: 1.0,
strokeWeight: 3,
fillColor: 'green',
fillOpacity: 0.05 //Increase this to make the green background darker
});
poly.setMap(map);

新 fiddle :https://jsfiddle.net/c3znthny/1/

关于jquery - `fillColor` 在谷歌地图中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46148613/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com