问题
Does anyone know of a JavaFX component which can render tile-based maps from e.g. OpenStreetMap directly from Java - i.e. not using the WebEngine?
回答1:
Gluon has Maps, an open source project that you can find here.
It uses OpenStreetMap, and it has a JavaFX control: the MapView
.
See a quick demo here.
@Override
public void start(Stage stage) throws Exception {
MapView view = new MapView();
view.setCenter(new MapPoint(50, 0));
view.setZoom(5);
Scene scene = new Scene(view, 600, 350);
stage.setScene(scene);
stage.show();
}
来源:https://stackoverflow.com/questions/43737404/java-based-osm-tile-rendering-in-javafx