33require_once(
"Services/Maps/classes/class.ilMapGUI.php");
55 $this->tile_server = $a_tile;
66 $this->geolocation_server = $a_geolocation;
80 "tpl.openlayers_map.html",
87 $lng->loadLanguageModule(
"maps");
88 $tpl->addCss(
"node_modules/ol/ol.css");
89 $tpl->addCss(
"Services/Maps/css/service_openlayers.css");
90 $tpl->addJavaScript(
"Services/Maps/js/dist/ServiceOpenLayers.js");
94 foreach ($this->user_marker as $user_id) {
97 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
98 $user->getPref(
"public_location") ==
"y") {
99 $this->tpl->setCurrentBlock(
"user_marker");
100 $this->tpl->setVariable(
104 $this->tpl->setVariable(
"CNT", $cnt);
106 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
107 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
108 $info = htmlspecialchars($user->getFirstName() .
" " . $user->getLastName());
110 if ($user->getPref(
"public_institution") ==
"y") {
111 $info .= $delim . htmlspecialchars($user->getInstitution());
114 if ($user->getPref(
"public_department") ==
"y") {
115 $info .= $delim . htmlspecialchars($user->getDepartment());
118 if ($user->getPref(
"public_street") ==
"y") {
119 $info .= $delim . htmlspecialchars($user->getStreet());
121 if ($user->getPref(
"public_zip") ==
"y") {
122 $info .= $delim . htmlspecialchars($user->getZipcode());
125 if ($user->getPref(
"public_city") ==
"y") {
126 $info .= $delim . htmlspecialchars($user->getCity());
129 if ($user->getPref(
"public_country") ==
"y") {
130 $info .= $delim . htmlspecialchars($user->getCountry());
132 $this->tpl->setVariable(
136 $this->tpl->setVariable(
138 $user->getPersonalPicturePath(
"xsmall")
140 $this->tpl->parseCurrentBlock();
146 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
147 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
148 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
149 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
151 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
157 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
161 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
165 $this->tpl->setVariable(
"REPLACE_MARKER", $replace_marker);
168 $tile_servers = explode(
" ", $tile_servers);
169 array_walk($tile_servers,
function (&$string) {
170 $string =
'"' . $string .
'"';
172 $tile_servers =
'[' . implode(
', ', $tile_servers) .
']';
174 $this->tpl->setVariable(
"TILES", $tile_servers);
176 $this->tpl->setVariable(
"INVALID_ADDRESS_STRING",
$lng->txt(
"invalid_address"));
178 return $this->tpl->get();
187 "tpl.openlayers_map_user_list.html",
194 foreach ($this->user_marker as $user_id) {
197 $this->css_row = ($this->css_row !=
"tblrow1_mo")
200 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
201 && $user->getPref(
"public_location") ==
"y") {
202 $list_tpl->setCurrentBlock(
"item");
203 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
204 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
207 $list_tpl->setCurrentBlock(
"item_no_link");
209 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
210 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
211 $list_tpl->setVariable(
213 $user->getPersonalPicturePath(
"xxsmall")
215 $list_tpl->parseCurrentBlock();
216 $list_tpl->touchBlock(
"row");
220 return $list_tpl->get();
An exception for terminatinating execution or to throw for unit testing.
User interface class for maps.
getEnableCentralMarker()
Get Enable Central Marker.
getLongitude()
Get Longitude.
getEnableNavigationControl()
Get Use Navigation Control.
getLatitude()
Get Latitude.
getEnableUpdateListener()
Get Activate Update Listener.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
User interface class for OpenLayers maps.
getUserListHtml()
Get User List HTML (to be displayed besides the map)
setGeolocationServer($a_geolocation)
getTileServers()
Get HTML.
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc