Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the color #158

Open
yansf opened this issue Oct 15, 2019 · 3 comments
Open

How to change the color #158

yansf opened this issue Oct 15, 2019 · 3 comments

Comments

@yansf
Copy link

yansf commented Oct 15, 2019

Hi,

I like very much this library! and I need to change the fill color of the polygon, May I ask how to modify it now??

@yansf
Copy link
Author

yansf commented Oct 15, 2019

i use the leaflet-freedraw.iife.js library, everything is fine except that there is no Attach Elbows button, why?

@AndreasOlausson
Copy link

Override the css?
.leaflet-polygon {
fill: #ff0000;
fill-opacity: 0.5;
stroke: #50622b;
}

@virtuoso98
Copy link

virtuoso98 commented Jun 20, 2021

So for this issue, I think that the suspect line is over here in line 73 to line 75 of helpers/polygon.js: https://github.com/Wildhoney/Leaflet.FreeDraw/blob/master/src/helpers/Polygon.js#L73

Based on this, it seems as if the options are passed directly to the polygon. Therefore, if you modify the options that u pass into the FreeDraw Layer like
options.color = "red", then your polygon colour should be able to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants