Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Better tile id rendering
  • Loading branch information
nyalldawson committed May 16, 2023
1 parent f4554e3 commit f7b3f13
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/core/vectortile/qgsvectortilelayerrenderer.cpp
Expand Up @@ -26,7 +26,7 @@
#include "qgsmapclippingutils.h"
#include "qgsrendercontext.h"
#include "qgsvectortiledataprovider.h"

#include "qgstextrenderer.h"
#include <QElapsedTimer>
#include <QThread>

Expand Down Expand Up @@ -278,9 +278,14 @@ void QgsVectorTileLayerRenderer::decodeAndDrawTile( const QgsVectorTileRawData &
ctx.painter()->setPen( pen );
ctx.painter()->setBrush( brush );
ctx.painter()->drawPolygon( tile.tilePolygon() );
#if 0
ctx.painter()->setBrush( QBrush( QColor( 255, 0, 0 ) ) );
ctx.painter()->drawText( tile.tilePolygon().boundingRect().center(), tile.id().toString() );
#if 1
QgsTextFormat format;
format.setColor( QColor( 255, 0, 0 ) );
format.buffer().setEnabled( true );

QgsTextRenderer::drawText( QRectF( QPoint( 0, 0 ), ctx.outputSize() ).intersected( tile.tilePolygon().boundingRect() ),
0, Qgis::TextHorizontalAlignment::Center, { tile.id().toString() },
ctx, format, true, Qgis::TextVerticalAlignment::VerticalCenter );
#endif
}
}

0 comments on commit f7b3f13

Please sign in to comment.