-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3536 from nyalldawson/cluster_marker
[FEATURE] Cluster marker renderer
- Loading branch information
Showing
83 changed files
with
3,200 additions
and
1,194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** \class QgsPointClusterRenderer | ||
* \ingroup core | ||
* A renderer that automatically clusters points with the same geographic position. | ||
* \note added in QGIS 3.0 | ||
*/ | ||
class QgsPointClusterRenderer : QgsPointDistanceRenderer | ||
{ | ||
%TypeHeaderCode | ||
#include <qgspointclusterrenderer.h> | ||
%End | ||
public: | ||
|
||
QgsPointClusterRenderer(); | ||
|
||
virtual QgsPointClusterRenderer* clone() const /Factory/; | ||
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ); | ||
void stopRender( QgsRenderContext& context ); | ||
QDomElement save( QDomDocument& doc ); | ||
virtual QList<QString> usedAttributes(); | ||
|
||
//! Create a renderer from XML element | ||
static QgsFeatureRenderer* create( QDomElement& symbologyElem ) /Factory/; | ||
|
||
/** Returns the symbol used for rendering clustered groups (but not ownership of the symbol). | ||
* @see setClusterSymbol() | ||
*/ | ||
QgsMarkerSymbol* clusterSymbol(); | ||
|
||
/** Sets the symbol for rendering clustered groups. | ||
* @param symbol new cluster symbol. Ownership is transferred to the renderer. | ||
* @see clusterSymbol() | ||
*/ | ||
void setClusterSymbol( QgsMarkerSymbol* symbol /Transfer/ ); | ||
|
||
/** Creates a QgsPointDisplacementRenderer from an existing renderer. | ||
* @note added in 2.5 | ||
* @returns a new renderer if the conversion was possible, otherwise nullptr. | ||
*/ | ||
static QgsPointClusterRenderer* convertFromRenderer( const QgsFeatureRenderer *renderer ) /Factory/; | ||
|
||
private: | ||
QgsPointClusterRenderer( const QgsPointClusterRenderer & ); | ||
QgsPointClusterRenderer & operator=( const QgsPointClusterRenderer & ); | ||
|
||
void drawGroup( QPointF centerPoint, QgsRenderContext& context, const QgsPointDistanceRenderer::ClusteredGroup& group ); | ||
}; |
Oops, something went wrong.