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

Popup filed of marker doesn't show on side-bar #150

Open
iamtekson opened this issue May 20, 2019 · 3 comments
Open

Popup filed of marker doesn't show on side-bar #150

iamtekson opened this issue May 20, 2019 · 3 comments

Comments

@iamtekson
Copy link

The marker show on map doesn't open any popup windows. I wanted to show the popup filed in sidebar like the plugin sidebar-v1.

@api-tilsontech
Copy link

Exactly this. In v1, we are able to add an even listener that when clicking on a Marker, to populate the Sidebar with details from the Marker and then open the Sidebar.

In v2, I'm having trouble doing this same procedure. How do you reference to open up the sidebar when clicking on a Marker?

@iamtekson
Copy link
Author

I have no idea about the sidebar popup when clicking on a marker. Please work on this problem, This will be very helpful for us.

@api-tilsontech
Copy link

I have found a way to do it. This is using the "leaflet-sidebar.js" script. Also, in my version, i have MODAL tabs inside of the sidebar, which is what the "a:eq(0).tab('show')" means. The 0 in the parenthesis is the array number of the tab, starting at 0.

This will open the sidebar and then open any modal tabs inside:
sidebar.open("details");
$('#details .modal-body .nav-tabs a:eq(0)').tab('show');

Then, you will need to push the content to the HTML div you are wanting.
var content = "

";
'DATA GOES HERE'
content += "
";

Then, send the above table data to the HTML div for the modal tab you are wanting to show that data.
$("#gisSites-Info_DATA").html(content);

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

2 participants