gpt4 book ai didi

java - GmapsFX。从 map 中删除调试面板

转载 作者:太空宇宙 更新时间:2023-11-04 14:10:32 25 4
gpt4 key购买 nike

我使用 GmapsFX 和 Google map 创建了一个简单的 JavaFX 项目1.1.0

public class CorrectorClientMain extends Application implements MapComponentInitializedListener {
protected GoogleMapView mapComponent;
protected GoogleMap map;

private Button btnZoomIn;
private Button btnZoomOut;
private Label lblZoom;
private Label lblCenter;
private Label lblClick;
private ComboBox<MapTypeIdEnum> mapTypeCombo;

@Override
public void start(final Stage stage) throws Exception {
mapComponent = new GoogleMapView();
mapComponent.addMapInializedListener(this);
BorderPane bp = new BorderPane();
ToolBar tb = new ToolBar();

btnZoomIn = new Button("Zoom In");
btnZoomIn.setOnAction(e -> {
map.zoomProperty().set(map.getZoom() + 1);
});
btnZoomIn.setDisable(true);

btnZoomOut = new Button("Zoom Out");
btnZoomOut.setOnAction(e -> {
map.zoomProperty().set(map.getZoom() - 1);
});
btnZoomOut.setDisable(true);

lblZoom = new Label();
lblCenter = new Label();
lblClick = new Label();

mapTypeCombo = new ComboBox<>();
mapTypeCombo.setOnAction( e -> {
map.setMapType(mapTypeCombo.getSelectionModel().getSelectedItem() );
});
mapTypeCombo.setDisable(true);

Button btnType = new Button("Map type");
btnType.setOnAction(e -> {
map.setMapType(MapTypeIdEnum.HYBRID);
});
tb.getItems().addAll(btnZoomIn, btnZoomOut, mapTypeCombo,
new Label("Zoom: "), lblZoom,
new Label("Center: "), lblCenter,
new Label("Click: "), lblClick);

bp.setTop(tb);
bp.setCenter(mapComponent);
bp.setLeft(btnType);
Scene scene = new Scene(bp);

stage.setScene(scene);
stage.show();
}

public void mapInitialized() {
//Once the map has been loaded by the Webview, initialize the map details.
LatLong center = new LatLong(48.8539819,37.6144408);
mapComponent.addMapInializedListener(() -> {
// This call will fail unless the map is completely ready.
//checkCenter(center);
});

MapOptions options = new MapOptions();
options.center(center)
.mapMarker(true)
.zoom(12)
.overviewMapControl(false)
.panControl(false)
.rotateControl(false)
.scaleControl(true)
.streetViewControl(false)
.zoomControl(true)
.mapType(MapTypeIdEnum.HYBRID);

map = mapComponent.createMap(options);

}

private void checkCenter(LatLong center) {
//
}


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

当我运行应用程序时,我在窗口中看到调试面板:

Firebug

我可以删除这个调试面板吗?我是否忘记设置任何参数?

最佳答案

如果您查看项目站点,在版本 link 中,有两个较新的版本。

事实上,版本 1.1.1 的更改列表已经解决了您的问题:

Fixed issue where FireBug plugin was always displaying by default with the Map.

所以我建议您将版本更新到最新可用的版本 1.1.2 .

关于java - GmapsFX。从 map 中删除调试面板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28381292/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com