question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JavaFX Webview - dragging problem - Leaflet issue?

See original GitHub issue

I had a meeting with a developer, which used JavaFX and Webview to display a Leaflet map. After upgrading to JDK1.8.0_291 (or greater then 291) the map dragging doesn’t work anymore. First I thought it is only a Java problem but it looks like the mouse-events are correctly passed to the html.

We found out

  1. that dragging the map works if we use Leaflet 0.7.7
  2. if we hold down on the zoom control button and then move the pressed mouse to the map, and then release it -> the map is moving / dragging until we click again javafx_control_drag

Have we some JavaFX experts here? I have following questions:

  1. Can you confirm this issue?
  2. Is it possible to debug the Javascript in the WebView?
  3. Is this a JavaFX problem or is this a problem of Leaflet?

I suggest to let this Issue open until 2022 and if no one can confirm this we close it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
PrimosKcommented, Dec 10, 2021

I did a quick check.

The good news is that with the latest master the issue is gone! 😃

Side question: Are there any estimations of when new Leaflet version (based on the latest master) will be out?

1reaction
Falke-Designcommented, Dec 10, 2021

In Leaflet 1.7.1. it’s actually this if expression which consequently causes map to not be moved (because PointerEvent.buttons is wrongfully set to 0 by Java FX 17): https://github.com/Leaflet/Leaflet/blob/bd88f73e8ddb90eb945a28bc1de9eb07f7386118/src/dom/DomEvent.Pointer.js#L104

nice catch! I think this should be fixed in JavaFX

Read more comments on GitHub >

github_iconTop Results From Across the Web

Leaflet does not work in WebEngine after JavaFX 17
This makes the Leaftlet map to move properly while being dragged in the Java FX 17 WebView - but please consider this more...
Read more >
[JDK-8278150] WebView: Dragging related issue.
When running it using JavaFx 17.0.1 dragging of the map doesn't work. ... The map should be draggable just like it is when...
Read more >
Issues with Leaflet and JavaFX Webview - Google Groups
As I drag or zoom on the map, the Circles and Polygons are not fixed, but moving in somewhat random directions. This behavior...
Read more >
Leaflet Does Not Work In Webengine After Javafx 17 - ADocLib
I am using JavaFX Webview with Leaflet library to render OSM tiles.I am running into issues with Circles and Polygons Marker and with...
Read more >
Creating a JavaFX World Clock from Scratch (Part 5) - Foojay
In Part 5 of the series, we will be looking at JavaFX's WebView API to ... locally and you'll see the map rendered...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found