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

Open sidebar pane on tooltip click? #68

Open
yevvie opened this issue Aug 10, 2023 · 0 comments
Open

Open sidebar pane on tooltip click? #68

yevvie opened this issue Aug 10, 2023 · 0 comments

Comments

@yevvie
Copy link

yevvie commented Aug 10, 2023

I'd want to open a sidebar pane when user clicks a tooltip. I've used previous versions of sidebar + old leaflet, and the method described below worked:

  • in my mapdata.js

var tooltipMarker = L.marker([33.65201, -158.34234], {icon: emptyIcon})
.bindTooltip("Tooltip", {permanent: true, direction: 'center', className: 'lab-misc', interactive: true})
.openTooltip().on ('click', function () {sidebar.open('i-tooltip')})
.addTo(continents);

  • in html

<div class="leaflet-sidebar-pane" id="i-tooltip">
<h1 class="leaflet-sidebar-header">
Tooltip Title<div class="leaflet-sidebar-close"><i class="fa fa-caret-left"></i></div>
</h1>
<p>A responsive sidebar for mapping libraries</p>
</div>

Now, this method does not work for this version of sidebar, and throws error as it cannot find the html class? How would I go about making something like this work?

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