Abstract base class for all map layers displayed in the MapCanvas.
More...
#include <QByteArray>
#include <QMap>
#include <QObject>
#include <QPaintDevice>
#include <QPainter>
#include <QPair>
#include <QRectF>
#include <QString>
#include <QVector>
#include <QUuid>
#include <cmath>
#include <memory>
#include <vector>
#include "map/mapextent.h"
#include "render/temporalspec.h"
#include "render/labelconfig.h"
#include "render/maskspec.h"
#include "render/auxiliarystoragespec.h"
#include "render/joinspec.h"
#include "render/diagramspec.h"
Go to the source code of this file.
Abstract base class for all map layers displayed in the MapCanvas.
- Author
- Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
- Date
- 2026
- License\n GPL-3.0-or-later
◆ BasemapHttpHeaders
◆ painterDevicePixelRatio()
| qreal painterDevicePixelRatio |
( |
const QPainter * |
p | ) |
|
|
inline |
◆ snapTileRectToDevicePx()
Snap a tile's logical-pixel rect to device pixel boundaries.
Adjacent raster tiles that share a logical boundary (e.g. tile N's right edge = tile N+1's left edge in source-extent math) still produce visible seams under QPainter's Source-Over compositing whenever the boundary falls at a sub-pixel position: each tile contributes a partial-alpha pixel on the shared column and the two contributions don't cleanly sum to opaque.
Snapping every tile corner to the same integer device pixel guarantees consecutive tiles share an exact column — no partial alpha on the seam, no visible discontinuity. We snap in device units (not logical) because the painter is in logical coords while the QImage is at full DPR; a logical-integer snap still leaves sub-device-pixel positions on Retina (DPR=2).
Returns logical-coord QRectF (corners at exact device-pixel positions) suitable for QPainter::drawImage with a painter in logical coordinates.