48 $lng->loadLanguageModule(
"gmaps");
50 if ($gm_set->get(
"api_key") !=
"")
52 $tpl->addJavaScript(
"http://maps.google.com/maps?file=api&v=2&key=".
53 $gm_set->get(
"api_key"),
false);
54 $tpl->addJavaScript(
"Services/JavaScript/js/Basic.js");
55 $tpl->addJavaScript(
"Services/GoogleMaps/js/ServiceGoogleMaps.js");
66 $this->mapid = $a_mapid;
86 $this->width = $a_width;
106 $this->height = $a_height;
126 $this->latitude = $a_latitude;
136 return $this->latitude;
146 $this->longitude = $a_longitude;
156 return $this->longitude;
166 $this->zoom = $a_zoom;
186 $this->enabletypecontrol = $a_enabletypecontrol;
206 $this->enablenavigationcontrol = $a_enablenavigationcontrol;
226 $this->enableupdatelistener = $a_enableupdatelistener;
246 $this->largemapcontrol = $a_largemapcontrol;
256 return $this->largemapcontrol;
266 $this->centralmarker = $a_centralmarker;
276 return $this->centralmarker;
286 return $this->user_marker[] = $a_user_id;
296 $this->tpl =
new ilTemplate(
"tpl.google_map.html",
297 true,
true,
"Services/GoogleMaps");
300 if ($gm_set->get(
"api_key") !=
"")
302 $tpl->addJavaScript(
"http://maps.google.com/maps?file=api&v=2&key=".
303 $gm_set->get(
"api_key"));
304 $tpl->addJavaScript(
"Services/JavaScript/js/Basic.js");
305 $tpl->addJavaScript(
"Services/GoogleMaps/js/ServiceGoogleMaps.js");
309 foreach($this->user_marker as $user_id)
314 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
315 $user->getPref(
"public_location") ==
"y")
317 $this->tpl->setCurrentBlock(
"user_marker");
318 $this->tpl->setVariable(
"UMAP_ID",
320 $this->tpl->setVariable(
"CNT", $cnt);
322 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
323 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
324 $info = htmlspecialchars($user->getFirstName().
" ".$user->getLastName());
326 if ($user->getPref(
"public_institution") ==
"y")
328 $info.= $delim.htmlspecialchars($user->getInstitution());
331 if ($user->getPref(
"public_department") ==
"y")
333 $info.= $delim.htmlspecialchars($user->getDepartment());
336 if ($user->getPref(
"public_street") ==
"y")
338 $info.= $delim.htmlspecialchars($user->getStreet());
340 if ($user->getPref(
"public_zip") ==
"y")
342 $info.= $delim.htmlspecialchars($user->getZipcode());
345 if ($user->getPref(
"public_city") ==
"y")
347 $info.= $delim.htmlspecialchars($user->getCity());
350 if ($user->getPref(
"public_country") ==
"y")
352 $info.= $delim.htmlspecialchars($user->getCountry());
354 $this->tpl->setVariable(
"USER_INFO",
356 $this->tpl->setVariable(
"IMG_USER",
357 $user->getPersonalPicturePath(
"xsmall"));
358 $this->tpl->parseCurrentBlock();
364 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
371 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
372 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
373 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
375 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
379 $this->tpl->setVariable(
"TYPE_CONTROL", $type_control);
383 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
387 $this->tpl->setVariable(
"UPDATE_LISTENER", $update_listener);
391 $this->tpl->setVariable(
"LARGE_CONTROL", $large_map_control);
395 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
397 return $this->tpl->get();
412 $list_tpl =
new ilTemplate(
"tpl.google_map_user_list.html",
413 true,
true,
"Services/GoogleMaps");
416 foreach($this->user_marker as $user_id)
421 $this->css_row = ($this->css_row !=
"tblrow1_mo")
424 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
425 && $user->getPref(
"public_location") ==
"y")
427 $list_tpl->setCurrentBlock(
"item");
428 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
429 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
434 $list_tpl->setCurrentBlock(
"item_no_link");
436 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
437 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
438 $list_tpl->setVariable(
"IMG_USER",
439 $user->getPersonalPicturePath(
"xxsmall"));
440 $list_tpl->parseCurrentBlock();
441 $list_tpl->touchBlock(
"row");
445 return $list_tpl->get();