47 $lng->loadLanguageModule(
"gmaps");
49 $tpl->addJavaScript(
"//maps.google.com/maps/api/js?sensor=false",
false);
50 $tpl->addJavaScript(
"Services/JavaScript/js/Basic.js");
51 $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/JavaScript/js/Basic.js");
296 $tpl->addJavaScript(
"Services/GoogleMaps/js/ServiceGoogleMaps.js");
300 foreach($this->user_marker as $user_id)
305 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
306 $user->getPref(
"public_location") ==
"y")
308 $this->tpl->setCurrentBlock(
"user_marker");
309 $this->tpl->setVariable(
"UMAP_ID",
311 $this->tpl->setVariable(
"CNT", $cnt);
313 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
314 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
315 $info = htmlspecialchars($user->getFirstName().
" ".$user->getLastName());
317 if ($user->getPref(
"public_institution") ==
"y")
319 $info.= $delim.htmlspecialchars($user->getInstitution());
322 if ($user->getPref(
"public_department") ==
"y")
324 $info.= $delim.htmlspecialchars($user->getDepartment());
327 if ($user->getPref(
"public_street") ==
"y")
329 $info.= $delim.htmlspecialchars($user->getStreet());
331 if ($user->getPref(
"public_zip") ==
"y")
333 $info.= $delim.htmlspecialchars($user->getZipcode());
336 if ($user->getPref(
"public_city") ==
"y")
338 $info.= $delim.htmlspecialchars($user->getCity());
341 if ($user->getPref(
"public_country") ==
"y")
343 $info.= $delim.htmlspecialchars($user->getCountry());
345 $this->tpl->setVariable(
"USER_INFO",
347 $this->tpl->setVariable(
"IMG_USER",
348 $user->getPersonalPicturePath(
"xsmall"));
349 $this->tpl->parseCurrentBlock();
355 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
356 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
357 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
358 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
360 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
364 $this->tpl->setVariable(
"TYPE_CONTROL", $type_control);
368 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
372 $this->tpl->setVariable(
"UPDATE_LISTENER", $update_listener);
376 $this->tpl->setVariable(
"LARGE_CONTROL", $large_map_control);
380 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
382 return $this->tpl->get();
390 $list_tpl =
new ilTemplate(
"tpl.google_map_user_list.html",
391 true,
true,
"Services/GoogleMaps");
394 foreach($this->user_marker as $user_id)
399 $this->css_row = ($this->css_row !=
"tblrow1_mo")
402 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
403 && $user->getPref(
"public_location") ==
"y")
405 $list_tpl->setCurrentBlock(
"item");
406 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
407 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
412 $list_tpl->setCurrentBlock(
"item_no_link");
414 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
415 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
416 $list_tpl->setVariable(
"IMG_USER",
417 $user->getPersonalPicturePath(
"xxsmall"));
418 $list_tpl->parseCurrentBlock();
419 $list_tpl->touchBlock(
"row");
423 return $list_tpl->get();