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
Strange + and - characters on zoom controls #164
Comments
You're quite right - it is because the zoom controls are generated as links with +/- as the text which are then supposed to be styled to generate the actual buttons. But @jfirebaugh used a different style that uses images instead, but the text is still there, and I don't see any way of getting rid of it just with styling... |
So it was OK until I updated zoomslider to fix IE8 which also pulled in kartena/Leaflet.zoomslider@40adeee which assigns the text to those links and causes this breakage. What I'm unclear about is how zoomslider was generating it's default icons before that... |
One possible fix is:
|
I've pushed 5edb4bf as a workaround for now. |
Prior to kartena/Leaflet.zoomslider@fcd9662 the zoomslider was using pngs for +/-. |
Pushed 4a26107 based on @jfirebaugh's |
Actually there is a better method than using the -9999px hack, which causes performance issues as the browser has to draw a box that far off screen. .hide-text { take from: |
http://37signals.com/svn/posts/3126-another-9999px is another explanation and slight variation. |
Hi all! I'm the maintainer of Leaflet.zoomslider at Kartena. |
The extra complication is that the version of leaflet we're using isn't really 0.4 or 0.5 at the moment, but rather some random commit from the master branch ;-) |
:) I see. Been there. if(link.style.background.match("url(") == null) { // or null, undefined or whatever
link.innerHtml = plusOrMinus;
} ...would be the correct fix. |
The modified workaround introduced in 3d40181 doesn't seem to fix this properly (Opera, Chrome still render the +/- icons). This is because it doesn't really make sense to use But, as we already know the width of the object in question, one could simply use that fixed value |
I'll probably implement the option later today, meanwhile if you have a suggestion for a name... :) |
Merged a fix for this now that moves the +/- symbols into the CSS instead (where it is more easily overridable). |
Don't know if it is just me, but on the "+" and "-" zoom controls there seems to be a small "+"/"-" text character overlaid on the graphic, which (if you look closely) gains an underline on a mouseover.
The text was updated successfully, but these errors were encountered: