gluonhq / maps

https://gluonhq.com/labs/maps/
GNU General Public License v3.0
141 stars 35 forks source link

MapView.setCenter loss of precision #72

Closed ctipper closed 1 year ago

ctipper commented 1 year ago

This exhausts my ability to debug but there is something causing a call to setCenter that results in a loss of precision in setTranslateX in BaseMap.doSetCenter. The upshot of this is that an embedded MapView jumps a small increment when a new layout is triggered by the platform. This is very difficult for the user to ignore.

To be clear this is not a direct call to setCenter, this is triggered by one of the invalidation listeners.

ctipper commented 1 year ago

Still trying to debug, some indicative logs I retrieved. This is after a new layout is requested and I do not understand why the values are fluctuating as there is no user input at this point.

Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap setZoom
FINE: setZoom called
Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap doSetCenter
CONFIG: setCenter, tx = -1.66098465E7, with = 0.0, mex = 1.66098465E7
Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap setZoom
FINE: setZoom called
Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap doSetCenter
CONFIG: setCenter, tx = -1.6878197E7, with = 0.0, mex = 1.6878197E7
Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap doSetCenter
CONFIG: setCenter, tx = -1.660963E7, with = 216.5, mex = 1.66098465E7
Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap doSetCenter
CONFIG: setCenter, tx = -1.6609630932067556E7, with = 216.5, mex = 1.6609847432067556E7
Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap doSetCenter
CONFIG: setCenter, tx = -1.6609630932067556E7, with = 216.5, mex = 1.6609847432067556E7
Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap doSetCenter
CONFIG: setCenter, tx = -1.6609631864135113E7, with = 216.5, mex = 1.6609848364135113E7
Nov 05, 2022 3:24:04 PM com.gluonhq.impl.maps.BaseMap loadTiles
FINE: [JVDBG] loadTiles
ctipper commented 1 year ago

I'm going to close this issue, I have examined everything and I'm guessing this is by design, certainly the title is incorrect. I don't know how to fix my problem.