+ zoom_all on startup
This commit is contained in:
Artem Pavlenko 2010-01-20 15:25:41 +00:00
parent c8ca617832
commit a42f3d7265
2 changed files with 12 additions and 9 deletions

View file

@ -169,8 +169,11 @@ void MainWindow::load_map_file(QString const& filename)
unsigned height = mapWidget_->height(); unsigned height = mapWidget_->height();
boost::shared_ptr<mapnik::Map> map(new mapnik::Map(width,height)); boost::shared_ptr<mapnik::Map> map(new mapnik::Map(width,height));
mapnik::load_map(*map,filename.toStdString()); mapnik::load_map(*map,filename.toStdString());
mapWidget_->setMap(map); mapWidget_->setMap(map);
mapWidget_->zoomToBox(default_extent_); map->zoom_all();
mapnik::box2d<double> const& ext = map->getCurrentExtent();
mapWidget_->zoomToBox(ext);
layerTab_->setModel(new LayerListModel(map,this)); layerTab_->setModel(new LayerListModel(map,this));
styleTab_->setModel(new StyleModel(map,this)); styleTab_->setModel(new StyleModel(map,this));
} }