~ubuntu-branches/ubuntu/trusty/mapnik/trusty

« back to all changes in this revision

Viewing changes to demo/viewer/mapwidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2010-03-18 01:07:40 UTC
  • mfrom: (1.1.4 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100318010740-u01iy3n0ux9xzzir
Tags: 0.7.0-2ubuntu1
* Merge from debian testing (LP: #526070), remaining changes:
  - Bump boost build-dep and libmapnik-dev depends to boost1.40

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
                           double x,y;
188
188
                           path.vertex(&x,&y);
189
189
                           qpath.moveTo(x,y);
190
 
                           for (int j=1; j < geom.num_points(); ++j)
 
190
                           for (unsigned j=1; j < geom.num_points(); ++j)
191
191
                           {
192
192
                              path.vertex(&x,&y);
193
193
                              qpath.lineTo(x,y);
449
449
      unsigned height=map_->getHeight();
450
450
      
451
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";
 
452
 
 
453
      try 
 
454
      {
 
455
          mapnik::agg_renderer<Image32> ren(*map_,buf);
 
456
          ren.apply();
 
457
          
 
458
          QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
 
459
          pix_=QPixmap::fromImage(image.rgbSwapped());
 
460
          update();
 
461
          // emit signal to interested widgets
 
462
          emit mapViewChanged();
 
463
          std::cout << map_->getCurrentExtent() << "\n";
 
464
      }
 
465
      catch (mapnik::config_error & ex)
 
466
      {
 
467
          std::cerr << ex.what() << std::endl;
 
468
      }
 
469
      catch (...)
 
470
      {
 
471
          std::cerr << "Unknown exception caught!\n";
 
472
      }
461
473
   }
462
474
}
463
475