Norkart / Leaflet-MiniMap

A minimap control plugin for Leaflet
BSD 2-Clause "Simplified" License
395 stars 125 forks source link

Revamp the minimising icon #75

Closed robpvn closed 9 years ago

robpvn commented 9 years ago

We want to solve issues #56 and #73, and we'll do it like this:

robpvn commented 9 years ago

I decided to go over to using only SVGs, so there's no need for PNG generation (this I decided after having implemented it of course). That will mean that the toggle button will stop working in IE8, but that browser isn't supported anymore from what I know. Technically this will be a breaking change, so to stick to semver the version number will be bumped to 2.0! :birthday:

robpvn commented 9 years ago

All done, hurray for SVG!

brunob commented 9 years ago

Hi @robpvn : just a question about performances, using an svg make a hit of 7 833 bits instead of 219 bits for the png. Maybe it would be better to use two differents png image for normal and retina display (as done in leaflet core). Any thoughts about it ?

brunob commented 9 years ago

@robpvn any thoughts about my last comment ?

robpvn commented 9 years ago

Sorry, I guess I forgot to answer! Well, the reason is because you can set what size the icon is supposed to be in code. See the "different_minimised" example to see it in action.

The SVG is minimised to 1720 bytes in the dist version though, so it isn't as bad as the source file.

brunob commented 9 years ago

@robpvn no problem, i know what's the point of using svg ;) Sorry but i've missed the point that the file is "only" 1720 bytes in dist folder (it's "just" nearly 8 times bigger than the png).

robpvn commented 9 years ago

Well, I like SVGs because they scale cleanly through all possible desired sizes (the diagonal edges mean PNGs won't scale as nicely), and I don't think the extra hit is that much of a problem. If you can find a solution where we can both have our pie and eat it I'm open to suggestions, but I don't like having lots of different icon files for different sizes.

brunob commented 9 years ago

It' ok for me like that :) The ideal solution would be to use a classic png and a -2x.png + an option to use the svg all the time, but this force us to use 3 different size...