예제 #1
0
function mapnik_style_line_text($dom, $rule_id, $tags, $global_tags, $importance) {
  global $scales_levels;
  global $scale_text;
  global $lists_dir;
  global $default_style;
  $add_columns=array();

  $rule=$dom->createElement("Rule");
  $filter=$dom->createElement("Filter");
  $rule->appendChild($filter);
  $filter->appendChild($dom->createTextNode("[rule_id] = '$rule_id'"));

  $scale=$dom->createElement("MaxScaleDenominator");
  $rule->appendChild($scale);
  $scale->appendChild($dom->createTextNode(
    $scales_levels[$scale_text[$importance]]));

  $add_columns[]="tags_parse|line_text";
  $sym=$dom->createElement("TextSymbolizer");
  $rule->appendChild($sym);

  $sym->setAttribute("name", "line_text");
  $sym->setAttribute("placement", "line");

  $style=new css($default_style['line_text_style']);
  $style->apply($global_tags->get("line_text_style"));
  $style->apply($tags->get("line_text_style"));
  foreach(array("name") as $a)
    unset($style->style[$a]);
  $style->dom_set_attributes($sym, $dom);

/*  $sym=$dom->createElement("TextSymbolizer");
  $rule->appendChild($sym);

  $sym->setAttribute("name", "line_type");
  $sym->setAttribute("placement", "line");

  $style=new css("fontset_name: book; fill: #000000; size: 10; halo_fill: #ffffff; halo_radius: 1; spacing: 300;");
  $style->apply($global_tags->get("display_style"));
  $style->apply($tags->get("display_style"));
  $style->style['size']-=2;
  foreach(array("name") as $a)
    unset($style->style[$a]);
  $style->dom_set_attributes($sym, $dom); */

  return array('rule'=>$rule, 'columns'=>$add_columns);
}