33 require_once(
"Services/Maps/classes/class.ilMapGUI.php");
39 parent::__construct();
53 $this->tpl =
new ilTemplate(
"tpl.google_map.html",
54 true,
true,
"Services/Maps");
56 require_once(
"Services/Maps/classes/class.ilMapUtil.php");
58 $tpl->addJavaScript(
"Services/Maps/js/ServiceGoogleMaps.js");
62 foreach($this->user_marker as $user_id)
67 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
68 $user->getPref(
"public_location") ==
"y")
70 $this->tpl->setCurrentBlock(
"user_marker");
71 $this->tpl->setVariable(
"UMAP_ID",
73 $this->tpl->setVariable(
"CNT", $cnt);
75 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
76 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
77 $info = htmlspecialchars($user->getFirstName().
" ".$user->getLastName());
79 if ($user->getPref(
"public_institution") ==
"y")
81 $info.= $delim.htmlspecialchars($user->getInstitution());
84 if ($user->getPref(
"public_department") ==
"y")
86 $info.= $delim.htmlspecialchars($user->getDepartment());
89 if ($user->getPref(
"public_street") ==
"y")
91 $info.= $delim.htmlspecialchars($user->getStreet());
93 if ($user->getPref(
"public_zip") ==
"y")
95 $info.= $delim.htmlspecialchars($user->getZipcode());
98 if ($user->getPref(
"public_city") ==
"y")
100 $info.= $delim.htmlspecialchars($user->getCity());
103 if ($user->getPref(
"public_country") ==
"y")
105 $info.= $delim.htmlspecialchars($user->getCountry());
107 $this->tpl->setVariable(
"USER_INFO",
109 $this->tpl->setVariable(
"IMG_USER",
110 $user->getPersonalPicturePath(
"xsmall"));
111 $this->tpl->parseCurrentBlock();
117 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
118 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
119 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
120 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
122 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
126 $this->tpl->setVariable(
"TYPE_CONTROL", $type_control);
130 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
134 $this->tpl->setVariable(
"UPDATE_LISTENER", $update_listener);
138 $this->tpl->setVariable(
"LARGE_CONTROL", $large_map_control);
142 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
144 return $this->tpl->get();
154 $list_tpl =
new ilTemplate(
"tpl.google_map_user_list.html",
155 true,
true,
"Services/Maps");
158 foreach($this->user_marker as $user_id)
163 $this->css_row = ($this->css_row !=
"tblrow1_mo")
166 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
167 && $user->getPref(
"public_location") ==
"y")
169 $list_tpl->setCurrentBlock(
"item");
170 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
171 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
176 $list_tpl->setCurrentBlock(
"item_no_link");
178 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
179 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
180 $list_tpl->setVariable(
"IMG_USER",
181 $user->getPersonalPicturePath(
"xxsmall"));
182 $list_tpl->parseCurrentBlock();
183 $list_tpl->touchBlock(
"row");
187 return $list_tpl->get();
getLatitude()
Get Latitude.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
getEnableCentralMarker()
Get Enable Central Marker.
getEnableUpdateListener()
Get Activate Update Listener.
getEnableLargeMapControl()
Get Large Map Control.
getEnableNavigationControl()
Get Use Navigation Control.
special template class to simplify handling of ITX/PEAR
User interface class for google maps.
getUserListHtml()
Get User List HTML (to be displayed besides the map)
getEnableTypeControl()
Get Use Map Type Control.
getLongitude()
Get Longitude.
User interface class for maps.