From aa1976c824f3850f83b4e585a6f33d1444731dad Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Fri, 13 Jan 2012 17:19:03 +0000 Subject: [PATCH] update 'info' tool to work with new feature impl --- demo/viewer/mapwidget.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/demo/viewer/mapwidget.cpp b/demo/viewer/mapwidget.cpp index 9a1dd40f6..f9a29ee45 100644 --- a/demo/viewer/mapwidget.cpp +++ b/demo/viewer/mapwidget.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "mapwidget.hpp" #include "info_dialog.hpp" @@ -42,6 +43,7 @@ using mapnik::geometry_ptr; using mapnik::CoordTransform; using mapnik::projection; using mapnik::scale_denominator; +using mapnik::feature_kv_iterator; double scales [] = {279541132.014, 139770566.007, @@ -170,20 +172,17 @@ void MapWidget::mousePressEvent(QMouseEvent* e) feature_ptr feat = fs->next(); if (feat) { - // FIXME - /* - std::map const& props = feat->props(); - std::map::const_iterator itr=props.begin(); - for (; itr!=props.end();++itr) - { - if (itr->second.to_string().length() > 0) - { - info.push_back(QPair(QString(itr->first.c_str()), - itr->second.to_string().c_str())); - } - } - */ - typedef mapnik::coord_transform2 path_type; + + feature_kv_iterator itr(*feat,true); + feature_kv_iterator end(*feat); + + for ( ;itr!=end; ++itr) + { + info.push_back(QPair(QString(boost::get<0>(*itr).c_str()), + boost::get<1>(*itr).to_string().c_str())); + } + + typedef mapnik::coord_transform2 path_type; for (unsigned i=0; inum_geometries();++i) {