qgis-scale_in_style.patch
src/core/qgsvectorlayer.cpp (working copy) | ||
---|---|---|
2318 | 2318 | |
2319 | 2319 |
// use scale dependent visibility flag |
2320 | 2320 |
QDomElement e = node.toElement(); |
2321 |
toggleScaleBasedVisibility( e.attribute( "scaleBasedVisibilityFlag", "0" ) == "1" ); |
|
2322 |
setMinimumScale( e.attribute( "minScale", "1" ).toFloat() ); |
|
2323 |
setMaximumScale( e.attribute( "maxScale", "100000000" ).toFloat() ); |
|
2321 | 2324 |
label()->setScaleBasedVisibility( e.attribute( "scaleBasedLabelVisibilityFlag", "0" ) == "1" ); |
2322 | 2325 |
label()->setMinScale( e.attribute( "minLabelScale", "1" ).toFloat() ); |
2323 | 2326 |
label()->setMaxScale( e.attribute( "maxLabelScale", "100000000" ).toFloat() ); |
... | ... | |
2465 | 2468 |
{ |
2466 | 2469 |
// use scale dependent visibility flag |
2467 | 2470 |
QDomElement mapLayerNode = node.toElement(); |
2471 |
mapLayerNode.setAttribute( "scaleBasedVisibilityFlag", hasScaleBasedVisibility() ? 1 : 0 ); |
|
2472 |
mapLayerNode.setAttribute( "minScale", minimumScale() ); |
|
2473 |
mapLayerNode.setAttribute( "maxScale", maximumScale() ); |
|
2468 | 2474 |
mapLayerNode.setAttribute( "scaleBasedLabelVisibilityFlag", label()->scaleBasedVisibility() ? 1 : 0 ); |
2469 | 2475 |
mapLayerNode.setAttribute( "minLabelScale", label()->minScale() ); |
2470 | 2476 |
mapLayerNode.setAttribute( "maxLabelScale", label()->maxScale() ); |
src/core/qgsmaplayer.h (working copy) | ||
---|---|---|
293 | 293 | |
294 | 294 |
/** Accessor and mutator for the minimum scale member */ |
295 | 295 |
void setMinimumScale( float theMinScale ); |
296 |
float minimumScale(); |
|
296 |
float minimumScale() const;
|
|
297 | 297 | |
298 | 298 |
/** Accessor and mutator for the maximum scale member */ |
299 | 299 |
void setMaximumScale( float theMaxScale ); |
300 |
float maximumScale(); |
|
300 |
float maximumScale() const;
|
|
301 | 301 | |
302 | 302 |
/** Accessor and mutator for the scale based visilibility flag */ |
303 | 303 |
void toggleScaleBasedVisibility( bool theVisibilityFlag ); |
304 |
bool hasScaleBasedVisibility(); |
|
304 |
bool hasScaleBasedVisibility() const;
|
|
305 | 305 | |
306 | 306 |
signals: |
307 | 307 |
src/core/qgsmaplayer.cpp (working copy) | ||
---|---|---|
385 | 385 |
mScaleBasedVisibility = theVisibilityFlag; |
386 | 386 |
} |
387 | 387 | |
388 |
bool QgsMapLayer::hasScaleBasedVisibility() |
|
388 |
bool QgsMapLayer::hasScaleBasedVisibility() const
|
|
389 | 389 |
{ |
390 | 390 |
return mScaleBasedVisibility; |
391 | 391 |
} |
... | ... | |
395 | 395 |
mMinScale = theMinScale; |
396 | 396 |
} |
397 | 397 | |
398 |
float QgsMapLayer::minimumScale() |
|
398 |
float QgsMapLayer::minimumScale() const
|
|
399 | 399 |
{ |
400 | 400 |
return mMinScale; |
401 | 401 |
} |
... | ... | |
406 | 406 |
mMaxScale = theMaxScale; |
407 | 407 |
} |
408 | 408 | |
409 |
float QgsMapLayer::maximumScale() |
|
409 |
float QgsMapLayer::maximumScale() const
|
|
410 | 410 |
{ |
411 | 411 |
return mMaxScale; |
412 | 412 |
} |