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

RadialMeterMarker overwrites options with backgroundStyle options? #96

Open
trillerpfeife opened this issue Sep 14, 2016 · 5 comments
Open
Labels

Comments

@trillerpfeife
Copy link

trillerpfeife commented Sep 14, 2016

L.RadialMeterMarker draws a marker with given options but returns wrong options. For example:

var options = {
   ...
   fillOpacity: 1,
   opacity: 1,
   ...
}
L.RadialMeterMarker(latlng, options);

Returns a marker with following options:

options: {
   ...
   fillOpacity: 0.2
   Opacity: 0.8
   ...
}

I think due to the "Add a background" implementation the option properties will be overwritten, right?

for (var property in this.options.backgroundStyle) {
  options[property] = this.options.backgroundStyle[property];
}

options[property] = this.options.backgroundStyle[property];

In issue #7 I made a fiddle to show that it will break the redraw() function

@sfairgrieve
Copy link
Contributor

Thanks for pointing this out. Let me see if I can figure out what's going on. I'll try to push an update soon.

@trillerpfeife
Copy link
Author

Thanks for the fast response. I also hat issues with redrawing L.RadialBarChartMarker, after every redraw the size increases.

sfairgrieve pushed a commit that referenced this issue Sep 14, 2016
@sfairgrieve
Copy link
Contributor

Pushed a potential fix to this branch: https://github.com/humangeo/leaflet-dvf/tree/feature/chartmarkerfix

Can you give this a try when you get a chance and let me know if that fixes things for you?

@sfairgrieve
Copy link
Contributor

@trillerpfeife Did that fix work for you?

@trillerpfeife
Copy link
Author

Thanks @sfairgrieve for the fix. I ended up making my own pie chart marker based on https://github.com/iatkin/leaflet-svgicon due to extend it in various ways.

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

No branches or pull requests

2 participants