33require_once(
"Services/Maps/classes/class.ilMapGUI.php");
42 parent::__construct();
54 $this->tile_server = $a_tile;
63 $this->geolocation_server = $a_geolocation;
76 $this->tpl =
new ilTemplate(
"tpl.openlayers_map.html",
77 true,
true,
"Services/Maps");
80 $lng->loadLanguageModule(
"maps");
81 $tpl->addJavaScript(
"Services/Maps/js/OpenLayers.js");
82 $tpl->addJavaScript(
"Services/Maps/js/ServiceOpenLayers.js");
86 foreach($this->user_marker as $user_id)
91 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
92 $user->getPref(
"public_location") ==
"y")
94 $this->tpl->setCurrentBlock(
"user_marker");
95 $this->tpl->setVariable(
"UMAP_ID",
97 $this->tpl->setVariable(
"CNT", $cnt);
99 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
100 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
101 $info = htmlspecialchars($user->getFirstName().
" ".$user->getLastName());
103 if ($user->getPref(
"public_institution") ==
"y")
105 $info.= $delim.htmlspecialchars($user->getInstitution());
108 if ($user->getPref(
"public_department") ==
"y")
110 $info.= $delim.htmlspecialchars($user->getDepartment());
113 if ($user->getPref(
"public_street") ==
"y")
115 $info.= $delim.htmlspecialchars($user->getStreet());
117 if ($user->getPref(
"public_zip") ==
"y")
119 $info.= $delim.htmlspecialchars($user->getZipcode());
122 if ($user->getPref(
"public_city") ==
"y")
124 $info.= $delim.htmlspecialchars($user->getCity());
127 if ($user->getPref(
"public_country") ==
"y")
129 $info.= $delim.htmlspecialchars($user->getCountry());
131 $this->tpl->setVariable(
"USER_INFO",
133 $this->tpl->setVariable(
"IMG_USER",
134 $user->getPersonalPicturePath(
"xsmall"));
135 $this->tpl->parseCurrentBlock();
141 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
142 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
143 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
144 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
146 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
152 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
156 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
160 $this->tpl->setVariable(
"REPLACE_MARKER", $replace_marker);
163 $tile_servers = explode(
" ", $tile_servers);
164 array_walk($tile_servers,
function(&$string) { $string =
'"'.$string.
'"';});
165 $tile_servers =
'['.implode(
', ', $tile_servers).
']';
167 $this->tpl->setVariable(
"TILES", $tile_servers);
169 $this->tpl->setVariable(
"INVALID_ADDRESS_STRING",
$lng->txt(
"invalid_address"));
171 return $this->tpl->get();
179 $list_tpl =
new ilTemplate(
"tpl.openlayers_map_user_list.html",
180 true,
true,
"Services/Maps");
183 foreach($this->user_marker as $user_id)
188 $this->css_row = ($this->css_row !=
"tblrow1_mo")
191 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
192 && $user->getPref(
"public_location") ==
"y")
194 $list_tpl->setCurrentBlock(
"item");
195 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
196 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
201 $list_tpl->setCurrentBlock(
"item_no_link");
203 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
204 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
205 $list_tpl->setVariable(
"IMG_USER",
206 $user->getPersonalPicturePath(
"xxsmall"));
207 $list_tpl->parseCurrentBlock();
208 $list_tpl->touchBlock(
"row");
212 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