ILIAS  release_8 Revision v8.24
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.

81 : ?string
82 {
83 return self::settings()->get("api_key");
84 }
static settings()

References settings().

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

+ 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.

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 }
global $DIC
Definition: feed.php:28
$lng

References $DIC, and $lng.

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

+ 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.

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 }

References settings().

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

+ 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.

133 : ilMapGui
134 {
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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getType()
User interface class for OpenLayers maps.
$type

References $type, and getType().

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

+ Here is the call graph for this function:
+ 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.

111 : ?string
112 {
113 $std_geoloc = self::settings()->get("std_geolocation");
114 return $std_geoloc ?: self::DEFAULT_GEOLOCATION;
115 }
const DEFAULT_GEOLOCATION

References DEFAULT_GEOLOCATION, and settings().

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

+ 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.

51 : ?string
52 {
53 return self::settings()->get("std_latitude");
54 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

+ 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.

61 : ?string
62 {
63 return self::settings()->get("std_longitude");
64 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

+ 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.

96 : string
97 {
98 $std_tile = self::settings()->get("std_tile");
99 return $std_tile ?: self::DEFAULT_TILE;
100 }
const DEFAULT_TILE

References DEFAULT_TILE, and settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

+ 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.

71 : ?string
72 {
73 return self::settings()->get("std_zoom");
74 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\getMapsForm().

+ 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.

41 : ?string
42 {
43 return self::settings()->get("type");
44 }

References settings().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActivated()

static ilMapUtil::isActivated ( )
static

Checks whether Map feature is activated.

API key must be provided.

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

26 : bool
27 {
28 return self::settings()->get("enable") == 1;
29 }

References settings().

Referenced by ilPersonalProfileGUI\addLocationToForm(), ilObjCourseGUI\editMapSettingsObject(), ilObjGroupGUI\editMapSettingsObject(), ilPublicUserProfileGUI\getEmbeddable(), ilObjExternalToolsSettingsGUI\getMapsForm(), ilMembershipGUI\membersMap(), ilMembershipGUI\setSubTabs(), ilObjCourseGUI\setSubTabs(), ilObjGroupGUI\setSubTabs(), and ilPageObjectGUI\showPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActivated()

static ilMapUtil::setActivated ( bool  $activated)
static

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

31 : void
32 {
33 self::settings()->set("enable", $activated ? "1" : "0");
34 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

+ 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.

76 : void
77 {
78 self::settings()->set("api_key", $api_key);
79 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

+ 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.

103 : void
104 {
105 self::settings()->set("std_geolocation", $geolocation);
106 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

+ 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.

46 : void
47 {
48 self::settings()->set("std_latitude", $lat);
49 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

+ 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.

56 : void
57 {
58 self::settings()->set("std_longitude", $lon);
59 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

+ 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.

86 : void
87 {
88 self::settings()->set("std_tile", $tile);
89 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

+ 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.

66 : void
67 {
68 self::settings()->set("std_zoom", $zoom);
69 }

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

+ 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 }
static ilSetting $_settings
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $_settings.

Referenced by getApiKey(), getDefaultSettings(), getStdGeolocationServer(), getStdLatitude(), getStdLongitude(), getStdTileServers(), getStdZoom(), getType(), isActivated(), setActivated(), setApiKey(), setStdGeolocationServer(), setStdLatitude(), setStdLongitude(), setStdTileServers(), setStdZoom(), and setType().

+ Here is the caller graph for this function:

◆ setType()

static ilMapUtil::setType ( string  $type)
static

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

36 : void
37 {
38 self::settings()->set("type", $type);
39 }

References $type, and settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

+ 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.

Referenced by settings().

◆ DEFAULT_GEOLOCATION

const ilMapUtil::DEFAULT_GEOLOCATION = null

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

Referenced by getStdGeolocationServer().

◆ DEFAULT_TILE

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

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