Closed Gustafsonde closed 3 years ago
The AnchorPane
or the Group
container don't apply any constraint to the MapView
layout, so it will expand to its default size of 2048x2048 (given by its 8x8 tiles of 256x256), regardless of the scene size.
On the contrary, it will work fine if you use a StackPane
, though, as it will constrain the map to the scene size.
A possible solution for the AnchorPane
will be setting these anchors:
AnchorPane.setBottomAnchor(view, 0d);
AnchorPane.setTopAnchor(view, 0d);
AnchorPane.setLeftAnchor(view, 0d);
AnchorPane.setRightAnchor(view, 0d);
The sample code works in a Desktop application. But if I change it slightly to
then it does not work--the mouse can't be used to drag in the y axis and zooming out by scrolling does not work (zoom-in does work).
flyTo()
does not work as expected and the map is initially displayed at x,y coordinates 0,0.I suppressed the problems by making the
BaseMap.moveY()
method work symmetrically to theBaseMap.moveX()
, and by changing theBaseMap.getMyWidth()
andBaseMap.getMyHeight()
to usegetBoundsInParent()
but I doubt if either of these does anything other than mask the symptoms.