C++ (Qt)typedef QPair <QRectF, QPixmap> TImage;
C++ (Qt)QRectF realR(scrollX / scale, scrollY / scale, width() / scale, height() / scale);
C++ (Qt)QPointF tileForCoordinate(qreal lat, qreal lng, int zoom){ qreal zn = static_cast<qreal>(1 << zoom); qreal tx = (lng + 180.0) / 360.0; qreal ty = (1.0 - log(tan(lat * pi / 180.0) + 1.0 / cos(lat * pi / 180.0)) / pi) / 2.0; return QPointF(tx * zn, ty * zn);} qreal longitudeFromTile(qreal tx, int zoom){ qreal zn = static_cast<qreal>(1 << zoom); qreal lat = tx / zn * 360.0 - 180.0; return lat;} qreal latitudeFromTile(qreal ty, int zoom){ qreal zn = static_cast<qreal>(1 << zoom); qreal n = pi - 2 * pi * ty / zn; qreal lng = 180.0 / pi * atan(0.5 * (exp(n) - exp(-n))); return lng;}
C++ (Qt)while(!asleep()) sheep++;