mapjfx problems

Since some time now users have reported that mapjfx does not properly display the maps. I wrote a small JavaFX application which is just a WebView and a textfield to edit an URL. This application as well shows buggy behaviour in not loading the map tiles properly. This is the plain JavaFX WebView, with no adddition, custom Javascript code or things that mapjfx does:

Other browsers have no problem with these pages. I do not know if this is some bug in WebView – or more probably in WebKit that’s used internally, but there is nothing I have found up to now that I could do to work around.

This map-tile loading problem only seems to happen with OpenStreetMap servers, I have up to now found no problems when using Bing Maps.

Edit 29.03.2018: At the moment I do not see these issues when running with Oracle JDK 10, feedback about this is very welcome!

11 thoughts on “mapjfx problems

  1. Hi,

    I have the same problem with JDK 10.

    I am basically initializing the MapView with type OSM and set center and zoom after initialization like its done in your example.

    It only renders map in the top left corner.

    Kind regards,
    Steffen

    java –version
    java 10.0.2 2018-07-17
    Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
    Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

    javac –version
    javac 10.0.2

    • Thank you for the hint, but this is a different problem, where the map does not load at all. We have the problem that the part of the times tiles are not loaded when using OSM, but with other map providers it works; So the integration of OL and OSM works

      kind regards Peter

  2. Hello, i have the same problem… with JavaFX doesn’t show anything… i have investigate the html code of map view.html and other code from open layers, and i can run the map view.html in safari, chrome, firefox and opera, but not with JavaFX webview. I think the problem is produced by javascript cross domain… i’ve tried to activate the usage of javascript cross domain but doesn’t run correctly… 🙁

    if you need the map view.html file, send me email 🙂

    Regards!

    • I have just again tested the actual mapjfx lib with the demo program, both with Java 8 and Java 11. It works, with OSM and the other map types as well. The problem described on this page sometimes happens when some tiles are not loaded from OSM.

      mapjfx has no problems in so far that nothing at all is shown, if there were a basic problem with the Javascript of mapjfx and the JavaFX WebView, this would happen regardless of the selected map type.

      Which view.html file are you talking about?

  3. Hi,
    Mapjfx is excelente job!
    I have one problem, righclick on the map automatically shows the web view scroll bar, then map is rescaling (makes markers’ coordinates incorrect), and “reaload page” context menu appears. Is any way to disable the righclickevent or catch them?
    Method “mapView.addEventFilter(MapViewEvent.MAP_RIGHTCLICKED, event -> {));” doesnt work.

    Best regards

    • Hi Chris,

      this is a known problem with the WebView browser at the moment. I have code in the Javascript that should prevent the standard context menu, and this used to work. I noticed this behaviour in April (see this issue)

    • Edit: I found the error I introduced in the code (need to blame myself, not WebView); I will release a fixed version today or tomorrow

    • Hi Ben,
      this is not necessary, the 1.x current version has the identical functionality as the 2.x branch, the only difference is the used Java version

Leave a Reply

Your email address will not be published.