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

User interface class for google maps. More...

+ Inheritance diagram for ilGoogleMapGUI:
+ Collaboration diagram for ilGoogleMapGUI:

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 google maps.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

ilGoogleMapGUI::__construct ( )

Reimplemented from ilMapGUI.

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

{
// it's in getHTML too. why is it there twice?
/*$tpl->addJavaScript("//maps.google.com/maps/api/js?sensor=false", false);
$tpl->addJavaScript("Services/Maps/js/ServiceGoogleMaps.js");*/
}

Member Function Documentation

ilGoogleMapGUI::getHtml ( )

Get HTML.

Reimplemented from ilMapGUI.

Definition at line 49 of file class.ilGoogleMapGUI.php.

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

{
global $tpl;
$this->tpl = new ilTemplate("tpl.google_map.html",
true, true, "Services/Maps");
$tpl->addJavaScript("//maps.google.com/maps/api/js?sensor=false", false);
$tpl->addJavaScript("Services/Maps/js/ServiceGoogleMaps.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());
$type_control = $this->getEnableTypeControl()
? "true"
: "false";
$this->tpl->setVariable("TYPE_CONTROL", $type_control);
$nav_control = $this->getEnableNavigationControl()
? "true"
: "false";
$this->tpl->setVariable("NAV_CONTROL", $nav_control);
$update_listener = $this->getEnableUpdateListener()
? "true"
: "false";
$this->tpl->setVariable("UPDATE_LISTENER", $update_listener);
$large_map_control = $this->getEnableLargeMapControl()
? "true"
: "false";
$this->tpl->setVariable("LARGE_CONTROL", $large_map_control);
$central_marker = $this->getEnableCentralMarker()
? "true"
: "false";
$this->tpl->setVariable("CENTRAL_MARKER", $central_marker);
return $this->tpl->get();
}

+ Here is the call graph for this function:

ilGoogleMapGUI::getUserListHtml ( )

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

Reimplemented from ilMapGUI.

Definition at line 149 of file class.ilGoogleMapGUI.php.

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

{
global $tpl;
$list_tpl = new ilTemplate("tpl.google_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: