add RESPECT mode to make 'fixing' of bbox aspect a no-op on map
This commit is contained in:
parent
a616e9d7e7
commit
422f3bd8b0
3 changed files with 6 additions and 2 deletions
|
@ -134,6 +134,7 @@ void export_map()
|
|||
.value("ADJUST_BBOX_HEIGHT",mapnik::Map::ADJUST_BBOX_HEIGHT)
|
||||
.value("ADJUST_CANVAS_WIDTH",mapnik::Map::ADJUST_CANVAS_WIDTH)
|
||||
.value("ADJUST_CANVAS_HEIGHT", mapnik::Map::ADJUST_CANVAS_HEIGHT)
|
||||
.value("RESPECT", mapnik::Map::RESPECT)
|
||||
;
|
||||
|
||||
class_<std::vector<layer> >("Layers")
|
||||
|
|
|
@ -63,9 +63,10 @@ public:
|
|||
ADJUST_BBOX_HEIGHT,
|
||||
// adjust the width of the map, leave height and geo bbox unchanged
|
||||
ADJUST_CANVAS_WIDTH,
|
||||
//adjust the height of the map, leave width and geo bbox unchanged
|
||||
// adjust the height of the map, leave width and geo bbox unchanged
|
||||
ADJUST_CANVAS_HEIGHT,
|
||||
//
|
||||
// do nothing
|
||||
RESPECT,
|
||||
aspect_fix_mode_MAX
|
||||
};
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ static const char * aspect_fix_mode_strings[] = {
|
|||
"ADJUST_BBOX_HEIGHT",
|
||||
"ADJUST_CANVAS_WIDTH",
|
||||
"ADJUST_CANVAS_HEIGHT",
|
||||
"RESPECT",
|
||||
""
|
||||
};
|
||||
|
||||
|
@ -465,6 +466,7 @@ void Map::zoom_to_box(box2d<double> const& box)
|
|||
|
||||
void Map::fixAspectRatio()
|
||||
{
|
||||
if (aspectFixMode_ == RESPECT) return;
|
||||
if (current_extent_.width() > 0 && current_extent_.height() > 0)
|
||||
{
|
||||
double ratio1 = static_cast<double>(width_) / static_cast<double>(height_);
|
||||
|
|
Loading…
Add table
Reference in a new issue