47 $lng->loadLanguageModule(
"gmaps");
49 $tpl->addJavaScript(
"//maps.google.com/maps/api/js?sensor=false",
false);
50 $tpl->addJavaScript(
"Services/GoogleMaps/js/ServiceGoogleMaps.js");
61 $this->mapid = $a_mapid;
81 $this->width = $a_width;
101 $this->height = $a_height;
121 $this->latitude = $a_latitude;
131 return $this->latitude;
141 $this->longitude = $a_longitude;
151 return $this->longitude;
161 $this->zoom = $a_zoom;
181 $this->enabletypecontrol = $a_enabletypecontrol;
201 $this->enablenavigationcontrol = $a_enablenavigationcontrol;
221 $this->enableupdatelistener = $a_enableupdatelistener;
241 $this->largemapcontrol = $a_largemapcontrol;
251 return $this->largemapcontrol;
261 $this->centralmarker = $a_centralmarker;
271 return $this->centralmarker;
281 return $this->user_marker[] = $a_user_id;
291 $this->tpl =
new ilTemplate(
"tpl.google_map.html",
292 true,
true,
"Services/GoogleMaps");
294 $tpl->addJavaScript(
"//maps.google.com/maps/api/js?sensor=false",
false);
295 $tpl->addJavaScript(
"Services/GoogleMaps/js/ServiceGoogleMaps.js");
299 foreach($this->user_marker as $user_id)
304 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
305 $user->getPref(
"public_location") ==
"y")
307 $this->tpl->setCurrentBlock(
"user_marker");
308 $this->tpl->setVariable(
"UMAP_ID",
310 $this->tpl->setVariable(
"CNT", $cnt);
312 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
313 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
314 $info = htmlspecialchars($user->getFirstName().
" ".$user->getLastName());
316 if ($user->getPref(
"public_institution") ==
"y")
318 $info.= $delim.htmlspecialchars($user->getInstitution());
321 if ($user->getPref(
"public_department") ==
"y")
323 $info.= $delim.htmlspecialchars($user->getDepartment());
326 if ($user->getPref(
"public_street") ==
"y")
328 $info.= $delim.htmlspecialchars($user->getStreet());
330 if ($user->getPref(
"public_zip") ==
"y")
332 $info.= $delim.htmlspecialchars($user->getZipcode());
335 if ($user->getPref(
"public_city") ==
"y")
337 $info.= $delim.htmlspecialchars($user->getCity());
340 if ($user->getPref(
"public_country") ==
"y")
342 $info.= $delim.htmlspecialchars($user->getCountry());
344 $this->tpl->setVariable(
"USER_INFO",
346 $this->tpl->setVariable(
"IMG_USER",
347 $user->getPersonalPicturePath(
"xsmall"));
348 $this->tpl->parseCurrentBlock();
354 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
355 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
356 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
357 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
359 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
363 $this->tpl->setVariable(
"TYPE_CONTROL", $type_control);
367 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
371 $this->tpl->setVariable(
"UPDATE_LISTENER", $update_listener);
375 $this->tpl->setVariable(
"LARGE_CONTROL", $large_map_control);
379 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
381 return $this->tpl->get();
391 $list_tpl =
new ilTemplate(
"tpl.google_map_user_list.html",
392 true,
true,
"Services/GoogleMaps");
395 foreach($this->user_marker as $user_id)
400 $this->css_row = ($this->css_row !=
"tblrow1_mo")
403 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
404 && $user->getPref(
"public_location") ==
"y")
406 $list_tpl->setCurrentBlock(
"item");
407 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
408 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
413 $list_tpl->setCurrentBlock(
"item_no_link");
415 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
416 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
417 $list_tpl->setVariable(
"IMG_USER",
418 $user->getPersonalPicturePath(
"xxsmall"));
419 $list_tpl->parseCurrentBlock();
420 $list_tpl->touchBlock(
"row");
424 return $list_tpl->get();