ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMapUtil Class Reference
+ Collaboration diagram for ilMapUtil:

Static Public Member Functions

static settings ()
 
static isActivated ()
 Checks whether Map feature is activated. More...
 
static setActivated (bool $activated)
 
static setType (string $type)
 
static getType ()
 
static setStdLatitude (string $lat)
 
static getStdLatitude ()
 
static setStdLongitude (string $lon)
 
static getStdLongitude ()
 
static setStdZoom (string $zoom)
 
static getStdZoom ()
 
static setApiKey (string $api_key)
 
static getApiKey ()
 
static setStdTileServers (string $tile)
 
static getStdTileServers ()
 Returns the tile server to be used in the installation. More...
 
static setStdGeolocationServer ($geolocation)
 
static getStdGeolocationServer ()
 Returns the reverse geolocation server to be used in the installation. More...
 
static getDefaultSettings ()
 Get default longitude, latitude and zoom. More...
 
static getMapGUI ()
 Get an instance of the GUI class. More...
 
static getAvailableMapTypes ()
 Get a dict { $id => $name } for available maps services. More...
 

Data Fields

const DEFAULT_TILE = "a.tile.openstreetmap.org b.tile.openstreetmap.org c.tile.openstreetmap.org"
 
const DEFAULT_GEOLOCATION = null
 

Static Public Attributes

static ilSetting $_settings = null
 

Detailed Description

Definition at line 21 of file class.ilMapUtil.php.

Member Function Documentation

◆ getApiKey()

static ilMapUtil::getApiKey ( )
static

Definition at line 95 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilGoogleMapGUI\getHtml(), and ilObjExternalToolsSettingsGUI\getMapsForm().

