我正在尝试使用ArcGIS Runtime for Java和视图部分的 FXML 文件开发导航地图系统。我目前正面临 zoomButtons 禁用:在某些示例中,该按钮应在 时禁用,并且应在 时禁用。现在我在尝试在几个缩放级别禁用这些按钮时被卡住了。谁能帮我解决这个问题?您可以在下面找到随附的代码。zoomlevel
zoomIn
zoomlevel = 18
zoomout
zoomlevel = 0
我已经开发了zoomIn
和zoomOut
方法并且它们工作正常。
//ZoomIn Function is created
public void zoomInFunction() {
Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);
Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0);
mapView.setViewpointAsync(zoomedIn);
}
//ZoomOut Function is created
public void zoomOutFunction() {
Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);
Viewpoint zoomedOut = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0);
mapView.setViewpointAsync(zoomedOut);
}
// Create action event for ZoomIn Function
public void zoomInAction(ActionEvent event) {
map.zoomInFunction();
}
// Create action event for ZoomOut Function
public void zoomOutAction(ActionEvent event) {
map.zoomOutFunction();
}