33 require_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(
"libs/bower/bower_components/openlayers/build/ol.css");
89 $tpl->addJavaScript(
"libs/bower/bower_components/openlayers/build/ol.js");
90 $tpl->addCss(
"Services/Maps/css/service_openlayers.css");
91 $tpl->addJavaScript(
"Services/Maps/js/ServiceOpenLayers.js");
95 foreach ($this->user_marker as $user_id) {
98 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
99 $user->getPref(
"public_location") ==
"y") {
100 $this->tpl->setCurrentBlock(
"user_marker");
101 $this->tpl->setVariable(
105 $this->tpl->setVariable(
"CNT", $cnt);
107 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
108 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
109 $info = htmlspecialchars($user->getFirstName() .
" " . $user->getLastName());
111 if ($user->getPref(
"public_institution") ==
"y") {
112 $info .= $delim . htmlspecialchars($user->getInstitution());
115 if ($user->getPref(
"public_department") ==
"y") {
116 $info .= $delim . htmlspecialchars($user->getDepartment());
119 if ($user->getPref(
"public_street") ==
"y") {
120 $info .= $delim . htmlspecialchars($user->getStreet());
122 if ($user->getPref(
"public_zip") ==
"y") {
123 $info .= $delim . htmlspecialchars($user->getZipcode());
126 if ($user->getPref(
"public_city") ==
"y") {
127 $info .= $delim . htmlspecialchars($user->getCity());
130 if ($user->getPref(
"public_country") ==
"y") {
131 $info .= $delim . htmlspecialchars($user->getCountry());
133 $this->tpl->setVariable(
137 $this->tpl->setVariable(
139 $user->getPersonalPicturePath(
"xsmall")
141 $this->tpl->parseCurrentBlock();
147 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
148 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
149 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
150 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
152 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
158 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
162 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
166 $this->tpl->setVariable(
"REPLACE_MARKER", $replace_marker);
169 $tile_servers = explode(
" ", $tile_servers);
170 array_walk($tile_servers,
function (&$string) {
171 $string =
'"' . $string .
'"';
173 $tile_servers =
'[' . implode(
', ', $tile_servers) .
']';
175 $this->tpl->setVariable(
"TILES", $tile_servers);
177 $this->tpl->setVariable(
"INVALID_ADDRESS_STRING",
$lng->txt(
"invalid_address"));
179 return $this->tpl->get();
188 "tpl.openlayers_map_user_list.html",
195 foreach ($this->user_marker as $user_id) {
198 $this->css_row = ($this->css_row !=
"tblrow1_mo")
201 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
202 && $user->getPref(
"public_location") ==
"y") {
203 $list_tpl->setCurrentBlock(
"item");
204 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
205 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
208 $list_tpl->setCurrentBlock(
"item_no_link");
210 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
211 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
212 $list_tpl->setVariable(
214 $user->getPersonalPicturePath(
"xxsmall")
216 $list_tpl->parseCurrentBlock();
217 $list_tpl->touchBlock(
"row");
221 return $list_tpl->get();
getTileServers()
Get HTML.
getLatitude()
Get Latitude.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
getUserListHtml()
Get User List HTML (to be displayed besides the map)
getEnableCentralMarker()
Get Enable Central Marker.
getEnableUpdateListener()
Get Activate Update Listener.
getEnableNavigationControl()
Get Use Navigation Control.
setGeolocationServer($a_geolocation)
__construct(Container $dic, ilPlugin $plugin)
getLongitude()
Get Longitude.
User interface class for maps.
User interface class for OpenLayers maps.