mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-11-24 03:35:54 +01:00
Use the "official" min/max zoom defaults in zoom check
This commit is contained in:
parent
82308857ba
commit
e00c8feab6
@ -437,7 +437,7 @@ Text::RotationAlignment Style::Layer::Layout::textRotationAlignment(int zoom)
|
||||
}
|
||||
|
||||
Style::Layer::Layer(const QJsonObject &json)
|
||||
: _type(Unknown), _minZoom(-1), _maxZoom(-1)
|
||||
: _type(Unknown), _minZoom(0), _maxZoom(22)
|
||||
{
|
||||
// type
|
||||
QString type(json["type"].toString());
|
||||
@ -475,12 +475,8 @@ Style::Layer::Layer(const QJsonObject &json)
|
||||
|
||||
bool Style::Layer::match(int zoom, const PBF::Feature &feature) const
|
||||
{
|
||||
if (zoom >= 0) {
|
||||
if (_minZoom > 0 && zoom < _minZoom)
|
||||
if (zoom >= 0 && (zoom < _minZoom || zoom > _maxZoom))
|
||||
return false;
|
||||
if (_maxZoom > 0 && zoom > _maxZoom)
|
||||
return false;
|
||||
}
|
||||
|
||||
return _filter.match(feature);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
private:
|
||||
class Layer {
|
||||
public:
|
||||
Layer() : _type(Unknown), _minZoom(-1), _maxZoom(-1) {}
|
||||
Layer() : _type(Unknown), _minZoom(0), _maxZoom(22) {}
|
||||
Layer(const QJsonObject &json);
|
||||
|
||||
const QString &sourceLayer() const {return _sourceLayer;}
|
||||
|
Loading…
Reference in New Issue
Block a user