Skip to content

Conversation

azuledu
Copy link

@azuledu azuledu commented Nov 7, 2013

Label position in OL SVG renderer is set using the 'baseline-shift' property but this property does not work in IE as can be check here:
http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-text-align-02-b.html
As a workaround, the 'dy' property can be used to get a similar result. Explained here: http://nelsonslog.wordpress.com/2011/09/12/svgtext-baseline-considered-harmful/

@azuledu
Copy link
Author

azuledu commented Nov 8, 2013

@metteo
Copy link

metteo commented Dec 2, 2013

The issue is also visible on ie11 (win7) with ol 2.12. Adding manually dy=".35em" (as in the commit) to tspan node in @adube's example helps (using ie dev tools) - this is the simplest case: single row labels.

EDIT: After debugging I noticed openlayers detects ie11 as mozilla so the commit won't work (it is still needed since the bug is still present in ie11). More info: http://blogs.msdn.com/b/ieinternals/archive/2013/09/21/internet-explorer-11-user-agent-string-ua-string-sniffing-compatibility-with-gecko-webkit.aspx

@sanak
Copy link

sanak commented Dec 27, 2013

I fixed those issues in my forked branch (https://github.com/sanak/openlayers/tree/labels-IE-svg2)
and confirmed that it works correctly on IE11.
Could someone review my fix?
sanak@f0aebdd

@jleh jleh mentioned this pull request Sep 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants