Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8331640

WebView, day to day used pages with maps are not working with most releases

XMLWordPrintable

    • web
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Mac / macOS Sonoma 14.3 / Does not work for Java 17, 22 and all inbetween. Probably also not for javafx 11.

      A DESCRIPTION OF THE PROBLEM :
      Important pages containing maps are not working. Enter one of the following pages and see that there is nothing to see.

      https://www.geoportal.ch/ch/map/40?y=2683332.00&x=1247089.90&scale=2000&rotation=0&topic=property&highlight=1&bfsnr=3203&property=W7391

      https://www.openstreetmap.org/search?query=z%C3%BCrich&commit=Go#map=16/47.4078/9.3566&layers=H

      https://www.google.ch/maps/@46.8358449,7.658535,9z?hl=de

      REGRESSION : Last worked in version 18

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run provided Code with any of the three urls.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      See the maps.
      ACTUAL -
      No map content is shown.

      ---------- BEGIN SOURCE ----------
      package com.example.webviewsample;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.TextField;
      import javafx.scene.layout.BorderPane;
      import javafx.scene.web.WebEngine;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      public class WebViewSample extends Application {

          @Override
          public void start(Stage primaryStage) {
              WebView webView = new WebView();
              WebEngine webEngine = webView.getEngine();

              TextField urlField = new TextField("https://www.openstreetmap.org/search?query=z%C3%BCrich&commit=Go#map=16/47.4078/9.3566&layers=H");
              //TextField urlField = new TextField("https://www.geoportal.ch/ch/map/40?y=2683332.00&x=1247089.90&scale=2000&rotation=0&topic=property&highlight=1&bfsnr=3203&property=W739");
              //TextField urlField = new TextField("https://www.google.ch/maps/@46.8358449,7.658535,9z?hl=de);

              Button goButton = new Button("Go");

              goButton.setOnAction(event -> {
                  java.net.CookieHandler.setDefault(null);
                  String url = urlField.getText();
                  webEngine.load(url);
              });

              BorderPane root = new BorderPane();
              root.setTop(urlField);
              root.setCenter(webView);
              root.setBottom(goButton);

              Scene scene = new Scene(root, 800, 600);
              primaryStage.setScene(scene);
              primaryStage.setTitle("WebView Sample");
              primaryStage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No, not for all examples. For google maps, javafx 18 is said to be working, but its also not working for the other two urls.

      FREQUENCY : always


            jbhaskar Jay Bhaskar
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: