ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMapUtil Class Reference

Map Utility Class. More...

+ Collaboration diagram for ilMapUtil:

Static Public Member Functions

static settings ()
 
static isActivated ()
 Checks whether Map feature is activated. More...
 
static setActivated ($a_activated)
 
static setType ($a_type)
 
static getType ()
 
static setStdLatitude ($a_lat)
 
static getStdLatitude ()
 
static setStdLongitude ($a_lon)
 
static getStdLongitude ()
 
static setStdZoom ($a_zoom)
 
static getStdZoom ()
 
static setApiKey ($a_api_key)
 
static getApiKey ()
 
static setStdTileServers ($a_tile)
 
static getStdTileServers ()
 Returns the tile server to be used in the installation. More...
 
static setStdGeolocationServer ($a_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 $_settings = null
 

Detailed Description

Map Utility Class.

Author
Richard Klees richa.nosp@m.rd.k.nosp@m.lees@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de
Version
$Id$

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

Member Function Documentation

◆ getApiKey()

static ilMapUtil::getApiKey ( )
static

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

References settings().

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

114  {
115  return self::settings()->get("api_key");
116  }
settings()
Definition: settings.php:2
+ 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

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

References $DIC, $lng, and array.

Referenced by ilObjExternalToolsSettingsGUI\editMapsObject().

192  {
193  global $DIC;
194  $lng = $DIC['lng'];
195  $lng->loadLanguageModule("maps");
196  return array( "openlayers" => $lng->txt("maps_open_layers_maps")
197  , "googlemaps" => $lng->txt("maps_google_maps")
198  );
199  }
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
global $DIC
+ Here is the caller graph for this function:

◆ getDefaultSettings()

static ilMapUtil::getDefaultSettings ( )
static

Get default longitude, latitude and zoom.

Returns
array array("latitude", "longitude", "zoom")

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

References array, and settings().

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

157  {
158  return array(
159  "longitude" => self::settings()->get("std_longitude"),
160  "latitude" => self::settings()->get("std_latitude"),
161  "zoom" => self::settings()->get("std_zoom"));
162  }
Create styles array
The data for the language used.
settings()
Definition: settings.php:2
+ 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 167 of file class.ilMapUtil.php.

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

168  {
169  $type = self::getType();
170  switch ($type) {
171  case "googlemaps":
172  require_once("Services/Maps/classes/class.ilGoogleMapGUI.php");
173  return new ilGoogleMapGUI();
174  case "openlayers":
175  require_once("Services/Maps/classes/class.ilOpenLayersMapGUI.php");
176  $map = new ilOpenLayersMapGUI();
177  $map->setTileServers(self::getStdTileServers());
178  $map->setGeolocationServer(self::getStdGeolocationServer());
179  return $map;
180  default:
181  require_once("Services/Maps/classes/class.ilGoogleMapGUI.php");
182  return new ilGoogleMapGUI();
183  }
184  }
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.

Returns
string tile server url

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

References settings().

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

146  {
147  $std_geoloc = self::settings()->get("std_geolocation");
148  return $std_geoloc ? $std_geoloc : self::DEFAULT_GEOLOCATION;
149  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdLatitude()

static ilMapUtil::getStdLatitude ( )
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\editMapsObject().

84  {
85  return self::settings()->get("std_latitude");
86  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdLongitude()

static ilMapUtil::getStdLongitude ( )
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\editMapsObject().

94  {
95  return self::settings()->get("std_longitude");
96  }
settings()
Definition: settings.php:2
+ 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 128 of file class.ilMapUtil.php.

References settings().

Referenced by ilObjExternalToolsSettingsGUI\editMapsObject().

129  {
130  $std_tile = self::settings()->get("std_tile");
131  return $std_tile ? $std_tile : self::DEFAULT_TILE;
132  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStdZoom()

static ilMapUtil::getStdZoom ( )
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\editMapsObject().

104  {
105  return self::settings()->get("std_zoom");
106  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

static ilMapUtil::getType ( )
static

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

References settings().

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

74  {
75  return self::settings()->get("type");
76  }
settings()
Definition: settings.php:2
+ 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.

Returns
boolean activated true/false

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

References settings().

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

58  {
59  return self::settings()->get("enable") == 1;
60  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActivated()

static ilMapUtil::setActivated (   $a_activated)
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

65  {
66  self::settings()->set("enable", $a_activated?"1":"0");
67  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setApiKey()

static ilMapUtil::setApiKey (   $a_api_key)
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

109  {
110  self::settings()->set("api_key", $a_api_key);
111  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdGeolocationServer()

static ilMapUtil::setStdGeolocationServer (   $a_geolocation)
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

136  {
137  self::settings()->set("std_geolocation", $a_geolocation);
138  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdLatitude()

static ilMapUtil::setStdLatitude (   $a_lat)
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

79  {
80  self::settings()->set("std_latitude", $a_lat);
81  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdLongitude()

static ilMapUtil::setStdLongitude (   $a_lon)
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

89  {
90  self::settings()->set("std_longitude", $a_lon);
91  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdTileServers()

static ilMapUtil::setStdTileServers (   $a_tile)
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

119  {
120  self::settings()->set("std_tile", $a_tile);
121  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setStdZoom()

static ilMapUtil::setStdZoom (   $a_zoom)
static

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

References settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

99  {
100  self::settings()->set("std_zoom", $a_zoom);
101  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings()

static ilMapUtil::settings ( )
static

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

42  {
43  if (self::$_settings === null) {
44  self::$_settings = new ilSetting("maps");
45  }
46  return self::$_settings;
47  }
ILIAS Setting Class.

◆ setType()

static ilMapUtil::setType (   $a_type)
static

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

References $a_type, and settings().

Referenced by ilObjExternalToolsSettingsGUI\saveMapsObject().

70  {
71  self::settings()->set("type", $a_type);
72  }
$a_type
Definition: workflow.php:93
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $_settings

ilMapUtil::$_settings = null
static

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

◆ DEFAULT_GEOLOCATION

const ilMapUtil::DEFAULT_GEOLOCATION = null

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

Referenced by ilObjExternalToolsSettingsGUI\editMapsObject().


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