ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 7 of file class.ilMapUtil.php.

Member Function Documentation

◆ getApiKey()

static ilMapUtil::getApiKey ( )
static

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

References ILIAS\Repository\settings().

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

81  : ?string
82  {
83  return self::settings()->get("api_key");
84  }
+ 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 152 of file class.ilMapUtil.php.

References $DIC, and $lng.

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

152  : array
153  {
154  global $DIC;
155  $lng = $DIC['lng'];
156  $lng->loadLanguageModule("maps");
157 
158  return [
159  "openlayers" => $lng->txt("maps_open_layers_maps"),
160  "googlemaps" => $lng->txt("maps_google_maps")
161  ];
162  }
$lng
global $DIC
Definition: feed.php:28
+ 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 121 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

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

121  : array
122  {
123  return [
124  "longitude" => self::settings()->get("std_longitude") ?? "",
125  "latitude" => self::settings()->get("std_latitude") ?? "",
126  "zoom" => self::settings()->get("std_zoom") ?? 0
127  ];
128  }
+ 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 133 of file class.ilMapUtil.php.

References $type.

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

133  : ilMapGui
134  {
135  $type = self::getType();
136  switch ($type) {
137  case "openlayers":
138  $map = new ilOpenLayersMapGUI();
139  $map->setTileServers(self::getStdTileServers());
140  $map->setGeolocationServer(self::getStdGeolocationServer());
141  return $map;
142  default:
143  return new ilGoogleMapGUI();
144  }
145  }
$type
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 111 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

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

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

◆ getStdLatitude()

static ilMapUtil::getStdLatitude ( )
static

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

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

51  : ?string
52  {
53  return self::settings()->get("std_latitude");
54  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdLongitude()

static ilMapUtil::getStdLongitude ( )
static

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

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

61  : ?string
62  {
63  return self::settings()->get("std_longitude");
64  }
+ 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 96 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

96  : string
97  {
98  $std_tile = self::settings()->get("std_tile");
99  return $std_tile ?: self::DEFAULT_TILE;
100  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdZoom()

static ilMapUtil::getStdZoom ( )
static

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

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

71  : ?string
72  {
73  return self::settings()->get("std_zoom");
74  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

static ilMapUtil::getType ( )
static

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

References ILIAS\Repository\settings().

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

41  : ?string
42  {
43  return self::settings()->get("type");
44  }
+ 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 31 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

31  : void
32  {
33  self::settings()->set("enable", $activated ? "1" : "0");
34  }
+ 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 76 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

76  : void
77  {
78  self::settings()->set("api_key", $api_key);
79  }
+ 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 103 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

103  : void
104  {
105  self::settings()->set("std_geolocation", $geolocation);
106  }
+ 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 46 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

46  : void
47  {
48  self::settings()->set("std_latitude", $lat);
49  }
+ 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 56 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

56  : void
57  {
58  self::settings()->set("std_longitude", $lon);
59  }
+ 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 86 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

86  : void
87  {
88  self::settings()->set("std_tile", $tile);
89  }
+ 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 66 of file class.ilMapUtil.php.

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

66  : void
67  {
68  self::settings()->set("std_zoom", $zoom);
69  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings()

static ilMapUtil::settings ( )
static

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

14  : ilSetting
15  {
16  if (self::$_settings === null) {
17  self::$_settings = new ilSetting("maps");
18  }
19  return self::$_settings;
20  }

◆ setType()

static ilMapUtil::setType ( string  $type)
static

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

References ILIAS\Repository\settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

36  : void
37  {
38  self::settings()->set("type", $type);
39  }
$type
+ 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 12 of file class.ilMapUtil.php.

◆ DEFAULT_GEOLOCATION

const ilMapUtil::DEFAULT_GEOLOCATION = null

Definition at line 10 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 9 of file class.ilMapUtil.php.

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().


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