-
Notifications
You must be signed in to change notification settings - Fork 134
fix(Markers): fix marker icon broken with latest Leaflet version (1.0) #299
Conversation
Leaflet now tries to auto-detect the path for the icons, but when using a base64 one, it breaks. Thus, we need to force the imagePath to be ' '. See this line in Leaflet source: https://github.com/Leaflet/Leaflet/blob/master/src/layer/marker/Icon.Default.js#L36
Anyway you can add a spec to assert this fix stay around? |
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.
Unit tests to make sure base64 icons work.
Where should I add this test? |
coffeescript? 😢 |
Seriously?, coffee is not much different then js, learn something new please. Otherwise add a Coffee is not end of the world. |
@ValentinH don't worry, you can write test in JS, but the new ES6 or ES7 looks like Coffee, but keep in coffee tests that are in coffee. You could use http://js2.coffee/ |
Sorry, I was a bit trolling! 👿 But I think that having tests in Coffeescript is not really good to encourage new contributors to provide tests with their PR. Indeed, Coffeescript is not really use anymore today... |
Don't worry, I will do it in coffee when I have some time. |
I think that we have to go ES6 or ES7, but change all coffee specs requires a lot of work. @ValentinH if you want you can translate this test to JS, but takes full advantages of ES6. |
What do you mean by take full advantages? |
@ValentinH I mean that use arrow functions, template strings, classes, etc. Obviously where needed. |
I think the master branch already supports babel, so you can write ES6 there. I just prefer Coffee for specs cause its a whole lot less hassel for nested bracket and variable declaration. Plus I wrote a lot of the specs and to get them done fast I chose coffee. I still don't think ES6 is like coffee at all the arrow function means something much different in ES6 since you cant call apply or call to pass a different |
Actually, I don't know how to test this. Currently, there is no test for marker/icon creations so I can't really understand from where to start. Thus, I wont' add test in this PR. |
OK, I'll merging the change and I'll do this test. Thanks @ValentinH |
Leaflet now tries to auto-detect the path for the icons, but when using a base64 one, it breaks.
Thus, we need to force the imagePath to be ' '.
See this line in Leaflet source: https://github.com/Leaflet/Leaflet/blob/master/src/layer/marker/Icon.Default.js#L36
Broken demo: http://jsfiddle.net/ar2bo629/
Fixed Demo: http://jsfiddle.net/f7bq9v6b/