i have a java class as below:
package client;
import java.io.IOException;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class Test extends Application {
@Override
public void start(Stage stage) throws Exception {
StackPane root = new StackPane();
WebView view = new WebView();
WebEngine engine = view.getEngine();
engine.load(Test.class.getResource("/mapview/leafDani.html").toExternalForm());
root.getChildren().add(view);
Scene scene = new Scene(root, 700, 700);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) throws IOException {
Application.launch(args);
}
}
the html file i made load an opnestreetmap center on london:
<!DOCTYPE html>
<html>
<head>
<title>Daniele test map</title>
<link rel="stylesheet" href="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet.css" />
<script src="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet.js"></script>
<style>
#map {
width: 700px;
height:700px;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function jumpTo(lon, lat, zoom) {
map.setView(new L.LatLng(lat, lon), zoom);
}
var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
</script>
</body>
</html>
when i start the application the page seems to be loaded, i can see the button for zoom in and zoom out but the map doesn't appear or partially appear. if i open the html file with my browser is perfect. im using intellij as IDE and i even tried to modify the defualt browser but i got the same resoult. any suggestions?