ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilOpenLayersMapGUI Class Reference

User interface class for OpenLayers maps. More...

+ Inheritance diagram for ilOpenLayersMapGUI:
+ Collaboration diagram for ilOpenLayersMapGUI:

Public Member Functions

 __construct ()
 getHtml ()
 Get HTML.
 getUserListHtml ()
 Get User List HTML (to be displayed besides the map)
- Public Member Functions inherited from ilMapGUI
 setMapId ($a_mapid)
 Set Map ID.
 getMapId ()
 Get Map ID.
 setWidth ($a_width)
 Set Width.
 getWidth ()
 Get Width.
 setHeight ($a_height)
 Set Height.
 getHeight ()
 Get Height.
 setLatitude ($a_latitude)
 Set Latitude.
 getLatitude ()
 Get Latitude.
 setLongitude ($a_longitude)
 Set Longitude.
 getLongitude ()
 Get Longitude.
 setZoom ($a_zoom)
 Set Zoom.
 getZoom ()
 Get Zoom.
 setEnableTypeControl ($a_enabletypecontrol)
 Set Use Map Type Control.
 getEnableTypeControl ()
 Get Use Map Type Control.
 setEnableNavigationControl ($a_enablenavigationcontrol)
 Set Use Navigation Control.
 getEnableNavigationControl ()
 Get Use Navigation Control.
 setEnableUpdateListener ($a_enableupdatelistener)
 Set Activate Update Listener.
 getEnableUpdateListener ()
 Get Activate Update Listener.
 setEnableLargeMapControl ($a_largemapcontrol)
 Set Large Map Control.
 getEnableLargeMapControl ()
 Get Large Map Control.
 setEnableCentralMarker ($a_centralmarker)
 Enable Central Marker.
 getEnableCentralMarker ()
 Get Enable Central Marker.
 addUserMarker ($a_user_id)
 Add user marker.

Additional Inherited Members

- Protected Attributes inherited from ilMapGUI
 $mapid
 $width = "500px"
 $height = "300px"
 $latitude
 $longitude
 $zoom
 $enabletypecontrol = false
 $enableupdatelistener = false
 $enablenavigationcontrol = false
 $enablelargemapcontrol = false
 $user_marker = array()

Detailed Description

User interface class for OpenLayers maps.

Author
Richard Klees richa.nosp@m.rd.k.nosp@m.lees@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de
Version
$Id$

Definition at line 35 of file class.ilOpenLayersMapGUI.php.

Constructor & Destructor Documentation

ilOpenLayersMapGUI::__construct ( )

Reimplemented from ilMapGUI.

Definition at line 37 of file class.ilOpenLayersMapGUI.php.

Member Function Documentation

ilOpenLayersMapGUI::getHtml ( )

Get HTML.

Reimplemented from ilMapGUI.

Definition at line 45 of file class.ilOpenLayersMapGUI.php.

References $https, $lng, $tpl, ilObject\_exists(), ilMapGUI\getEnableCentralMarker(), ilMapGUI\getEnableNavigationControl(), ilMapGUI\getEnableUpdateListener(), ilMapGUI\getHeight(), ilMapGUI\getLatitude(), ilMapGUI\getLongitude(), ilMapGUI\getMapId(), ilMapGUI\getWidth(), and ilMapGUI\getZoom().

