ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilMapUtil.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
33{
34 static $_settings = null;
35
36 // Settings
37
38 static function settings()
39 {
40 if (self::$_settings === null) {
41 self::$_settings = new ilSetting("maps");
42 }
43 return self::$_settings;
44 }
45
46
47
54 static function isActivated()
55 {
56 return self::settings()->get("enable") == 1;
57 }
58
59 // RK TODO: check inputs of setters
60
61 static function setActivated($a_activated)
62 {
63 self::settings()->set("enable", $a_activated?"1":"0");
64 }
65
66 static function setType($a_type)
67 {
68 self::settings()->set("type", $a_type);
69 }
70
71 static function getType() {
72 return self::settings()->get("type");
73 }
74
75 static function setStdLatitude($a_lat)
76 {
77 self::settings()->set("std_latitude", $a_lat);
78 }
79
80 static function getStdLatitude()
81 {
82 return self::settings()->get("std_latitude");
83 }
84
85 static function setStdLongitude($a_lon)
86 {
87 self::settings()->set("std_longitude", $a_lon);
88 }
89
90 static function getStdLongitude()
91 {
92 return self::settings()->get("std_longitude");
93 }
94
95 static function setStdZoom($a_zoom)
96 {
97 self::settings()->set("std_zoom", $a_zoom);
98 }
99
100 static function getStdZoom()
101 {
102 return self::settings()->get("std_zoom");
103 }
104
105 static function setApiKey($a_api_key)
106 {
107 self::settings()->set("api_key", $a_api_key);
108 }
109
110 static function getApiKey()
111 {
112 return self::settings()->get("api_key");
113 }
114
120 static function getDefaultSettings()
121 {
122 return array(
123 "longitude" => self::settings()->get("std_longitude"),
124 "latitude" => self::settings()->get("std_latitude"),
125 "zoom" => self::settings()->get("std_zoom"));
126 }
127
131 static public function getMapGUI()
132 {
133 $type = self::getType();
134 switch ($type) {
135 case "googlemaps":
136 require_once("Services/Maps/classes/class.ilGoogleMapGUI.php");
137 return new ilGoogleMapGUI();
138 case "openlayers":
139 require_once("Services/Maps/classes/class.ilOpenLayersMapGUI.php");
140 return new ilOpenLayersMapGUI();
141 default:
142 require_once("Services/Maps/classes/class.ilGoogleMapGUI.php");
143 return new ilGoogleMapGUI();
144 }
145 }
146
152 static public function getAvailableMapTypes()
153 {
154 global $lng;
155 $lng->loadLanguageModule("maps");
156 return array( "openlayers" => $lng->txt("maps_open_layers_maps")
157 , "googlemaps" => $lng->txt("maps_google_maps")
158 );
159 }
160}
161?>
User interface class for google maps.
Map Utility Class.
static getApiKey()
static getStdLatitude()
static getStdLongitude()
static setApiKey($a_api_key)
static setActivated($a_activated)
static getStdZoom()
static setStdLatitude($a_lat)
static settings()
static isActivated()
Checks whether Map feature is activated.
static setStdZoom($a_zoom)
static setStdLongitude($a_lon)
static $_settings
static getAvailableMapTypes()
Get a dict { $id => $name } for available maps services.
static getMapGUI()
Get an instance of the GUI class.
static getDefaultSettings()
Get default longitude, latitude and zoom.
static setType($a_type)
static getType()
User interface class for OpenLayers maps.
ILIAS Setting Class.
global $lng
Definition: privfeed.php:40