Skip to content
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

Bug: offset=0 offsets text by width of stroke #73

Open
plepe opened this issue Dec 24, 2018 · 1 comment
Open

Bug: offset=0 offsets text by width of stroke #73

plepe opened this issue Dec 24, 2018 · 1 comment

Comments

@plepe
Copy link

plepe commented Dec 24, 2018

I found a bug, that an offset by 0 offsets the text by the width of stroke. According to the code, this should be the default when no offset is set.

Example:
bug73

@plepe
Copy link
Author

plepe commented Dec 24, 2018

New output:
bug73-resolved

Test code:

        var map = L.map('map')
                   .setView([ 50, 15 ], 5)

        for (var i = -3; i <= 3; i++) {
          var line = L.polyline([[ 50 + i, 10 ], [ 50 + i, 21 ]], {
                      weight: 7,
                      color: '#8EE9FF'
                  }).addTo(map);
          line.setText('  offset ' + i, {repeat: true,
                              offset: i,
                              attributes: {fill: '#007DEF',
                                           'font-weight': 'bold',
                                           'font-size': '12'}});
        }

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

No branches or pull requests

1 participant