'What are the correct min and max values for Gluon maps zooming?
I am trying out Gluon maps. As I understand it, Gluon maps uses OpenStreetMap which has a zoom range of 0 to 20 (but this value is not mentioned in the MapView javadoc). I create this code:
public class MapTest2 extends Application
{
MapView mapView = new MapView();
MapPoint mapPoint = new MapPoint(51.509865d,-0.118092d); // London, England
@Override
public void start(Stage stage) throws Exception {
StackPane sp = new StackPane();
sp.getChildren().add(mapView);
mapView.setCenter(mapPoint);
mapView.setZoom(42.8); // ? and -1.1 works but -1.3 fails
Scene scene = new Scene(sp, 500, 300);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
MapTest2.launch(MapTest2.class, args);
}
}
where I can set the positive zoom value far higher than 20. Some considerable zooming out on the mouse wheel returns me to a reasonable view. A zoom value of -1.1 works but -1.3 fails with:
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
:
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -2 out of bounds for length 20
at com.gluonhq.impl.maps.BaseMap.loadTiles(BaseMap.java:347)
at com.gluonhq.impl.maps.BaseMap.layoutChildren(BaseMap.java:490)
:
What are the real minimum and maximum zoom ranges, and should I use only integer values for zoom as there seems to be some rounding going on?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
