“fillColor”在谷歌地图中不起作用

use*_*787 3 jquery google-maps

我正在尝试申请fillColor这样的折线。在此输入图像描述

但我做不到。这是怎么了?

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

小提琴:https://jsfiddle.net/vL6qpn4w/

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

Dan*_*ack 5

折线不支持填充颜色,因为它们是简单的线条。尝试使用具有填充和描边属性的多边形 - 给出您在上面尝试的内容。 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);
Run Code Online (Sandbox Code Playgroud)

新小提琴:https://jsfiddle.net/c3znthny/1/