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,7 +433,18 @@ void agg_renderer<T>::process(point_symbolizer const& sym,
double z=0; double z=0;
std::string filename = path_processor_type::evaluate( *sym.get_filename(), feature); 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 ) if ( data )
{ {

View file

@ -731,7 +731,18 @@ void cairo_renderer_base::process(point_symbolizer const& sym,
proj_transform const& prj_trans) proj_transform const& prj_trans)
{ {
std::string filename = path_processor_type::evaluate( *sym.get_filename(), feature); 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 ) if ( data )
{ {