ADDITIONAL SYSTEM INFORMATION :
Also tested and verified as an issue on Windows 11, Ubuntu 22.04, JDKs / JavaFX 19, 21 and 24
A DESCRIPTION OF THE PROBLEM :
It would appear that Google Maps using the JavaScript API no longer loads road maps using WebView, the expected image tiles are replaced with the message "Sorry, we have no imagery here".
Also, On Windows 10, using JavaFX 21 to 24 (also tested 25-ea+9) and Google Maps v3 (i.e. v3.57 to v3.60) satellite imagery is displayed as expected. However, on Windows 11, this only works for v3.57 (soon to be removed) and the other API versions display the "...no imagery here" message.
In the Google Maps JavaScript API release notes for v3.57, they mention that map tiles are now served using the WebP format and perhaps this is related to the issue. The release notes don't specify if this format applies to all tile types, perhaps this is why satellite imagery can still be displayed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Package the minimal JavaFX and HTML / JavaScript (included in this submission) into a JAR and then execute.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A Google Maps 'roadmap' image, initially zoomed out to show the United Kingdom.
ACTUAL -
The tiled message 'Sorry, we have no imagery here'.
---------- BEGIN SOURCE ----------
**** I've used a fixed width font for the code / html to keep the formatting, hope this is OK ****
**** Java Code ****
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class GoogleMaps extends Application
{
public static final void main(final String[] args)
{
Application.launch(args);
}
@Override
public final void start(final Stage stage) throws Exception
{
var webView = new WebView();
var webEngine = webView.getEngine();
webEngine.setJavaScriptEnabled(true);
// note, 'maps.html' must be added to the JAR that contains this application
//
Platform.runLater(() -> webEngine.load(ClassLoader.getSystemClassLoader().getResource("maps.html").toString()));
stage.setScene(new Scene(webView));
stage.show();
}
}
**** Required HTML with embedded JavaScript (to be included in the application JAR) ****
<html>
<head>
<title>Google Maps Test</title>
<style>
body {margin: 0; padding: 0;}
#canvas {width: 100%; height: 100%;}
</style>
</head>
<body>
<div id='canvas'></div>
</body>
</html>
---------- END SOURCE ----------
<please find the attached maps.html>
Also tested and verified as an issue on Windows 11, Ubuntu 22.04, JDKs / JavaFX 19, 21 and 24
A DESCRIPTION OF THE PROBLEM :
It would appear that Google Maps using the JavaScript API no longer loads road maps using WebView, the expected image tiles are replaced with the message "Sorry, we have no imagery here".
Also, On Windows 10, using JavaFX 21 to 24 (also tested 25-ea+9) and Google Maps v3 (i.e. v3.57 to v3.60) satellite imagery is displayed as expected. However, on Windows 11, this only works for v3.57 (soon to be removed) and the other API versions display the "...no imagery here" message.
In the Google Maps JavaScript API release notes for v3.57, they mention that map tiles are now served using the WebP format and perhaps this is related to the issue. The release notes don't specify if this format applies to all tile types, perhaps this is why satellite imagery can still be displayed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Package the minimal JavaFX and HTML / JavaScript (included in this submission) into a JAR and then execute.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A Google Maps 'roadmap' image, initially zoomed out to show the United Kingdom.
ACTUAL -
The tiled message 'Sorry, we have no imagery here'.
---------- BEGIN SOURCE ----------
**** I've used a fixed width font for the code / html to keep the formatting, hope this is OK ****
**** Java Code ****
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class GoogleMaps extends Application
{
public static final void main(final String[] args)
{
Application.launch(args);
}
@Override
public final void start(final Stage stage) throws Exception
{
var webView = new WebView();
var webEngine = webView.getEngine();
webEngine.setJavaScriptEnabled(true);
// note, 'maps.html' must be added to the JAR that contains this application
//
Platform.runLater(() -> webEngine.load(ClassLoader.getSystemClassLoader().getResource("maps.html").toString()));
stage.setScene(new Scene(webView));
stage.show();
}
}
**** Required HTML with embedded JavaScript (to be included in the application JAR) ****
<html>
<head>
<title>Google Maps Test</title>
<style>
body {margin: 0; padding: 0;}
#canvas {width: 100%; height: 100%;}
</style>
</head>
<body>
<div id='canvas'></div>
</body>
</html>
---------- END SOURCE ----------
<please find the attached maps.html>