MapView icon indicating copy to clipboard operation
MapView copied to clipboard

Setting minimum scale mode and zooming below FILL equivalent gives scaling issues

Open az-faro opened this issue 2 years ago • 3 comments

When I use MapViewConfiguration.setMinimumScaleMode() with anything other than MinimumScaleMode.FILL and zoom out below where FILL would stop zooming in normal cases the scaling of the map goes crazy.

See example image of a drawing. Notice how the entire lower half of it is stretched to double size in the y axis. Similarly there is some stretching at the right edge of the image as well: bild

Another example, here we can see duplication in the lower and right part of the image with both correct and streched data shown at the same time: bild

Similarly I have noticed that when this happens the CoordinateTranslater.translateAndScaleAbsoluteToRelativeY() misbehaves and gives incorrect values.

As soon as you get back within the limits of FILL everything starts working correctly again.

az-faro avatar Dec 06 '23 12:12 az-faro

Thanks for describing in detail your issue. It would be ideal if you could reproduce your issue in a fork of the demo app, so I can investigate.

p-lr avatar Dec 06 '23 21:12 p-lr

Hello again, sorry for the delay, but I finally got around to reproduce this. I would say it's related to the tiles not always being the set size (if the source image isn't an even multiplier of the tile size, the edge tiles are smaller in my case). This was perfectly fine in TileView, but I guess it might be different here. See the reproduction: https://github.com/az-faro/MapView/tree/bugs/scaling-issues.

az-faro avatar Mar 21 '24 11:03 az-faro

I can see that some of your tiles aren't square. In your case, all tiles must be 512x512 px, because MapView does not support rectangular tiles.

p-lr avatar Mar 23 '24 13:03 p-lr