-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Icon size x can now be initialised with a number #4608
Conversation
var sizeOption = options[name + 'Size']; | ||
|
||
if (!L.Util.isArray(sizeOption)) { | ||
options[name + 'Size'] = [options[name + 'Size'], options[name + 'Size']]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use sizeOption
here twice for shorter code, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you're overwriting the original options object, which is undesirable. Instead you could redefine sizeOption
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - both of your comments have been implemented in the latest commit.
Not sure about this. I'd rather extend the |
@IvanSanchez I'm not in favor of |
expect(beforeIcon).to.be(afterIcon); | ||
expect(afterIcon.src).to.contain(icon2._getIconUrl('icon')); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not looking at the whole file, but it looks like line 61 to 74 was accidentally duplicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right. I'll update the pull request to correct this tomorrow. Thanks.
Icon size can now be passed as a single numeric as well as the [x, y]. Additional tests added to cover new parameter option.
Fixes #3185