33 require_once(
"Services/Maps/classes/class.ilMapGUI.php");
42 parent::__construct();
54 $this->tile_server = $a_tile;
63 $this->geolocation_server = $a_geolocation;
73 $this->tpl =
new ilTemplate(
"tpl.openlayers_map.html",
74 true,
true,
"Services/Maps");
77 $lng->loadLanguageModule(
"maps");
78 $tpl->addJavaScript(
"Services/Maps/js/OpenLayers.js");
79 $tpl->addJavaScript(
"Services/Maps/js/ServiceOpenLayers.js");
83 foreach($this->user_marker as $user_id)
88 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
89 $user->getPref(
"public_location") ==
"y")
91 $this->tpl->setCurrentBlock(
"user_marker");
92 $this->tpl->setVariable(
"UMAP_ID",
94 $this->tpl->setVariable(
"CNT", $cnt);
96 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
97 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
98 $info = htmlspecialchars($user->getFirstName().
" ".$user->getLastName());
100 if ($user->getPref(
"public_institution") ==
"y")
102 $info.= $delim.htmlspecialchars($user->getInstitution());
105 if ($user->getPref(
"public_department") ==
"y")
107 $info.= $delim.htmlspecialchars($user->getDepartment());
110 if ($user->getPref(
"public_street") ==
"y")
112 $info.= $delim.htmlspecialchars($user->getStreet());
114 if ($user->getPref(
"public_zip") ==
"y")
116 $info.= $delim.htmlspecialchars($user->getZipcode());
119 if ($user->getPref(
"public_city") ==
"y")
121 $info.= $delim.htmlspecialchars($user->getCity());
124 if ($user->getPref(
"public_country") ==
"y")
126 $info.= $delim.htmlspecialchars($user->getCountry());
128 $this->tpl->setVariable(
"USER_INFO",
130 $this->tpl->setVariable(
"IMG_USER",
131 $user->getPersonalPicturePath(
"xsmall"));
132 $this->tpl->parseCurrentBlock();
138 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
139 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
140 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
141 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
143 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
149 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
153 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
157 $this->tpl->setVariable(
"REPLACE_MARKER", $replace_marker);
160 $tile_servers = explode(
" ", $tile_servers);
161 array_walk($tile_servers,
function(&$string) { $string =
'"'.$string.
'"';});
162 $tile_servers =
'['.implode(
', ', $tile_servers).
']';
164 $this->tpl->setVariable(
"TILES", $tile_servers);
166 $this->tpl->setVariable(
"INVALID_ADDRESS_STRING", $lng->txt(
"invalid_address"));
168 return $this->tpl->get();
176 $list_tpl =
new ilTemplate(
"tpl.openlayers_map_user_list.html",
177 true,
true,
"Services/Maps");
180 foreach($this->user_marker as $user_id)
185 $this->css_row = ($this->css_row !=
"tblrow1_mo")
188 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
189 && $user->getPref(
"public_location") ==
"y")
191 $list_tpl->setCurrentBlock(
"item");
192 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
193 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
198 $list_tpl->setCurrentBlock(
"item_no_link");
200 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
201 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
202 $list_tpl->setVariable(
"IMG_USER",
203 $user->getPersonalPicturePath(
"xxsmall"));
204 $list_tpl->parseCurrentBlock();
205 $list_tpl->touchBlock(
"row");
209 return $list_tpl->get();
getTileServers()
Get HTML.
getLatitude()
Get Latitude.
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.
special template class to simplify handling of ITX/PEAR
setGeolocationServer($a_geolocation)
getLongitude()
Get Longitude.
User interface class for maps.
User interface class for OpenLayers maps.