Closed eprtha closed 3 weeks ago
Hi @eprtha
There is a function called setStrokeColor
So you could change the color like this: polygon.setStrokeColor('#0f0')
I don't see any native way to set the width of the stroke. But can't you draw a new polygon over the old one, with a different color/width, and then destroy the old polygon?
Thanks for the response. Current routine does as you advised. polygon.setStrokeColor('#0f0') works well. I really appreciate your help.
A polygon is added to the map as follows. polygon = WE.polygon(boundarydata, { color: '#000080', fillOpacity: 0, weight: 1 // Border weight in pixels }).addTo(map);
How to change the color and weight of the polygon later? I have tried as follows but seems like WebGL Earth doesn't support setStyle. polygon.setStyle({ color: '#00FF00', // New border color (green) weight: 3 // Border weight in pixels });
Thanks in advance.