Show
Ignore:
Timestamp:
06/29/08 06:59:28 (6 months ago)
Author:
artem
Message:

applied aspect ratio patch from Frederik Ramm

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/include/mapnik/map.hpp

    r704 r705  
    3838    class MAPNIK_DECL Map 
    3939    {    
     40    public: 
     41 
     42        enum aspect_fix_mode  
     43        { 
     44            /* grow the width or height of the specified geo bbox to fill the map size. default behaviour. */ 
     45            GROW_BBOX, 
     46            /* grow the width or height of the map to accomodate the specified geo bbox. */ 
     47            GROW_CANVAS, 
     48            /* shrink the width or height of the specified geo bbox to fill the map size. */ 
     49            SHRINK_BBOX, 
     50            /* shrink the width or height of the map to accomodate the specified geo bbox. */ 
     51            SHRINK_CANVAS, 
     52            /* adjust the width of the specified geo bbox, leave height and map size unchanged */ 
     53            ADJUST_BBOX_WIDTH, 
     54            /* adjust the height of the specified geo bbox, leave width and map size unchanged */ 
     55            ADJUST_BBOX_HEIGHT, 
     56            /* adjust the width of the map, leave height and geo bbox unchanged */ 
     57            ADJUST_CANVAS_WIDTH, 
     58            /* adjust the height of the map, leave width and geo bbox unchanged */ 
     59            ADJUST_CANVAS_HEIGHT 
     60        }; 
     61    private: 
    4062        static const unsigned MIN_MAPSIZE=16; 
    4163        static const unsigned MAX_MAPSIZE=MIN_MAPSIZE<<10; 
     
    4870        std::vector<Layer> layers_; 
    4971        Envelope<double> currentExtent_; 
     72        aspect_fix_mode aspectFixMode_; 
    5073         
    5174    public: 
     75 
    5276        typedef std::map<std::string,feature_type_style>::const_iterator const_style_iterator; 
    5377        typedef std::map<std::string,feature_type_style>::iterator style_iterator; 
     
    259283        featureset_ptr query_map_point(unsigned index, double x, double y) const; 
    260284        ~Map(); 
     285 
     286        void setAspectFixMode(aspect_fix_mode afm) { aspectFixMode_ = afm; } 
     287        bool getAspectFixMode() { return aspectFixMode_; } 
     288 
    261289    private: 
    262290        void fixAspectRatio();