Show error message when invalid placement algorithm is selected.

This commit is contained in:
Hermann Kraus 2011-03-11 14:18:34 +00:00
parent cbbc904bbd
commit f9040c6026
2 changed files with 6 additions and 4 deletions

View file

@ -1176,6 +1176,8 @@ void map_parser::parse_text_symbolizer( rule & rule, ptree const & sym )
placement_finder = text_placements_ptr( placement_finder = text_placements_ptr(
new text_placements_simple( new text_placements_simple(
get_attr<std::string>(sym, "placements", "X"))); get_attr<std::string>(sym, "placements", "X")));
} else if (*placement_type != "dummy" && *placement_type != "") {
throw config_error(std::string("Unknown placement type '"+*placement_type+"'"));
} }
} }
if (!placement_finder) { if (!placement_finder) {

View file

@ -127,10 +127,10 @@ text_placement_info_ptr text_placements_simple::get_placement_info() const
/** Positiion string: [POS][SIZE] /** Positiion string: [POS][SIZE]
* [POS] is any combination of * [POS] is any combination of
* N, E, S, W, NE, SE, NW, SW, X (exact position) (seprated by commas) * N, E, S, W, NE, SE, NW, SW, X (exact position) (separated by commas)
* [SIZE] is a list of font sizes, seprated by commas. First fontsize * [SIZE] is a list of font sizes, separated by commas. The first font size
* is always the one given in the TextSymbolizer parameters. * is always the one given in the TextSymbolizer's parameters.
* First all directions are tried, then font size is reduced by 1pt * First all directions are tried, then font size is reduced
* and all directions are tried again. The process ends when a placement is * and all directions are tried again. The process ends when a placement is
* found or the last fontsize is tried without success. * found or the last fontsize is tried without success.
* Example: N,S,15,10,8 (tries placement above, then below and if * Example: N,S,15,10,8 (tries placement above, then below and if