ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

95 : ?string
96 {
97 return self::settings()->get("api_key");
98 }
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 166 of file class.ilMapUtil.php.

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 $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26

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 135 of file class.ilMapUtil.php.

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 }

References settings().

Referenced by ilADTLocationFormBridge\addToForm(), ilADTLocationSearchBridgeSingle\addToForm(), ilObjCourseGUI\editMapSettingsObject(), ilObjGroupGUI\editMapSettingsObject(), and ILIAS\User\Profile\Fields\Standard\Location\getLegacyInput().

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

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.
static getType()
User interface class for OpenLayers maps.

References getType().

Referenced by ILIAS\User\Profile\PublicProfileGUI\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 125 of file class.ilMapUtil.php.

125 : ?string
126 {
127 $std_geoloc = self::settings()->get("std_geolocation");
128 return $std_geoloc ?: self::DEFAULT_GEOLOCATION;
129 }
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 65 of file class.ilMapUtil.php.

65 : ?string
66 {
67 return self::settings()->get("std_latitude");
68 }

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 75 of file class.ilMapUtil.php.

75 : ?string
76 {
77 return self::settings()->get("std_longitude");
78 }

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 110 of file class.ilMapUtil.php.

110 : string
111 {
112 $std_tile = self::settings()->get("std_tile");
113 return $std_tile ?: self::DEFAULT_TILE;
114 }
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 85 of file class.ilMapUtil.php.

85 : ?string
86 {
87 return self::settings()->get("std_zoom");
88 }

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 55 of file class.ilMapUtil.php.

55 : ?string
56 {
57 return self::settings()->get("type");
58 }

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 40 of file class.ilMapUtil.php.

40 : bool
41 {
42 return self::settings()->get("enable") == 1;
43 }

References settings().

Referenced by ilObjCourseGUI\editMapSettingsObject(), ilObjGroupGUI\editMapSettingsObject(), ILIAS\User\Profile\PublicProfileGUI\getEmbeddable(), ilObjExternalToolsSettingsGUI\getMapsForm(), ILIAS\User\LocalDIC\init(), 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 45 of file class.ilMapUtil.php.

45 : void
46 {
47 self::settings()->set("enable", $activated ? "1" : "0");
48 }

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 90 of file class.ilMapUtil.php.

90 : void
91 {
92 self::settings()->set("api_key", $api_key);
93 }

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 117 of file class.ilMapUtil.php.

117 : void
118 {
119 self::settings()->set("std_geolocation", $geolocation);
120 }

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 60 of file class.ilMapUtil.php.

60 : void
61 {
62 self::settings()->set("std_latitude", $lat);
63 }

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 70 of file class.ilMapUtil.php.

70 : void
71 {
72 self::settings()->set("std_longitude", $lon);
73 }

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 100 of file class.ilMapUtil.php.

100 : void
101 {
102 self::settings()->set("std_tile", $tile);
103 }

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 80 of file class.ilMapUtil.php.

80 : void
81 {
82 self::settings()->set("std_zoom", $zoom);
83 }

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 28 of file class.ilMapUtil.php.

28 : ilSetting
29 {
30 if (self::$_settings === null) {
31 self::$_settings = new ilSetting("maps");
32 }
33 return self::$_settings;
34 }
static ilSetting $_settings
ILIAS Setting Class.

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 50 of file class.ilMapUtil.php.

50 : void
51 {
52 self::settings()->set("type", $type);
53 }

References 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 26 of file class.ilMapUtil.php.

Referenced by settings().

◆ DEFAULT_GEOLOCATION

const ilMapUtil::DEFAULT_GEOLOCATION = null

Definition at line 24 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: