1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-02-22 02:20:47 +01:00

The true cause of the map switch offset...

This commit is contained in:
Martin Tůma 2018-04-18 22:02:24 +02:00
parent bb10f7c0e1
commit e1532b978f

View File

@ -287,9 +287,8 @@ void MapView::setMap(Map *map)
it.value()->setMap(_map); it.value()->setMap(_map);
updatePOIVisibility(); updatePOIVisibility();
QPointF oc = vr.center(); QPointF nc = QRectF(_map->ll2xy(cr.topLeft()),
QPointF nc = _map->ll2xy(cr.center()); _map->ll2xy(cr.bottomRight())).center();
if (qAbs(oc.x() - nc.x()) >= 1.0 || qAbs(oc.y() - nc.y()) >= 1.0)
centerOn(nc); centerOn(nc);
resetCachedContent(); resetCachedContent();