Fix BBOX in geographic WGS84 (epsg:4326) calc logic
This commit is contained in:
parent
977c65e9de
commit
eb49b5776a
1 changed files with 7 additions and 3 deletions
|
@ -23,7 +23,7 @@
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <mapnik/agg_renderer.hpp>
|
#include <mapnik/agg_renderer.hpp>
|
||||||
#include <mapnik/layer.hpp>
|
#include <mapnik/layer.hpp>
|
||||||
#include <mapnik/projection.hpp>
|
#include <mapnik/proj_transform.hpp>
|
||||||
#include <mapnik/scale_denominator.hpp>
|
#include <mapnik/scale_denominator.hpp>
|
||||||
#include <mapnik/view_transform.hpp>
|
#include <mapnik/view_transform.hpp>
|
||||||
#include <mapnik/transform_path_adapter.hpp>
|
#include <mapnik/transform_path_adapter.hpp>
|
||||||
|
@ -592,8 +592,12 @@ void MapWidget::updateMap()
|
||||||
double y0 = ext.miny();
|
double y0 = ext.miny();
|
||||||
double x1 = ext.maxx();
|
double x1 = ext.maxx();
|
||||||
double y1 = ext.maxy();
|
double y1 = ext.maxy();
|
||||||
prj.inverse(x0,y0);
|
double z = 0;
|
||||||
prj.inverse(x1,y1);
|
std::string dest_srs = {"epsg:4326"};
|
||||||
|
mapnik::proj_transform proj_tr(map_->srs(), dest_srs);
|
||||||
|
|
||||||
|
proj_tr.forward(x0, y0, z);
|
||||||
|
proj_tr.forward(x1, y1, z);
|
||||||
std::cout << "BBOX (WGS84): " << x0 << "," << y0 << "," << x1 << "," << y1 << "\n";
|
std::cout << "BBOX (WGS84): " << x0 << "," << y0 << "," << x1 << "," << y1 << "\n";
|
||||||
update();
|
update();
|
||||||
// emit signal to interested widgets
|
// emit signal to interested widgets
|
||||||
|
|
Loading…
Reference in a new issue