symbolizer_property_value_string - handle value_bool, value_integer, value_double + dash_array

This commit is contained in:
Artem Pavlenko 2024-05-21 09:15:50 +01:00
parent 4114824e6b
commit 658a8bb080

View file

@ -24,6 +24,7 @@
#define MAPNIK_SYMBOLIZER_UTILS_HPP #define MAPNIK_SYMBOLIZER_UTILS_HPP
// mapnik // mapnik
#include <mapnik/boolean.hpp>
#include <mapnik/symbolizer_keys.hpp> #include <mapnik/symbolizer_keys.hpp>
#include <mapnik/raster_colorizer.hpp> #include <mapnik/raster_colorizer.hpp>
#include <mapnik/path_expression.hpp> #include <mapnik/path_expression.hpp>
@ -216,12 +217,35 @@ class symbolizer_property_value_string
std::string operator()(dash_array const& dash) const std::string operator()(dash_array const& dash) const
{ {
std::ostringstream ss; std::ostringstream ss;
ss << '[';
for (std::size_t i = 0; i < dash.size(); ++i) for (std::size_t i = 0; i < dash.size(); ++i)
{ {
ss << dash[i].first << "," << dash[i].second; ss << dash[i].first << "," << dash[i].second;
if (i + 1 < dash.size()) if (i + 1 < dash.size())
ss << ','; ss << ',';
} }
ss << ']';
return ss.str();
}
std::string operator()(mapnik::value_double val) const
{
std::ostringstream ss;
ss << val;
return ss.str();
}
std::string operator()(mapnik::value_integer val) const
{
std::ostringstream ss;
ss << val;
return ss.str();
}
std::string operator()(mapnik::value_bool val) const
{
std::ostringstream ss;
ss << mapnik::boolean_type(val);
return ss.str(); return ss.str();
} }