protected function drawRoutedLine($start, $end) {
    if ($this->map["type"] == MAPTYPE_HORIZONTAL) {
      ImageLine($this->img,
        $start->x,
        $start->y,
        $start->x,
        $start->y-($start->y-$end->y)/2,
        $this->lineColor);
      ImageLine($this->img,
        $start->x,
        $start->y-($start->y-$end->y)/2,
        $end->x,
        $start->y-($start->y-$end->y)/2,
        $this->lineColor);
      ImageLine($this->img,
        $end->x,
        $start->y-($start->y-$end->y)/2,
        $end->x,
        $end->y,
        $this->lineColor);
    }
    else {
      ImageLine($this->img,
        $start->x,
        $start->y,
        $start->x+($end->x-$start->x)/2,
        $start->y,
        $this->lineColor);
      ImageLine($this->img,
        $start->x+($end->x-$start->x)/2,
        $start->y,
        $start->x+($end->x-$start->x)/2,
        $end->y,
        $this->lineColor);
      ImageLine($this->img,
        $start->x+($end->x-$start->x)/2,
        $end->y,
        $end->x,
        $end->y,
        $this->lineColor);
    }
  }