Closed millapet closed 5 years ago
The placement_finder->defaults
has format_tree() member which should return the text_node
with get_text()
method, which returns the expression instance of [FIELD_NAME]
. There is to_expression_string()
function to convert the expression instance back to string.
The format_tree() returns a smart pointer to base class, so the pointer has to be dynamic-casted to text_node
to be able to call get_text()
on it.
Excellent! Thank you very much!
Hello, I am using Mapnik 3 and attempting to get back the values I set using the Text Symbolizer and I am having trouble with getting the field name.
I set it like this (same as in the demo):
placement_finder->defaults.set_format_tree(std::make_shared<mapnik::formatting::text_node>(parse_expression("[FIELD_NAME]")));
And now I would like to get _[FIELDNAME] back, ideally as a string. Is there such a way?
With the other properties it's pretty straightforward, but I would appreciate a nudge in the right direction for this. Petra