diff --git a/bindings/python/mapnik/__init__.py b/bindings/python/mapnik/__init__.py index 50aa277f8..12bccdac9 100644 --- a/bindings/python/mapnik/__init__.py +++ b/bindings/python/mapnik/__init__.py @@ -39,9 +39,10 @@ Several things happen when you do: """ import os + from sys import getdlopenflags, setdlopenflags try: - from dl import RTLD_NOW, RTLD_GLOBAL + from ctypes import RTLD_NOW, RTLD_GLOBAL except ImportError: RTLD_NOW = 2 RTLD_GLOBAL = 256 diff --git a/demo/viewer/layerlistmodel.cpp b/demo/viewer/layerlistmodel.cpp index 70559a26a..907494d77 100644 --- a/demo/viewer/layerlistmodel.cpp +++ b/demo/viewer/layerlistmodel.cpp @@ -41,7 +41,7 @@ QVariant LayerListModel::data(QModelIndex const& index,int role) const { if (!index.isValid() || !map_) return QVariant(); - if (index.row() < 0 || index.row() >= map_->layers().size()) + if (index.row() < 0 || index.row() >= int(map_->layers().size())) return QVariant(); if (role == Qt::DisplayRole) return QString(map_->layers().at(index.row()).name().c_str()); @@ -112,8 +112,8 @@ boost::optional LayerListModel::map_layer(int i) if (map_) { std::vector & layers = const_cast& >(map_->layers()); - if (i < layers.size()) - return boost::optional(layers[i]); + if (i < int(layers.size())) + return boost::optional(layers[i]); } return boost::optional(); } diff --git a/demo/viewer/mapwidget.cpp b/demo/viewer/mapwidget.cpp index 3d9895cc1..c2ac127dd 100644 --- a/demo/viewer/mapwidget.cpp +++ b/demo/viewer/mapwidget.cpp @@ -448,16 +448,28 @@ void MapWidget::updateMap() unsigned width=map_->getWidth(); unsigned height=map_->getHeight(); - Image32 buf(width,height); - mapnik::agg_renderer ren(*map_,buf); - ren.apply(); - - QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32); - pix_=QPixmap::fromImage(image.rgbSwapped()); - update(); - // emit signal to interested widgets - emit mapViewChanged(); - std::cout << map_->getCurrentExtent() << "\n"; + image_32 buf(width,height); + + try + { + mapnik::agg_renderer ren(*map_,buf); + ren.apply(); + + QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32); + pix_=QPixmap::fromImage(image.rgbSwapped()); + update(); + // emit signal to interested widgets + emit mapViewChanged(); + std::cout << map_->getCurrentExtent() << "\n"; + } + catch (mapnik::config_error & ex) + { + std::cerr << ex.what() << std::endl; + } + catch (...) + { + std::cerr << "Unknown exception caught!\n"; + } } } diff --git a/demo/viewer/viewer.pro b/demo/viewer/viewer.pro index 58539f9d8..12e9c7ac4 100644 --- a/demo/viewer/viewer.pro +++ b/demo/viewer/viewer.pro @@ -10,9 +10,9 @@ INCLUDEPATH += /usr/X11/include/ INCLUDEPATH += /usr/X11/include/freetype2 INCLUDEPATH += . -#QMAKE_CXXFLAGS +=' -DDARWIN' +QMAKE_CXXFLAGS +=' -DDARWIN -Wno-missing-field-initializers' unix:LIBS = -L/opt/mapnik/lib -L/usr/X11/lib -lmapnik -lfreetype -L/usr/local/lib -licuuc -unix:LIBS += -lboost_system-xgcc40-mt -lboost_filesystem-xgcc40-mt -L/opt/boost/lib +unix:LIBS += -lboost_system -lboost_filesystem -lboost_regex -L/opt/boost/lib # Input