5require_once(
"./Services/COPage/classes/class.ilPageContent.php");
 
   34        parent::setNode($a_node);               
 
   35        $this->map_node = $a_node->first_child();               
 
   44    public function create(&$a_pg_obj, $a_hier_id, $a_pc_id = 
"")
 
   49        $this->map_node = $this->dom->create_element(
"Map");
 
   50        $this->map_node = $this->node->append_child($this->map_node);
 
   51        $this->map_node->set_attribute(
"Latitude", 
"0");
 
   52        $this->map_node->set_attribute(
"Longitude", 
"0");
 
   53        $this->map_node->set_attribute(
"Zoom", 
"3");
 
   64            $this->map_node->set_attribute(
"Latitude", $a_lat);
 
   66            if ($this->map_node->has_attribute(
"Latitude")) {
 
   67                $this->map_node->remove_attribute(
"Latitude");
 
   79        if (is_object($this->map_node)) {
 
   80            return $this->map_node->get_attribute(
"Latitude");
 
   91        if (!empty($a_long)) {
 
   92            $this->map_node->set_attribute(
"Longitude", $a_long);
 
   94            if ($this->map_node->has_attribute(
"Longitude")) {
 
   95                $this->map_node->remove_attribute(
"Longitude");
 
  107        if (is_object($this->map_node)) {
 
  108            return $this->map_node->get_attribute(
"Longitude");
 
  119        if (!empty($a_zoom)) {
 
  120            $this->map_node->set_attribute(
"Zoom", $a_zoom);
 
  122            if ($this->map_node->has_attribute(
"Zoom")) {
 
  123                $this->map_node->remove_attribute(
"Zoom");
 
  135        if (is_object($this->map_node)) {
 
  136            return $this->map_node->get_attribute(
"Zoom");
 
  147    public function setLayout($a_width, $a_height, $a_horizontal_align)
 
  149        if (is_object($this->map_node)) {
 
  150            ilDomUtil::setFirstOptionalElement(
 
  156                array(
"Width" => $a_width,
 
  157                    "Height" => $a_height, 
"HorizontalAlign" => $a_horizontal_align)
 
  169        if (is_object($this->map_node)) {
 
  170            $childs = $this->map_node->child_nodes();
 
  171            foreach ($childs as $child) {
 
  172                if ($child->node_name() == 
"Layout") {
 
  173                    return $child->get_attribute(
"Width");
 
  186        if (is_object($this->map_node)) {
 
  187            $childs = $this->map_node->child_nodes();
 
  188            foreach ($childs as $child) {
 
  189                if ($child->node_name() == 
"Layout") {
 
  190                    return $child->get_attribute(
"Height");
 
  203        if (is_object($this->map_node)) {
 
  204            $childs = $this->map_node->child_nodes();
 
  205            foreach ($childs as $child) {
 
  206                if ($child->node_name() == 
"Layout") {
 
  207                    return $child->get_attribute(
"HorizontalAlign");
 
  220        if (is_object($this->map_node)) {
 
  221            ilDomUtil::setFirstOptionalElement(
 
  239        if (is_object($this->map_node)) {
 
  240            $childs = $this->map_node->child_nodes();
 
  241            foreach ($childs as $child) {
 
  242                if ($child->node_name() == 
"MapCaption") {
 
  243                    return $child->get_content();
 
  251        $a_text = str_replace(chr(13) . chr(10), 
"<br />", $a_text);
 
  252        $a_text = str_replace(chr(13), 
"<br />", $a_text);
 
  253        $a_text = str_replace(chr(10), 
"<br />", $a_text);
 
  260        $a_text = str_replace(
"<br />", 
"\n", $a_text);
 
  261        $a_text = str_replace(
"<br/>", 
"\n", $a_text);
 
  275        $start = strpos($a_html, 
"[[[[[Map;");
 
  276        if (is_int($start)) {
 
  277            $end = strpos($a_html, 
"]]]]]", $start);
 
  281            $param = substr($a_html, $start + 9, 
$end - $start - 9);
 
  283            $param = explode(
";", $param);
 
  284            if (is_numeric($param[0]) && is_numeric($param[1]) && is_numeric($param[2])) {
 
  285                include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
 
  287                $map_gui->setMapId(
"map_" . 
$i)
 
  288                        ->setLatitude($param[0])
 
  289                        ->setLongitude($param[1])
 
  291                        ->setWidth($param[3] . 
"px")
 
  292                        ->setHeight($param[4] . 
"px")
 
  293                        ->setEnableTypeControl(
true)
 
  294                        ->setEnableNavigationControl(
true)
 
  295                        ->setEnableCentralMarker(
true);
 
  296                $h2 = substr($a_html, 0, $start) .
 
  297                    $map_gui->getHtml() .
 
  298                    substr($a_html, 
$end + 5);
 
  302            $start = strpos($a_html, 
"[[[[[Map;", $start + 5);
 
  304            if (is_int($start)) {
 
  305                $end = strpos($a_html, 
"]]]]]", $start);
 
An exception for terminatinating execution or to throw for unit testing.
static getMapGUI()
Get an instance of the GUI class.
setZoom($a_zoom)
Set zoom of map.
static handleCaptionFormOutput($a_text)
getHorizontalAlign()
Get Horizontal Alignment.
getLongitude()
Get longitude of map.
setLongitude($a_long)
Set longitude of map.
setLatitude($a_lat)
Set latitude of map.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create map node in xml.
getZoom()
Get zoom of map.
setNode($a_node)
Set node.
modifyPageContentPostXsl($a_html, $a_mode)
Modify page content after xsl.
setCaption($a_caption)
Set Caption.
static handleCaptionInput($a_text)
getLatitude()
Get latitude of map.
init()
Init page content component.
setLayout($a_width, $a_height, $a_horizontal_align)
Set Layout.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
setType($a_type)
Set Type.