95  : ?string
96  {
97  return self::settings()->get("api_key");
98  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvailableMapTypes()

static ilMapUtil::getAvailableMapTypes ( )
static

Get a dict { $id => $name } for available maps services.

Returns
array<string, string>

Definition at line 166 of file class.ilMapUtil.php.

References $DIC, and $lng.

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

166  : array
167  {
168  global $DIC;
169  $lng = $DIC['lng'];
170  $lng->loadLanguageModule("maps");
171 
172  return [
173  "openlayers" => $lng->txt("maps_open_layers_maps"),
174  "googlemaps" => $lng->txt("maps_google_maps")
175  ];
176  }
global $DIC
Definition: shib_login.php:22
global $lng
Definition: privfeed.php:31
+ Here is the caller graph for this function:

◆ getDefaultSettings()

static ilMapUtil::getDefaultSettings ( )
static

Get default longitude, latitude and zoom.

Returns
array<string, string>

Definition at line 135 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilPersonalProfileGUI\addLocationToForm(), ilADTLocationFormBridge\addToForm(), ilADTLocationSearchBridgeSingle\addToForm(), ilObjGroupGUI\editMapSettingsObject(), and ilObjCourseGUI\editMapSettingsObject().

135  : array
136  {
137  return [
138  "longitude" => self::settings()->get("std_longitude") ?? "",
139  "latitude" => self::settings()->get("std_latitude") ?? "",
140  "zoom" => self::settings()->get("std_zoom") ?? 0
141  ];
142  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMapGUI()

static ilMapUtil::getMapGUI ( )
static

Get an instance of the GUI class.

Definition at line 147 of file class.ilMapUtil.php.

Referenced by ilPublicUserProfileGUI\getEmbeddable(), ilADTLocationPresentationBridge\getHTML(), ilLocationInputGUI\insert(), ilMembershipGUI\membersMap(), and ilPCMap\modifyPageContentPostXsl().

147  : ilMapGui
148  {
149  $type = self::getType();
150  switch ($type) {
151  case "openlayers":
152  $map = new ilOpenLayersMapGUI();
153  $map->setTileServers(self::getStdTileServers());
154  $map->setGeolocationServer(self::getStdGeolocationServer());
155  return $map;
156  default:
157  return new ilGoogleMapGUI();
158  }
159  }
User interface class for Google Maps.
User interface class for OpenLayers maps.
+ Here is the caller graph for this function:

◆ getStdGeolocationServer()

static ilMapUtil::getStdGeolocationServer ( )
static

Returns the reverse geolocation server to be used in the installation.

Definition at line 125 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilLocationInputGUI\geolocationAvailiable(), and ilObjExternalToolsSettingsGUI\getMapsForm().

125  : ?string
126  {
127  $std_geoloc = self::settings()->get("std_geolocation");
128  return $std_geoloc ?: self::DEFAULT_GEOLOCATION;
129  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdLatitude()

static ilMapUtil::getStdLatitude ( )
static

Definition at line 65 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

65  : ?string
66  {
67  return self::settings()->get("std_latitude");
68  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdLongitude()

static ilMapUtil::getStdLongitude ( )
static

Definition at line 75 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

75  : ?string
76  {
77  return self::settings()->get("std_longitude");
78  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdTileServers()

static ilMapUtil::getStdTileServers ( )
static

Returns the tile server to be used in the installation.

Returns
string tile server url

Definition at line 110 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

110  : string
111  {
112  $std_tile = self::settings()->get("std_tile");
113  return $std_tile ?: self::DEFAULT_TILE;
114  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdZoom()

static ilMapUtil::getStdZoom ( )
static

Definition at line 85 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

85  : ?string
86  {
87  return self::settings()->get("std_zoom");
88  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

static ilMapUtil::getType ( )
static

Definition at line 55 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilLocationInputGUI\geolocationAvailiable(), ilObjExternalToolsSettingsGUI\getMapsForm(), and ilObjExternalToolsSettingsGUI\saveMapsObject().

55  : ?string
56  {
57  return self::settings()->get("type");
58  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActivated()

static ilMapUtil::isActivated ( )
static

◆ setActivated()

static ilMapUtil::setActivated ( bool  $activated)
static

Definition at line 45 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

45  : void
46  {
47  self::settings()->set("enable", $activated ? "1" : "0");
48  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setApiKey()

static ilMapUtil::setApiKey ( string  $api_key)
static

Definition at line 90 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

90  : void
91  {
92  self::settings()->set("api_key", $api_key);
93  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdGeolocationServer()

static ilMapUtil::setStdGeolocationServer (   $geolocation)
static

Definition at line 117 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

117  : void
118  {
119  self::settings()->set("std_geolocation", $geolocation);
120  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdLatitude()

static ilMapUtil::setStdLatitude ( string  $lat)
static

Definition at line 60 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

60  : void
61  {
62  self::settings()->set("std_latitude", $lat);
63  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdLongitude()

static ilMapUtil::setStdLongitude ( string  $lon)
static

Definition at line 70 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

70  : void
71  {
72  self::settings()->set("std_longitude", $lon);
73  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdTileServers()

static ilMapUtil::setStdTileServers ( string  $tile)
static

Definition at line 100 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

100  : void
101  {
102  self::settings()->set("std_tile", $tile);
103  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdZoom()

static ilMapUtil::setStdZoom ( string  $zoom)
static

Definition at line 80 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

80  : void
81  {
82  self::settings()->set("std_zoom", $zoom);
83  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings()

static ilMapUtil::settings ( )
static

Definition at line 28 of file class.ilMapUtil.php.

References null.

28  : ilSetting
29  {
30  if (self::$_settings === null) {
31  self::$_settings = new ilSetting("maps");
32  }
33  return self::$_settings;
34  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ setType()

static ilMapUtil::setType ( string  $type)
static

Definition at line 50 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

50  : void
51  {
52  self::settings()->set("type", $type);
53  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $_settings

ilSetting ilMapUtil::$_settings = null
static

Definition at line 26 of file class.ilMapUtil.php.

◆ DEFAULT_GEOLOCATION

const ilMapUtil::DEFAULT_GEOLOCATION = null

Definition at line 24 of file class.ilMapUtil.php.

◆ DEFAULT_TILE

const ilMapUtil::DEFAULT_TILE = "a.tile.openstreetmap.org b.tile.openstreetmap.org c.tile.openstreetmap.org"

Definition at line 23 of file class.ilMapUtil.php.

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().


The documentation for this class was generated from the following file: