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

OpenPopup Function does not work #33

Open
cap1862 opened this issue Mar 29, 2021 · 3 comments
Open

OpenPopup Function does not work #33

cap1862 opened this issue Mar 29, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@cap1862
Copy link

cap1862 commented Mar 29, 2021

Hello,
I use the tool to display locations by markers on a map. Each marker has a popup attached to it, which contains the exact location name and appears by a click. This works wonderfully. However, I also use a grid in which all locations are listed. When the user clicks on an entry in the grid, the popup should also open, but nothing happens. I suspect that this is because in LayerPopupFunctions.class, both the .closePopup() and .openPopup() functions say "executeJS("closePopup")". It would be great if this could be fixed or if somebody can tell me what I do wrong. Anyone else have any other ideas on how to work around this issue? The .togglePopup() function doesn't solve it either.

This is my code:

mygrid.asSingleSelect().addValueChangeListener(e -> {
        	if(e.isFromClient() && e.getValue() != null)
        	{
        		PlaceDataContainer p = e.getValue();        		
        		System.out.println(placeMarkerMap.get(p).getPopup()); //To be sure, that the popup was found
        		placeMarkerMap.get(p).openPopup();       		
        	
        	}
        });

Thanks and regards

@Gubancs
Copy link
Owner

Gubancs commented Mar 29, 2021

hi,
thanks for your report, I appreciate it.
Im not sure but, maybe it should works as a workaround:
placeMarkerMap.get(p). executeJs("openPopup");

@Gubancs Gubancs added the bug Something isn't working label Mar 29, 2021
@cap1862
Copy link
Author

cap1862 commented Apr 27, 2021

Hey you,
thanks for your fast answer - meanwhile I've tried it but unfortunately your idea doesn't work either

@homerstone
Copy link

This worked for me:

CircleMarker marker = placeMarkerMap.get(place);
map.executeJs(marker, "openPopup");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants