+ implement buffered_extent method on Map object
This commit is contained in:
parent
6a86e239b1
commit
866f5f98eb
2 changed files with 14 additions and 0 deletions
|
@ -298,6 +298,11 @@ namespace mapnik
|
||||||
*/
|
*/
|
||||||
const Envelope<double>& getCurrentExtent() const;
|
const Envelope<double>& getCurrentExtent() const;
|
||||||
|
|
||||||
|
/*! \brief Get current buffered bounding box.
|
||||||
|
* @return The current buffered bounding box.
|
||||||
|
*/
|
||||||
|
Envelope<double> get_buffered_extent() const;
|
||||||
|
|
||||||
double scale() const;
|
double scale() const;
|
||||||
|
|
||||||
double scale_denominator() const;
|
double scale_denominator() const;
|
||||||
|
|
|
@ -372,6 +372,15 @@ namespace mapnik
|
||||||
return currentExtent_;
|
return currentExtent_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Envelope<double> Map::get_buffered_extent() const
|
||||||
|
{
|
||||||
|
double extra = 2.0 * scale() * buffer_size_;
|
||||||
|
Envelope<double> ext(currentExtent_);
|
||||||
|
ext.width(currentExtent_.width() + extra);
|
||||||
|
ext.height(currentExtent_.height() + extra);
|
||||||
|
return ext;
|
||||||
|
}
|
||||||
|
|
||||||
void Map::pan(int x,int y)
|
void Map::pan(int x,int y)
|
||||||
{
|
{
|
||||||
int dx = x - int(0.5 * width_);
|
int dx = x - int(0.5 * width_);
|
||||||
|
|
Loading…
Reference in a new issue