I am tryng to develop a naviagtion map system using ArcGIS Runtime for Java, and FXML files for the view part. I am currently facing zoomButtons disabling: in some zoomlevel
examples, the zoomIn
button should be disabled at zoomlevel = 18
and zoomout
should be disabled at zoomlevel = 0
. Now I am stuck while trying to disable those buttons at several zoom levels. Can anyone help me to solve this problem? You can find the attached code below.
I have already developped the zoomIn
and zoomOut
methods and they are working properly.
//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();
}