{
global $tpl, $lng, $https;
$this->tpl = new ilTemplate("tpl.openlayers_map.html",
true, true, "Services/Maps");
$lng->loadLanguageModule("maps");
$tpl->addJavaScript("Services/Maps/js/OpenLayers.js");
$tpl->addJavaScript("Services/Maps/js/ServiceOpenLayers.js");
// add user markers
$cnt = 0;
foreach($this->user_marker as $user_id)
{
if (ilObject::_exists($user_id))
{
$user = new ilObjUser($user_id);
if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
$user->getPref("public_location") == "y")
{
$this->tpl->setCurrentBlock("user_marker");
$this->tpl->setVariable("UMAP_ID",
$this->getMapId());
$this->tpl->setVariable("CNT", $cnt);
$this->tpl->setVariable("ULAT", htmlspecialchars($user->getLatitude()));
$this->tpl->setVariable("ULONG", htmlspecialchars($user->getLongitude()));
$info = htmlspecialchars($user->getFirstName()." ".$user->getLastName());
$delim = "<br \/>";
if ($user->getPref("public_institution") == "y")
{
$info.= $delim.htmlspecialchars($user->getInstitution());
$delim = ", ";
}
if ($user->getPref("public_department") == "y")
{
$info.= $delim.htmlspecialchars($user->getDepartment());
}
$delim = "<br \/>";
if ($user->getPref("public_street") == "y")
{
$info.= $delim.htmlspecialchars($user->getStreet());
}
if ($user->getPref("public_zip") == "y")
{
$info.= $delim.htmlspecialchars($user->getZipcode());
$delim = " ";
}
if ($user->getPref("public_city") == "y")
{
$info.= $delim.htmlspecialchars($user->getCity());
}
$delim = "<br \/>";
if ($user->getPref("public_country") == "y")
{
$info.= $delim.htmlspecialchars($user->getCountry());
}
$this->tpl->setVariable("USER_INFO",
$info);
$this->tpl->setVariable("IMG_USER",
$user->getPersonalPicturePath("xsmall"));
$this->tpl->parseCurrentBlock();
$cnt++;
}
}
}
$this->tpl->setVariable("MAP_ID", $this->getMapId());
$this->tpl->setVariable("WIDTH", $this->getWidth());
$this->tpl->setVariable("HEIGHT", $this->getHeight());
$this->tpl->setVariable("LAT", $this->getLatitude());
$this->tpl->setVariable("LONG", $this->getLongitude());
$this->tpl->setVariable("ZOOM", (int) $this->getZoom());
$nav_control = $this->getEnableNavigationControl()
? "true"
: "false";
$this->tpl->setVariable("NAV_CONTROL", $nav_control);
$central_marker = $this->getEnableCentralMarker()
? "true"
: "false";
$this->tpl->setVariable("CENTRAL_MARKER", $central_marker);
$replace_marker = $this->getEnableUpdateListener()
? "true"
: "false";
$this->tpl->setVariable("REPLACE_MARKER", $replace_marker);
$this->tpl->setVariable("INVALID_ADDRESS_STRING", $lng->txt("invalid_address"));
return $this->tpl->get();
}

+ Here is the call graph for this function:

ilOpenLayersMapGUI::getUserListHtml ( )

Get User List HTML (to be displayed besides the map)

Reimplemented from ilMapGUI.

Definition at line 140 of file class.ilOpenLayersMapGUI.php.

References ilObject\_exists(), and ilMapGUI\getMapId().

{
$list_tpl = new ilTemplate("tpl.openlayers_map_user_list.html",
true, true, "Services/Maps");
$cnt = 0;
foreach($this->user_marker as $user_id)
{
if (ilObject::_exists($user_id))
{
$user = new ilObjUser($user_id);
$this->css_row = ($this->css_row != "tblrow1_mo")
? "tblrow1_mo"
: "tblrow2_mo";
if ($user->getLatitude() != 0 && $user->getLongitude() != 0
&& $user->getPref("public_location") == "y")
{
$list_tpl->setCurrentBlock("item");
$list_tpl->setVariable("MARKER_CNT", $cnt);
$list_tpl->setVariable("MAP_ID", $this->getMapId());
$cnt++;
}
else
{
$list_tpl->setCurrentBlock("item_no_link");
}
$list_tpl->setVariable("CSS_ROW", $this->css_row);
$list_tpl->setVariable("TXT_USER", $user->getLogin());
$list_tpl->setVariable("IMG_USER",
$user->getPersonalPicturePath("xxsmall"));
$list_tpl->parseCurrentBlock();
$list_tpl->touchBlock("row");
}
}
return $list_tpl->get();
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: