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

bindPopup lost when setting text #28

Open
brunoaduarte opened this issue May 14, 2015 · 2 comments
Open

bindPopup lost when setting text #28

brunoaduarte opened this issue May 14, 2015 · 2 comments
Labels

Comments

@brunoaduarte
Copy link

var popup = new L.popup({ minWidth: 400, closeButton: false, autoPanPaddingTopLeft: L.point(0, 50) });
layer = L.polyline(points, {color: color, weight: 5});
layer.bindPopup(popup);
layer.on('mouseover', function(e) {
this.setText(' ► ', {repeat: true, attributes: {fill: textColor.toHexString() }});
});
layer.on('mouseout', function(e) {
this.setText(null);
});

The popUp doesn't work anymore if this.setText is executed.

@leplatrem
Copy link
Collaborator

I believe this is related to #8
and the fact that events are bound to text path node.

This https://github.com/makinacorpus/Leaflet.TextPath/blob/gh-pages/leaflet.textpath.js#L129
might conflict with this:
https://github.com/Leaflet/Leaflet/blob/eb34e6682d1cf0d170cb87ff5f1c751c65c8f79a/src/layer/Layer.Popup.js#L21-L22

If you can investigate what happens when you get rid of those lines, and share some ideas about ways to fix it, that'll definitely help :) I don't say it's hard, just give a try ! It's just that reproducing someone errors and fixing code without immediate feedback is very time consumming :)

Good luck !
Thanks !

@leplatrem leplatrem added the bug label May 18, 2015
@leplatrem
Copy link
Collaborator

up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants