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

Link to button #58

Closed
Naturtecnica opened this issue Feb 3, 2017 · 2 comments
Closed

Link to button #58

Naturtecnica opened this issue Feb 3, 2017 · 2 comments
Labels

Comments

@Naturtecnica
Copy link

Naturtecnica commented Feb 3, 2017

Hi Cliff,
how can I create a "link to" button using Leaflet.Easy.Button?
Thanx.

Lorenzo

@atstp
Copy link
Contributor

atstp commented Feb 4, 2017

Do you mean to change the window's location like <a href="..." would?

If that's the case, you can use javascript's window.location.href from inside you button's onclick function:

L.easyButton('fa-link', function(){
  window.location.href = "https://www.google.com/";
}).addTo(map);

@atstp atstp added the question label Feb 4, 2017
@Naturtecnica
Copy link
Author

Great, it works!!!
Thanx Atstp!

Lorenzo

@atstp atstp closed this as completed Feb 6, 2017
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