Skip to content

Commit e37a5ad

Browse files
committedSep 25, 2014
[FEATURE] Legend filtering based on map content (in main window, composer, WMS)
There is new "filter" button in layers panel that toggles this functionality and in composer legend widget. Related feature is that layer tree now shows symbols in map units with correct size (even when filtering is not enabled) so as the map view changes the legend node icons are updated too (if they use map units). GetLegendGraphics in WMS server ------------------------------- This is an extension of standard GetLegendGraphics request according to MapServer RFC 101. See the document for more details: http://mapserver.org/development/rfc/ms-rfc-101.html In summary, clients need to add BBOX and CRS/SRS parameters to get appropriate legend based on the given map view. Parameters WIDTH and HEIGHT are also taken into account as they specify map view image size for correct calculation of size of legend symbols (if they are based on map units). -- This software has been commissioned by Tuscany Region (Italy), co-funded by the European Commission and developed under the project LIFE12 ENV/IT/001054 LIFE + IMAGINE. The software has been realized by Gis3W s.a.s. Questo software è stato commissionato da Regione Toscana (Italia), cofinanziato dalla Commissione Europea e sviluppato nell'ambito del progetto LIFE12 ENV/IT/001054 LIFE + IMAGINE. Il software è stato realizzato da Gis3W s.a.s.
1 parent a111c85 commit e37a5ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+893
-124
lines changed
 

‎python/core/composer/qgscomposerlegend.sip

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ class QgsComposerLegend : QgsComposerItem
5858
//! @note added in 2.6
5959
bool autoUpdateModel() const;
6060

61+
//! Set whether legend items should be filtered to show just the ones visible in the associated map
62+
//! @note added in 2.6
63+
void setLegendFilterByMapEnabled( bool enabled );
64+
//! Find out whether legend items are filtered to show just the ones visible in the associated map
65+
//! @note added in 2.6
66+
bool legendFilterByMapEnabled() const;
67+
6168
//setters and getters
6269
void setTitle( const QString& t );
6370
QString title() const;

‎python/core/composer/qgscomposermap.sip

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class QgsComposerMap : QgsComposerItem
111111
/** \brief Create cache image */
112112
void cache();
113113

114+
/** Return map settings that would be used for drawing of the map
115+
* @note added in 2.6 */
116+
QgsMapSettings mapSettings( const QgsRectangle& extent, const QSizeF& size, int dpi ) const;
117+
114118
/** \brief Get identification number*/
115119
int id() const;
116120

@@ -737,6 +741,10 @@ class QgsComposerMap : QgsComposerItem
737741

738742
void connectMapOverviewSignals() /Deprecated/;
739743

744+
/**Calculates the extent to request and the yShift of the top-left point in case of rotation.
745+
* @note added in 2.6 */
746+
void requestedExtent( QgsRectangle& extent ) const;
747+
740748
signals:
741749
void extentChanged();
742750

2 commit comments

Comments
 (2)

NathanW2 commented on Sep 25, 2014

@NathanW2
Member

oooooohhhh fancy!

SrNetoChan commented on Sep 25, 2014

@SrNetoChan
Member

Sweet!!! Again, it seems like if you guys can read my mind, and guess what my wishes are!

Please sign in to comment.