MapBox: Changing an existing polygon's color
问题 I'm attempting to use the following code to change the color of a polygon on my MapBox map, after it's already been added to the map. parishPolygon990 = L.polygon([ vertices ], { color: "#0000FF" }).addTo(map); console.log(parishPolygon990); // returns #0000FF console.log(parishPolygon990.options['color']); // returns #0000FF parishPolygon990.options.color = '#d31603'; console.log(parishPolygon990); // returns #d31603 console.log(parishPolygon990.options['color']); // returns #d31603 You can