restore default behavior of PointSymbolizer when used without an image, by defaulting to 4x4 black pixel - TODO - expose colors, shapes, and size for this in the future

This commit is contained in:
Dane Springmeyer 2010-03-03 03:26:12 +00:00
parent b540dab73b
commit b8511eca65
2 changed files with 24 additions and 2 deletions

View file

@ -433,8 +433,19 @@ void agg_renderer<T>::process(point_symbolizer const& sym,
double z=0;
std::string filename = path_processor_type::evaluate( *sym.get_filename(), feature);
boost::optional<mapnik::image_ptr> data = mapnik::image_cache::instance()->find(filename,true);
boost::optional<mapnik::image_ptr> data;
if ( filename.empty() )
{
// default OGC 4x4 black pixel
data = boost::optional<mapnik::image_ptr>(new image_data_32(4,4));
(*data)->set(0xff000000);
}
else
{
data = mapnik::image_cache::instance()->find(filename,true);
}
if ( data )
{
for (unsigned i=0;i<feature.num_geometries();++i)

View file

@ -731,7 +731,18 @@ void cairo_renderer_base::process(point_symbolizer const& sym,
proj_transform const& prj_trans)
{
std::string filename = path_processor_type::evaluate( *sym.get_filename(), feature);
boost::optional<mapnik::image_ptr> data = mapnik::image_cache::instance()->find(filename,true);
boost::optional<mapnik::image_ptr> data;
if ( filename.empty() )
{
// default OGC 4x4 black pixel
data = boost::optional<mapnik::image_ptr>(new image_data_32(4,4));
(*data)->set(0xff000000);
}
else
{
data = mapnik::image_cache::instance()->find(filename,true);
}
if ( data )
{