Skip to content

Commit

Permalink
update viewer to use vertex_adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
artemp committed Feb 9, 2015
1 parent 0f22fb5 commit 5e6468f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions demo/viewer/mapwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,22 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
std::get<1>(*itr).to_string().c_str()));
}

using path_type = mapnik::transform_path_adapter<mapnik::view_transform,mapnik::geometry_type>;
using path_type = mapnik::transform_path_adapter<mapnik::view_transform,mapnik::vertex_adapter>;

for (unsigned i=0; i<feat->num_geometries();++i)
{
mapnik::geometry_type & geom = feat->get_geometry(i);
path_type path(t,geom,prj_trans);
if (geom.size() > 0)
mapnik::geometry_type const& geom = feat->get_geometry(i);
mapnik::vertex_adapter va(geom);
path_type path(t,va,prj_trans);
if (va.size() > 0)
{
QPainterPath qpath;
double x,y;
path.vertex(&x,&y);
va.vertex(&x,&y);
qpath.moveTo(x,y);
for (unsigned j = 1; j < geom.size(); ++j)
{
path.vertex(&x,&y);
va.vertex(&x,&y);
qpath.lineTo(x,y);
}
QPainter painter(&pix_);
Expand Down

0 comments on commit 5e6468f

Please sign in to comment.