merge r1497 through r1498 from trunk into 0.7 branch

This commit is contained in:
Dane Springmeyer 2009-12-31 16:11:52 +00:00
parent f409f91250
commit 77ccb92054
4 changed files with 29 additions and 16 deletions

View file

@ -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

View file

@ -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<mapnik::Layer&> LayerListModel::map_layer(int i)
if (map_)
{
std::vector<mapnik::Layer> & layers = const_cast<std::vector<mapnik::Layer>& >(map_->layers());
if (i < layers.size())
return boost::optional<mapnik::Layer&>(layers[i]);
if (i < int(layers.size()))
return boost::optional<mapnik::layer&>(layers[i]);
}
return boost::optional<mapnik::Layer&>();
}

View file

@ -448,8 +448,11 @@ void MapWidget::updateMap()
unsigned width=map_->getWidth();
unsigned height=map_->getHeight();
Image32 buf(width,height);
mapnik::agg_renderer<Image32> ren(*map_,buf);
image_32 buf(width,height);
try
{
mapnik::agg_renderer<image_32> ren(*map_,buf);
ren.apply();
QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
@ -459,6 +462,15 @@ void MapWidget::updateMap()
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";
}
}
}
boost::shared_ptr<Map> MapWidget::getMap()

View file

@ -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