allow passing scale_denom to renderer's apply method to allow overriding zoom level - closes #1582
This commit is contained in:
parent
e04b8284ce
commit
270a6eff33
2 changed files with 10 additions and 6 deletions
|
@ -57,12 +57,12 @@ public:
|
|||
/*!
|
||||
* \brief apply renderer to all map layers.
|
||||
*/
|
||||
void apply();
|
||||
void apply(double scale_denom_override=0.0);
|
||||
|
||||
/*!
|
||||
* \brief apply renderer to a single layer, providing pre-populated set of query attribute names.
|
||||
*/
|
||||
void apply(mapnik::layer const& lyr, std::set<std::string>& names);
|
||||
void apply(mapnik::layer const& lyr, std::set<std::string>& names,double scale_denom_override=0.0);
|
||||
/*!
|
||||
* \brief render a layer given a projection and scale.
|
||||
*/
|
||||
|
|
|
@ -150,7 +150,7 @@ feature_style_processor<Processor>::feature_style_processor(Map const& m, double
|
|||
}
|
||||
|
||||
template <typename Processor>
|
||||
void feature_style_processor<Processor>::apply()
|
||||
void feature_style_processor<Processor>::apply(double scale_denom)
|
||||
{
|
||||
#if defined(RENDERING_STATS)
|
||||
std::clog << "\n//-- starting rendering timer...\n";
|
||||
|
@ -163,7 +163,8 @@ void feature_style_processor<Processor>::apply()
|
|||
try
|
||||
{
|
||||
projection proj(m_.srs(),true);
|
||||
double scale_denom = mapnik::scale_denominator(m_.scale(),proj.is_geographic());
|
||||
if (scale_denom <= 0.0)
|
||||
scale_denom = mapnik::scale_denominator(m_.scale(),proj.is_geographic());
|
||||
scale_denom *= scale_factor_;
|
||||
|
||||
BOOST_FOREACH ( layer const& lyr, m_.layers() )
|
||||
|
@ -200,14 +201,17 @@ void feature_style_processor<Processor>::apply()
|
|||
}
|
||||
|
||||
template <typename Processor>
|
||||
void feature_style_processor<Processor>::apply(mapnik::layer const& lyr, std::set<std::string>& names)
|
||||
void feature_style_processor<Processor>::apply(mapnik::layer const& lyr,
|
||||
std::set<std::string>& names,
|
||||
double scale_denom)
|
||||
{
|
||||
Processor & p = static_cast<Processor&>(*this);
|
||||
p.start_map_processing(m_);
|
||||
try
|
||||
{
|
||||
projection proj(m_.srs(),true);
|
||||
double scale_denom = mapnik::scale_denominator(m_.scale(),proj.is_geographic());
|
||||
if (scale_denom <= 0.0)
|
||||
scale_denom = mapnik::scale_denominator(m_.scale(),proj.is_geographic());
|
||||
scale_denom *= scale_factor_;
|
||||
|
||||
if (lyr.visible(scale_denom))
|
||||
|
|
Loading…
Add table
Reference in a new issue