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

New parameter for setting custom class to the parameter #7

Closed
Arxi opened this issue Aug 7, 2014 · 1 comment
Closed

New parameter for setting custom class to the parameter #7

Arxi opened this issue Aug 7, 2014 · 1 comment

Comments

@Arxi
Copy link

Arxi commented Aug 7, 2014

Could you please add a new parameter to the EasyButton creation? It would allow for a setting of a custom class to the element of the control.

Options in L.Control.EasyButtons would look something like this:

options: {
    position: 'topleft',
    title: '',
    intentedIcon: 'fa-circle-o',
    customBtnClass: ''
},

and then in the onAdd function:

this.link = L.DomUtil.create('a', 'leaflet-bar-part ' + this.options.customBtnClass, container);

and then of course the appropriate new parameter in the L.easyButton function.

Thank you very much!

@atstp
Copy link
Contributor

atstp commented May 14, 2015

Implementation isn't as mentioned above, but the idea's supported in v1. Thanks for mentioning it!

Since there aren't any docs yet

This chunk of js (with v1):

L.easyButton('fa-circle-o your-custom-css-class', callback);

would generate an icon like this:

<!-- stuff above -->
    <span class="fa-circle-o your-custom-css-class fa fa-lg"></span>
<!-- stuff below -->

@atstp atstp closed this as completed May 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants