From f9040c6026684486c9d7bf068b568a6dc9ad8ae3 Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Fri, 11 Mar 2011 14:18:34 +0000 Subject: [PATCH] Show error message when invalid placement algorithm is selected. --- src/load_map.cpp | 2 ++ src/text_placements.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/load_map.cpp b/src/load_map.cpp index 2c6c3f8f2..fc8312260 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -1176,6 +1176,8 @@ void map_parser::parse_text_symbolizer( rule & rule, ptree const & sym ) placement_finder = text_placements_ptr( new text_placements_simple( get_attr(sym, "placements", "X"))); + } else if (*placement_type != "dummy" && *placement_type != "") { + throw config_error(std::string("Unknown placement type '"+*placement_type+"'")); } } if (!placement_finder) { diff --git a/src/text_placements.cpp b/src/text_placements.cpp index e7e003ba8..58c3ace0e 100644 --- a/src/text_placements.cpp +++ b/src/text_placements.cpp @@ -127,10 +127,10 @@ text_placement_info_ptr text_placements_simple::get_placement_info() const /** Positiion string: [POS][SIZE] * [POS] is any combination of - * N, E, S, W, NE, SE, NW, SW, X (exact position) (seprated by commas) - * [SIZE] is a list of font sizes, seprated by commas. First fontsize - * is always the one given in the TextSymbolizer parameters. - * First all directions are tried, then font size is reduced by 1pt + * N, E, S, W, NE, SE, NW, SW, X (exact position) (separated by commas) + * [SIZE] is a list of font sizes, separated by commas. The first font size + * is always the one given in the TextSymbolizer's parameters. + * First all directions are tried, then font size is reduced * and all directions are tried again. The process ends when a placement is * found or the last fontsize is tried without success. * Example: N,S,15,10,8 (tries placement above, then below and if