Changeset 703
- Timestamp:
- 06/29/08 06:58:29 (8 weeks ago)
- Location:
- trunk
- Files:
-
- 1 removed
- 25 modified
-
SConstruct (modified) (5 diffs)
-
agg/include/agg_config.h (modified) (1 diff)
-
bindings/python/SConscript (modified) (1 diff)
-
demo/c++/rundemo.cpp (modified) (2 diffs)
-
demo/python/rundemo.py (modified) (1 diff)
-
demo/viewer/main.cpp (modified) (1 diff)
-
demo/viewer/mainwindow.cpp (modified) (1 diff)
-
demo/viewer/mapwidget.cpp (modified) (17 diffs)
-
demo/viewer/mapwidget.hpp (modified) (3 diffs)
-
demo/viewer/viewer.pro (modified) (3 diffs)
-
include/mapnik/agg_renderer.hpp (modified) (1 diff)
-
include/mapnik/ctrans.hpp (modified) (1 diff)
-
include/mapnik/font_set.hpp (deleted)
-
include/mapnik/unicode.hpp (modified) (1 diff)
-
plugins/input/gdal/SConscript (modified) (1 diff)
-
plugins/input/postgis/SConscript (modified) (1 diff)
-
plugins/input/raster/SConscript (modified) (1 diff)
-
plugins/input/shape/SConscript (modified) (1 diff)
-
plugins/input/shape/dbffile.hpp (modified) (1 diff)
-
src/agg_renderer.cpp (modified) (8 diffs)
-
src/cairo_renderer.cpp (modified) (1 diff)
-
src/load_map.cpp (modified) (9 diffs)
-
src/map.cpp (modified) (5 diffs)
-
src/text_symbolizer.cpp (modified) (5 diffs)
-
src/unicode.cpp (modified) (1 diff)
-
utils/shapeindex/SConscript (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r701 r703 46 46 opts.Add(PathOption('PNG_INCLUDES', 'Search path for libpng include files', '/usr/include')) 47 47 opts.Add(PathOption('PNG_LIBS','Search path for libpng include files','/usr/' + LIBDIR_SCHEMA)) 48 opts.Add(PathOption('JPEG_INCLUDES', 'Search path for libjpeg include files', '/usr/ local/include'))49 opts.Add(PathOption('JPEG_LIBS', 'Search path for libjpeg library files', '/usr/ local/' + LIBDIR_SCHEMA))48 opts.Add(PathOption('JPEG_INCLUDES', 'Search path for libjpeg include files', '/usr/include')) 49 opts.Add(PathOption('JPEG_LIBS', 'Search path for libjpeg library files', '/usr/' + LIBDIR_SCHEMA)) 50 50 opts.Add(PathOption('TIFF_INCLUDES', 'Search path for libtiff include files', '/usr/include')) 51 51 opts.Add(PathOption('TIFF_LIBS', 'Search path for libtiff library files', '/usr/' + LIBDIR_SCHEMA)) 52 52 opts.Add(PathOption('PGSQL_INCLUDES', 'Search path for PostgreSQL include files', '/usr/include')) 53 53 opts.Add(PathOption('PGSQL_LIBS', 'Search path for PostgreSQL library files', '/usr/' + LIBDIR_SCHEMA)) 54 opts.Add(PathOption('PROJ_INCLUDES', 'Search path for PROJ.4 include files', '/ opt/proj4/include'))55 opts.Add(PathOption('PROJ_LIBS', 'Search path for PROJ.4 library files', '/ opt/proj4/' + LIBDIR_SCHEMA))54 opts.Add(PathOption('PROJ_INCLUDES', 'Search path for PROJ.4 include files', '/usr/local/include')) 55 opts.Add(PathOption('PROJ_LIBS', 'Search path for PROJ.4 library files', '/usr/local/' + LIBDIR_SCHEMA)) 56 56 opts.Add(PathOption('GDAL_INCLUDES', 'Search path for GDAL include files', '/usr/include')) 57 57 opts.Add(PathOption('GDAL_LIBS', 'Search path for GDAL library files', '/usr/' + LIBDIR_SCHEMA)) 58 58 opts.Add(PathOption('PYTHON','Python executable', sys.executable)) 59 opts.Add(ListOption('INPUT_PLUGINS','Input drivers to include','all',['postgis','shape','raster','gdal' ,'osm']))59 opts.Add(ListOption('INPUT_PLUGINS','Input drivers to include','all',['postgis','shape','raster','gdal'])) 60 60 opts.Add(ListOption('BINDINGS','Language bindings to build','all',['python'])) 61 61 opts.Add(BoolOption('DEBUG', 'Compile a debug version of mapnik', 'False')) … … 155 155 156 156 BOOST_LIBSHEADERS = [ 157 ['system', 'boost/system/system_error.hpp', True], # uncomment this on Darwin + boost_1_35157 # ['system', 'boost/system/system_error.hpp', True], # uncomment this on Darwin + boost_1_35 158 158 ['filesystem', 'boost/filesystem/operations.hpp', True], 159 159 ['regex', 'boost/regex.hpp', True], … … 179 179 else: 180 180 env['BOOST_APPEND']='' 181 182 181 183 182 for count, libinfo in enumerate(BOOST_LIBSHEADERS): 184 183 if env['THREADING'] == 'multi' : 185 if not conf.CheckLibWithHeader('boost_%s%s%s' % (libinfo[0], thread_suffix,env['BOOST_APPEND']), libinfo[1], 'C++') and libinfo[2] :184 if not conf.CheckLibWithHeader('boost_%s%s%s' % (libinfo[0],env['BOOST_APPEND'],thread_suffix), libinfo[1], 'C++') and libinfo[2] : 186 185 color_print(1,'Could not find header or shared library for boost %s, exiting!' % libinfo[0]) 187 186 Exit(1) … … 205 204 206 205 # Build shapeindex and remove its dependency from the LIBS 207 # if 'boost_program_options%s%s-1_35' % (env['BOOST_APPEND'],thread_suffix) in env['LIBS']: 208 if 'boost_program_options-mt-1_35' in env['LIBS']: 206 if 'boost_program_options%s%s' % (env['BOOST_APPEND'],thread_suffix) in env['LIBS']: 209 207 SConscript('utils/shapeindex/SConscript') 210 env['LIBS'].remove('boost_program_options -mt-1_35')208 env['LIBS'].remove('boost_program_options%s%s' % (env['BOOST_APPEND'],thread_suffix)) 211 209 212 210 # Build the input plug-ins 213 214 211 if 'postgis' in inputplugins and 'pq' in env['LIBS']: 215 212 SConscript('plugins/input/postgis/SConscript') … … 225 222 SConscript('plugins/input/gdal/SConscript') 226 223 227 if ' osm' in inputplugins:228 SConscript('plugins/input/ osm/SConscript')224 if 'gigabase' in inputplugins and 'gigabase_r' in env['LIBS']: 225 SConscript('plugins/input/gigabase/SConscript') 229 226 230 227 # Build the Python bindings. -
trunk/agg/include/agg_config.h
r701 r703 34 34 // such as blur, image filtering: 35 35 36 //#define AGG_RENDERING_BUFFER row_ptr_cache<int8u>36 #define AGG_RENDERING_BUFFER row_ptr_cache<int8u> 37 37 // 38 38 // Provides cheaper creation and destruction (no mem allocs): -
trunk/bindings/python/SConscript
r701 r703 41 41 libraries = ['mapnik','png','jpeg'] 42 42 if env['THREADING'] == 'multi': 43 #libraries.append('boost_python%s%s-1_35' % (env['BOOST_APPEND'],thread_suffix)) 44 libraries.append('boost_python%s-1_35' % (thread_suffix)) 45 #else : 46 # libraries.append('boost_python%s' % env['BOOST_APPEND']) 43 libraries.append('boost_python%s%s' % (env['BOOST_APPEND'],thread_suffix)) 44 else : 45 libraries.append('boost_python%s' % env['BOOST_APPEND']) 47 46 48 47 if env['PLATFORM'] == 'Darwin': 49 libraries.append(env['LIBS'])50 48 libraries.append('icuuc') 51 49 libraries.append('icudata') 52 #if env['THREADING'] == 'multi': 53 # libraries.append('boost_regex%s%s' % (env['BOOST_APPEND'],thread_suffix)) 54 #else : 55 # libraries.append('boost_regex%s' % env['BOOST_APPEND']) 56 57 #if env['THREADING'] == 'multi': 58 # libraries.append('boost_thread%s%s' % (env['BOOST_APPEND'],thread_suffix)) 50 if env['THREADING'] == 'multi': 51 libraries.append('boost_regex%s%s' % (env['BOOST_APPEND'],thread_suffix)) 52 else : 53 libraries.append('boost_regex%s' % env['BOOST_APPEND']) 54 if env['THREADING'] == 'multi': 55 libraries.append('boost_thread%s%s' % (env['BOOST_APPEND'],thread_suffix)) 59 56 if '-DHAVE_PYCAIRO' in env['CXXFLAGS']: 60 57 libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')]) -
trunk/demo/c++/rundemo.cpp
r701 r703 29 29 #include <mapnik/font_engine_freetype.hpp> 30 30 #include <mapnik/agg_renderer.hpp> 31 #include <mapnik/cairo_renderer.hpp>32 31 #include <mapnik/filter_factory.hpp> 33 32 #include <mapnik/color_factory.hpp> … … 54 53 55 54 Map m(800,600); 56 57 mapnik::load_map(m,"/Users/artem/projects/openstreetmap/mapnik/openstreetmap_kleptog.xml"); 58 59 m.zoomToBox(Envelope<double>(-762470.6985688356,4004842.088052442,-761928.349698612,4005328.834769584)); 60 61 //Image32 buf(m.getWidth(),m.getHeight()); 62 //agg_renderer<Image32> ren(m,buf); 63 //ren.apply(); 64 65 //save_to_file<ImageData32>(buf.data(),"demo.jpg","jpeg"); 66 //save_to_file<ImageData32>(buf.data(),"demo.png","png"); 67 //save_to_file<ImageData32>(buf.data(),"demo256.png","png256"); 68 //std::cout << "Three maps have been rendered in the current directory:\n" 69 // "- demo.jpg\n" 70 // "- demo.png\n" 71 // "- demo256.png\n" 72 // "Have a look!\n"; 73 74 // Cairo renderer 75 76 // Pdf 77 Cairo::RefPtr<Cairo::PdfSurface> pdf = Cairo::PdfSurface::create("mapnik.pdf",m.getWidth(),m.getHeight()); 78 mapnik::cairo_renderer<Cairo::Surface> cairo1(m, pdf); 79 cairo1.apply(); 80 // Svg 81 //Cairo::RefPtr<Cairo::SvgSurface> svg = Cairo::SvgSurface::create("demo.svg",m.getWidth(),m.getHeight()); 82 //mapnik::cairo_renderer<Cairo::Surface> cairo2(m, svg); 83 //cairo2.apply(); 84 // Png 85 //Cairo::RefPtr<Cairo::ImageSurface> image = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32,m.getWidth(),m.getHeight()); 86 //mapnik::cairo_renderer<Cairo::Surface> cairo3(m, image); 87 //cairo3.apply(); 88 89 //std::string filename = "demo_cairo.png"; 90 //image->write_to_png(filename); 91 92 // Ps 93 //Cairo::RefPtr<Cairo::PsSurface> ps = Cairo::PsSurface::create("demo.ps",m.getWidth(),m.getHeight()); 94 //mapnik::cairo_renderer<Cairo::Surface> cairo4(m, ps); 95 //cairo4.apply(); 96 55 m.set_background(color_factory::from_string("white")); 56 57 // create styles 58 59 // Provinces (polygon) 60 feature_type_style provpoly_style; 61 62 rule_type provpoly_rule_on; 63 provpoly_rule_on.set_filter(create_filter("[NAME_EN] = 'Ontario'")); 64 provpoly_rule_on.append(polygon_symbolizer(Color(250, 190, 183))); 65 provpoly_style.add_rule(provpoly_rule_on); 66 67 rule_type provpoly_rule_qc; 68 provpoly_rule_qc.set_filter(create_filter("[NAME_EN] = 'Quebec'")); 69 provpoly_rule_qc.append(polygon_symbolizer(Color(217, 235, 203))); 70 provpoly_style.add_rule(provpoly_rule_qc); 71 72 m.insert_style("provinces",provpoly_style); 73 74 // Provinces (polyline) 75 feature_type_style provlines_style; 76 77 stroke provlines_stk (Color(0,0,0),1.0); 78 provlines_stk.add_dash(8, 4); 79 provlines_stk.add_dash(2, 2); 80 provlines_stk.add_dash(2, 2); 81 82 rule_type provlines_rule; 83 provlines_rule.append(line_symbolizer(provlines_stk)); 84 provlines_style.add_rule(provlines_rule); 85 86 m.insert_style("provlines",provlines_style); 87 88 // Drainage 89 feature_type_style qcdrain_style; 90 91 rule_type qcdrain_rule; 92 qcdrain_rule.set_filter(create_filter("[HYC] = 8")); 93 qcdrain_rule.append(polygon_symbolizer(Color(153, 204, 255))); 94 qcdrain_style.add_rule(qcdrain_rule); 95 96 m.insert_style("drainage",qcdrain_style); 97 98 // Roads 3 and 4 (The "grey" roads) 99 feature_type_style roads34_style; 100 rule_type roads34_rule; 101 roads34_rule.set_filter(create_filter("[CLASS] = 3 or [CLASS] = 4")); 102 stroke roads34_rule_stk(Color(171,158,137),2.0); 103 roads34_rule_stk.set_line_cap(ROUND_CAP); 104 roads34_rule_stk.set_line_join(ROUND_JOIN); 105 roads34_rule.append(line_symbolizer(roads34_rule_stk)); 106 roads34_style.add_rule(roads34_rule); 107 108 m.insert_style("smallroads",roads34_style); 109 110 111 // Roads 2 (The thin yellow ones) 112 feature_type_style roads2_style_1; 113 rule_type roads2_rule_1; 114 roads2_rule_1.set_filter(create_filter("[CLASS] = 2")); 115 stroke roads2_rule_stk_1(Color(171,158,137),4.0); 116 roads2_rule_stk_1.set_line_cap(ROUND_CAP); 117 roads2_rule_stk_1.set_line_join(ROUND_JOIN); 118 roads2_rule_1.append(line_symbolizer(roads2_rule_stk_1)); 119 roads2_style_1.add_rule(roads2_rule_1); 120 121 m.insert_style("road-border", roads2_style_1); 122 123 feature_type_style roads2_style_2; 124 rule_type roads2_rule_2; 125 roads2_rule_2.set_filter(create_filter("[CLASS] = 2")); 126 stroke roads2_rule_stk_2(Color(255,250,115),2.0); 127 roads2_rule_stk_2.set_line_cap(ROUND_CAP); 128 roads2_rule_stk_2.set_line_join(ROUND_JOIN); 129 roads2_rule_2.append(line_symbolizer(roads2_rule_stk_2)); 130 roads2_style_2.add_rule(roads2_rule_2); 131 132 m.insert_style("road-fill", roads2_style_2); 133 134 // Roads 1 (The big orange ones, the highways) 135 feature_type_style roads1_style_1; 136 rule_type roads1_rule_1; 137 roads1_rule_1.set_filter(create_filter("[CLASS] = 1")); 138 stroke roads1_rule_stk_1(Color(188,149,28),7.0); 139 roads1_rule_stk_1.set_line_cap(ROUND_CAP); 140 roads1_rule_stk_1.set_line_join(ROUND_JOIN); 141 roads1_rule_1.append(line_symbolizer(roads1_rule_stk_1)); 142 roads1_style_1.add_rule(roads1_rule_1); 143 m.insert_style("highway-border", roads1_style_1); 144 145 feature_type_style roads1_style_2; 146 rule_type roads1_rule_2; 147 roads1_rule_2.set_filter(create_filter("[CLASS] = 1")); 148 stroke roads1_rule_stk_2(Color(242,191,36),5.0); 149 roads1_rule_stk_2.set_line_cap(ROUND_CAP); 150 roads1_rule_stk_2.set_line_join(ROUND_JOIN); 151 roads1_rule_2.append(line_symbolizer(roads1_rule_stk_2)); 152 roads1_style_2.add_rule(roads1_rule_2); 153 m.insert_style("highway-fill", roads1_style_2); 154 155 // Populated Places 156 157 feature_type_style popplaces_style; 158 rule_type popplaces_rule; 159 text_symbolizer popplaces_text_symbolizer("GEONAME","DejaVu Sans Book",10,Color(0,0,0)); 160 popplaces_text_symbolizer.set_halo_fill(Color(255,255,200)); 161 popplaces_text_symbolizer.set_halo_radius(1); 162 popplaces_rule.append(popplaces_text_symbolizer); 163 popplaces_style.add_rule(popplaces_rule); 164 165 m.insert_style("popplaces",popplaces_style ); 166 167 // Layers 168 // Provincial polygons 169 { 170 parameters p; 171 p["type"]="shape"; 172 p["file"]="../data/boundaries"; 173 174 Layer lyr("Provinces"); 175 lyr.set_datasource(datasource_cache::instance()->create(p)); 176 lyr.add_style("provinces"); 177 m.addLayer(lyr); 178 } 179 180 // Drainage 181 { 182 parameters p; 183 p["type"]="shape"; 184 p["file"]="../data/qcdrainage"; 185 Layer lyr("Quebec Hydrography"); 186 lyr.set_datasource(datasource_cache::instance()->create(p)); 187 lyr.add_style("drainage"); 188 m.addLayer(lyr); 189 } 190 191 { 192 parameters p; 193 p["type"]="shape"; 194 p["file"]="../data/ontdrainage"; 195 196 Layer lyr("Ontario Hydrography"); 197 lyr.set_datasource(datasource_cache::instance()->create(p)); 198 lyr.add_style("drainage"); 199 m.addLayer(lyr); 200 } 201 202 // Provincial boundaries 203 { 204 parameters p; 205 p["type"]="shape"; 206 p["file"]="../data/boundaries_l"; 207 Layer lyr("Provincial borders"); 208 lyr.set_datasource(datasource_cache::instance()->create(p)); 209 lyr.add_style("provlines"); 210 m.addLayer(lyr); 211 } 212 213 // Roads 214 { 215 parameters p; 216 p["type"]="shape"; 217 p["file"]="../data/roads"; 218 Layer lyr("Roads"); 219 lyr.set_datasource(datasource_cache::instance()->create(p)); 220 lyr.add_style("smallroads"); 221 lyr.add_style("road-border"); 222 lyr.add_style("road-fill"); 223 lyr.add_style("highway-border"); 224 lyr.add_style("highway-fill"); 225 226 m.addLayer(lyr); 227 } 228 // popplaces 229 { 230 parameters p; 231 p["type"]="shape"; 232 p["file"]="../data/popplaces"; 233 p["encoding"] = "latin1"; 234 Layer lyr("Populated Places"); 235 lyr.set_datasource(datasource_cache::instance()->create(p)); 236 lyr.add_style("popplaces"); 237 m.addLayer(lyr); 238 } 239 240 m.zoomToBox(Envelope<double>(1405120.04127408,-247003.813399447, 241 1706357.31328276,-25098.593149577)); 242 243 Image32 buf(m.getWidth(),m.getHeight()); 244 agg_renderer<Image32> ren(m,buf); 245 ren.apply(); 246 247 save_to_file<ImageData32>(buf.data(),"demo.jpg","jpeg"); 248 save_to_file<ImageData32>(buf.data(),"demo.png","png"); 249 save_to_file<ImageData32>(buf.data(),"demo256.png","png256"); 250 std::cout << "Three maps have been rendered in the current directory:\n" 251 "- demo.jpg\n" 252 "- demo.png\n" 253 "- demo256.png\n" 254 "Have a look!\n"; 97 255 } 98 256 catch ( const mapnik::config_error & ex ) -
trunk/demo/python/rundemo.py
r701 r703 317 317 images.append('demo.jpg') 318 318 319 save_map(m,'map.xml')320 321 319 # Render cairo examples 322 320 try: -
trunk/demo/viewer/main.cpp
r701 r703 36 36 freetype_engine::register_font("/opt/mapnik/lib/mapnik/fonts/DejaVuSans-Bold.ttf"); 37 37 freetype_engine::register_font("/opt/mapnik/lib/mapnik/fonts/DejaVuSansMono.ttf"); 38 freetype_engine::register_font("/System/Library/Fonts/Monaco.dfont"); 39 freetype_engine::register_font("/Users/artem/Desktop/japanese.otf"); 40 freetype_engine::register_font("/Users/artem/Desktop/IPAfont00201/ipagp.ttf"); 41 freetype_engine::register_font("/Users/artem/Desktop/IPAfont00201/ipag.ttf"); 42 38 39 43 40 QApplication app( argc, argv ); 44 41 MainWindow window; -
trunk/demo/viewer/mainwindow.cpp
r701 r703 93 93 connect(slider_,SIGNAL(valueChanged(int)),mapWidget_,SLOT(zoomToLevel(int))); 94 94 // 95 connect(layerTab_,SIGNAL(update_mapwidget()),mapWidget_,SLOT( renderMap()));95 connect(layerTab_,SIGNAL(update_mapwidget()),mapWidget_,SLOT(updateMap())); 96 96 connect(layerTab_,SIGNAL(layerSelected(int)), 97 97 mapWidget_,SLOT(layerSelected(int))); -
trunk/demo/viewer/mapwidget.cpp
r701 r703 30 30 #include "mapwidget.hpp" 31 31 #include "info_dialog.hpp" 32 #include <unicode/unistr.h>33 32 34 33 using mapnik::Image32; … … 81 80 pen_.setCapStyle(Qt::RoundCap); 82 81 pen_.setJoinStyle(Qt::RoundJoin); 83 connect(&thread_, SIGNAL(renderedMap(const QImage &)),84 this, SLOT(updateMap(const QImage &)));85 82 } 86 83 … … 125 122 { 126 123 map_->resize(ev->size().width(),ev->size().height()); 127 renderMap();124 updateMap(); 128 125 } 129 126 } … … 175 172 if (itr->second.to_string().length() > 0) 176 173 { 177 UnicodeString unicode = itr->second.to_unicode();178 174 info.push_back(QPair<QString,QString>(QString(itr->first.c_str()), 179 QString((QChar*)unicode.getBuffer(),unicode.length())));175 itr->second.to_string().c_str())); 180 176 } 181 177 } … … 228 224 else if (e->button()==Qt::RightButton) 229 225 { 230 // renderMap();226 //updateMap(); 231 227 } 232 228 } … … 256 252 Envelope<double> box = t.backward(Envelope<double>(start_x_,start_y_,end_x_,end_y_)); 257 253 map_->zoomToBox(box); 258 renderMap();254 updateMap(); 259 255 } 260 256 } … … 269 265 int dy = end_y_ - start_y_; 270 266 map_->pan(cx - dx ,cy - dy); 271 renderMap();267 updateMap(); 272 268 } 273 269 } … … 338 334 { 339 335 map_->zoomToBox(bbox); 340 renderMap();336 updateMap(); 341 337 } 342 338 } … … 348 344 map_->resize(width(),height()); 349 345 map_->zoom_all(); 350 renderMap();346 updateMap(); 351 347 } 352 348 } … … 357 353 { 358 354 map_->zoom(0.5); 359 renderMap();355 updateMap(); 360 356 } 361 357 } … … 366 362 { 367 363 map_->zoom(2.0); 368 renderMap();364 updateMap(); 369 365 } 370 366 } … … 377 373 double cy = 0.5*map_->getHeight(); 378 374 map_->pan(int(cx),int(cy - cy*0.25)); 379 renderMap();375 updateMap(); 380 376 } 381 377 } … … 388 384 double cy = 0.5*map_->getHeight(); 389 385 map_->pan(int(cx),int(cy + cy*0.25)); 390 renderMap();386 updateMap(); 391 387 } 392 388 } … … 399 395 double cy = 0.5*map_->getHeight(); 400 396 map_->pan(int(cx - cx * 0.25),int(cy)); 401 renderMap();397 updateMap(); 402 398 } 403 399 } … … 410 406 double cy = 0.5*map_->getHeight(); 411 407 map_->pan(int(cx + cx * 0.25),int(cy)); 412 renderMap();408 updateMap(); 413 409 } 414 410 } … … 433 429 pt.y + 0.5 * height*res); 434 430 map_->zoomToBox(box); 435 renderMap();431 updateMap(); 436 432 } 437 433 } … … 446 442 447 443 448 void MapWidget::renderMap() 449 { 450 thread_.render(map_); 451 } 452 453 void MapWidget::updateMap(QImage const& image) 454 { 455 std::cout << "updateMap called \n"; 456 pix_ = QPixmap::fromImage(image); 457 update(); 458 // emit signal to interested widgets 459 emit mapViewChanged(); 460 std::cout << map_->getCurrentExtent() << "\n"; 444 void MapWidget::updateMap() 445 { 446 if (map_) 447 { 448 unsigned width=map_->getWidth(); 449 unsigned height=map_->getHeight(); 450 451 Image32 buf(width,height); 452 mapnik::agg_renderer<Image32> ren(*map_,buf); 453 ren.apply(); 454 455 QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32); 456 pix_=QPixmap::fromImage(image.rgbSwapped()); 457 update(); 458 // emit signal to interested widgets 459 emit mapViewChanged(); 460 std::cout << map_->getCurrentExtent() << "\n"; 461 } 461 462 } 462 463 -
trunk/demo/viewer/mapwidget.hpp
r701 r703 32 32 #include <boost/scoped_ptr.hpp> 33 33 #include <mapnik/map.hpp> 34 #include "renderthread.hpp"35 34 36 35 class MapWidget : public QWidget … … 60 59 QPen pen_; 61 60 int selectedLayer_; 62 RenderThread thread_;63 61 public: 64 62 MapWidget(QWidget *parent=0); … … 75 73 void panUp(); 76 74 void panDown(); 77 void renderMap();78 75 public slots: 79 76 void zoomToLevel(int level); 80 void updateMap( QImage const&);77 void updateMap(); 81 78 void layerSelected(int); 82 79 signals: -
trunk/demo/viewer/viewer.pro
r701 r703 6 6 7 7 INCLUDEPATH += /opt/mapnik/include 8 INCLUDEPATH += /opt/boost -trunk/include/boost-1_359 INCLUDEPATH += /usr/ X11/include8 INCLUDEPATH += /opt/boost/include/boost-1_34_1 9 INCLUDEPATH += /usr/local/include/freetype2 10 10 INCLUDEPATH += . 11 11 12 12 QMAKE_CXXFLAGS +=' -DDARWIN'
