我想在构建后更改分配给Leaflet折线的选项(然后呈现它)。
这是可能的吗?
// Add polyline
var polyline = L.polyline([], {weight:weight, opacity:1, color:'gray'}).addTo(map);
// Attempts to change color
polyline.options.color = 'blue' // doesn't render
polyline.options.color('blue') // throws error
polyline({color:'blue'}) // throws error
polyline._updateStyle(polyline) // throws error: not sure how exactly this works
polyline._updateStyle() // throws error
polyline({color:blue}) // throws error
这是可能的吗?