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

Add InfoWindow to current click position #190

Open
HaukeGulich opened this issue Feb 14, 2020 · 0 comments
Open

Add InfoWindow to current click position #190

HaukeGulich opened this issue Feb 14, 2020 · 0 comments

Comments

@HaukeGulich
Copy link

I want to open a InfoWindow when clicking on a polyline:

` map.addUIEventHandler(polygon, UIEventType.click, (JSObject obj) -> {

        System.out.println("Polygon click");
        InfoWindowOptions infoWindowOptions = new InfoWindowOptions();
        infoWindowOptions.position(new LatLong( 31.33255233509554    , 121.6711721454525 ));
        infoWindowOptions.content("<h2>Fred Wilkie</h2>"
                + "Current Location: Safeway<br>"
                + "ETA: 45 minutes" );

        InfoWindow fredWilkeInfoWindow = new InfoWindow(infoWindowOptions);
        fredWilkeInfoWindow.open(map);
    });

`

But how can I set the position to the position the mouse was clicked? In my case I have a shipping route and as soon as someone clicks on the route I want a popup at that position on the map.

Thanks for your help

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