Index: trunk/extensions/Maps/Maps_Settings.php |
— | — | @@ -1,18 +1,17 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * File defining the settings for the Maps extension. |
6 | 5 | * More info can be found at http://www.mediawiki.org/wiki/Extension:Maps#Settings |
7 | 6 | * |
8 | 7 | * NOTICE: |
9 | | - * Changing one of these settings can be done by copieng or cutting it, |
| 8 | + * Changing one of these settings can be done by copieng or cutting it, |
10 | 9 | * and placing it in LocalSettings.php, AFTER the inclusion of Maps. |
11 | 10 | * |
12 | 11 | * @file Maps_Settings.php |
13 | 12 | * @ingroup Maps |
14 | 13 | * |
15 | 14 | * @author Jeroen De Dauw |
16 | | - * |
| 15 | + * |
17 | 16 | * TODO: clean up, update docs |
18 | 17 | */ |
19 | 18 | |
— | — | @@ -20,21 +19,16 @@ |
21 | 20 | die( 'Not an entry point.' ); |
22 | 21 | } |
23 | 22 | |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | 23 | # Map features configuration |
29 | 24 | # (named) Array of String. This array contains the available features for Maps. |
30 | 25 | # The array element name contains an abbriviation, used for code references, |
31 | | -# and in the service data arrays, the value is the human readible version for displaying purpouses. |
| 26 | +# and in the service data arrays, the value is the human readible version for |
| 27 | +# displaying purposes. |
32 | 28 | |
33 | 29 | include_once $egMapsDir . 'Features/Maps_ParserFunctions.php'; // Parser functions |
34 | | -include_once $egMapsDir . 'Features/DisplayMap/Maps_DisplayMap.php'; // #display_map |
| 30 | +include_once $egMapsDir . 'Features/DisplayMap/Maps_DisplayMap.php'; // #display_map |
35 | 31 | include_once $egMapsDir . 'Features/DisplayPoint/Maps_DisplayPoint.php'; // #display_point(s) |
36 | 32 | |
37 | | - |
38 | | - |
39 | 33 | # Include the parser functions that should be loaded into Maps. |
40 | 34 | # Commenting or removing a parser functions will cause Maps to completely ignore it, and so improve performance. |
41 | 35 | include_once $egMapsDir . 'Geocoders/Maps_Geocoders.php'; // Geocoders |
— | — | @@ -42,20 +36,16 @@ |
43 | 37 | include_once $egMapsDir . 'ParserFunctions/Coordinates/Maps_Coordinates.php'; // #coordinates |
44 | 38 | include_once $egMapsDir . 'ParserFunctions/GeoFunctions/Maps_GeoFunctions.php'; // #geodistance |
45 | 39 | |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | 40 | # Mapping services configuration |
51 | 41 | # Note: You can not use aliases in the settings. Use the main service names. |
52 | 42 | |
53 | | -# Include the mapping services that should be loaded into Maps. |
| 43 | +# Include the mapping services that should be loaded into Maps. |
54 | 44 | # Commenting or removing a mapping service will cause Maps to completely ignore it, and so improve performance. |
55 | | -include_once $egMapsDir . 'Services/GoogleMaps/Maps_GoogleMaps.php'; // Google Maps |
56 | | -include_once $egMapsDir . 'Services/GoogleMaps3/Maps_GoogleMaps3.php'; // Google Maps v3 |
57 | | -include_once $egMapsDir . 'Services/OpenLayers/Maps_OpenLayers.php'; // OpenLayers |
58 | | -include_once $egMapsDir . 'Services/YahooMaps/Maps_YahooMaps.php'; // Yahoo! Maps |
59 | | -// include_once $egMapsDir . 'Services/OpenStreetMap/Maps_OSM.php'; // OpenLayers optimized for OSM |
| 45 | +include_once $egMapsDir . 'Services/GoogleMaps/Maps_GoogleMaps.php'; // Google Maps |
| 46 | +include_once $egMapsDir . 'Services/GoogleMaps3/Maps_GoogleMaps3.php'; // Google Maps v3 |
| 47 | +include_once $egMapsDir . 'Services/OpenLayers/Maps_OpenLayers.php'; // OpenLayers |
| 48 | +include_once $egMapsDir . 'Services/YahooMaps/Maps_YahooMaps.php'; // Yahoo! Maps |
| 49 | +// include_once $egMapsDir . 'Services/OpenStreetMap/Maps_OSM.php'; // OpenLayers optimized for OSM |
60 | 50 | |
61 | 51 | # Array of String. Array containing all the mapping services that will be made available to the user. |
62 | 52 | # Currently Maps provides the following services: googlemaps, yahoomaps, openlayers |
— | — | @@ -66,49 +56,45 @@ |
67 | 57 | 'openlayers' |
68 | 58 | ); |
69 | 59 | |
70 | | -# String. The default mapping service, which will be used when no default service is present in the |
71 | | -# $egMapsDefaultServices array for a certain feature. A service that supports all features is recommended. |
72 | | -# This service needs to be enabled, if not, the first one from the available services will be taken. |
| 60 | +# String. The default mapping service, which will be used when no default |
| 61 | +# service is present in the $egMapsDefaultServices array for a certain feature. |
| 62 | +# A service that supports all features is recommended. This service needs to be |
| 63 | +# enabled, if not, the first one from the available services will be taken. |
73 | 64 | $egMapsDefaultService = 'googlemaps2'; |
74 | 65 | |
75 | | -# Array of String. The default mapping service for each feature, which will be used when no valid service is provided by the user. |
76 | | -# Each service needs to be enabled, if not, the first one from the available services will be taken. |
77 | | -# Note: The default service needs to be available for the feature you set it for, since it's used as a fallback mechanism. |
| 66 | +# Array of String. The default mapping service for each feature, which will be |
| 67 | +# used when no valid service is provided by the user. Each service needs to be |
| 68 | +# enabled, if not, the first one from the available services will be taken. |
| 69 | +# Note: The default service needs to be available for the feature you set it |
| 70 | +# for, since it's used as a fallback mechanism. |
78 | 71 | $egMapsDefaultServices = array( |
79 | 72 | 'display_point' => 'googlemaps2', |
80 | 73 | 'display_map' => 'googlemaps2' |
81 | 74 | ); |
82 | 75 | |
83 | | - |
84 | | - |
85 | | - |
86 | 76 | # Geocoding services configuration |
87 | 77 | |
88 | | -# Array of String. Array containing all the geocoding services that will be made available to the user. |
89 | | -# Currently Maps provides the following services: geonames, google, yahoo |
| 78 | +# Array of String. Array containing all the geocoding services that will be |
| 79 | +# made available to the user. Currently Maps provides the following services: |
| 80 | +# geonames, google, yahoo |
90 | 81 | $egMapsAvailableGeoServices = array( |
91 | 82 | 'geonames', |
92 | 83 | 'google', |
93 | 84 | 'yahoo' |
94 | 85 | ); |
95 | 86 | |
96 | | -# String. The default geocoding service, which will be used when no service is provided by the user. |
97 | | -# This service needs to be enabled, if not, the first one from the available services will be taken. |
| 87 | +# String. The default geocoding service, which will be used when no service is |
| 88 | +# is provided by the user. This service needs to be enabled, if not, the first |
| 89 | +# one from the available services will be taken. |
98 | 90 | $egMapsDefaultGeoService = 'geonames'; |
99 | 91 | |
100 | 92 | $egMapsUserGeoOverrides = true; |
101 | 93 | |
102 | | - |
103 | | - |
104 | 94 | # General configuration |
105 | 95 | |
106 | 96 | # Boolean. Indicates if minified js files should be used where available. |
107 | 97 | $egMapsUseMinJs = false; |
108 | 98 | |
109 | | - |
110 | | - |
111 | | - |
112 | | - |
113 | 99 | # Coordinate configuration |
114 | 100 | |
115 | 101 | $egMapsAvailableCoordNotations = array( |
— | — | @@ -119,60 +105,62 @@ |
120 | 106 | ); |
121 | 107 | |
122 | 108 | # Enum. The default output format of coordinates. |
123 | | -# Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD |
| 109 | +# Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, |
| 110 | +# Maps_COORDS_DD |
124 | 111 | $egMapsCoordinateNotation = Maps_COORDS_FLOAT; |
125 | 112 | |
126 | | -# Boolean. Indicates if coordinates should be outputted in directional notation by default. |
| 113 | +# Boolean. Indicates if coordinates should be outputted in directional notation |
| 114 | +# by default. |
127 | 115 | $egMapsCoordinateDirectional = false; |
128 | 116 | |
129 | 117 | $egMapsAllowCoordsGeocoding = true; |
130 | 118 | |
131 | 119 | $egMapsEnableGeoCache = true; |
132 | 120 | |
133 | | - |
134 | | - |
135 | | - |
136 | 121 | # General map configuration |
137 | 122 | |
138 | | -# Integer or string. The default width and height of a map. These values will only be used when the user does not provide them. |
| 123 | +# Integer or string. The default width and height of a map. These values will |
| 124 | +# only be used when the user does not provide them. |
139 | 125 | $egMapsMapWidth = '100%'; |
140 | 126 | $egMapsMapHeight = 350; |
141 | 127 | |
142 | | -# Array. The minimum and maximum width and height for all maps. |
143 | | -# First min and max for absolute values, then min and max for percentage values. |
144 | | -# When the height or width exceed their limits, they will be changed to the closest allowed value. |
| 128 | +# Array. The minimum and maximum width and height for all maps. First min and |
| 129 | +# max for absolute values, then min and max for percentage values. When the |
| 130 | +# height or width exceed their limits, they will be changed to the closest |
| 131 | +# allowed value. |
145 | 132 | $egMapsSizeRestrictions = array( |
146 | 133 | 'width' => array( 50, 1020, 1, 100 ), |
147 | 134 | 'height' => array( 50, 1000, 1, 100 ), |
148 | 135 | ); |
149 | 136 | |
150 | | -# Strings. The default coordinates for the map. Must be in floating point notation. |
151 | | -# This value will only be used when the user does not provide one. |
| 137 | +# Strings. The default coordinates for the map. Must be in floating point |
| 138 | +# notation. This value will only be used when the user does not provide one. |
152 | 139 | $egMapsMapLat = '1'; |
153 | 140 | $egMapsMapLon = '1'; |
154 | 141 | |
155 | | -# Strings. The default content for all pop-ups. This value will only be used when the user does not provide one. |
| 142 | +# Strings. The default content for all pop-ups. This value will only be used |
| 143 | +# when the user does not provide one. |
156 | 144 | $egMapsDefaultTitle = ''; |
157 | 145 | $egMapsDefaultLabel = ''; |
158 | 146 | |
159 | | - |
160 | | - |
161 | | - |
162 | | - |
163 | 147 | # Specific map properties configuration |
164 | 148 | |
165 | 149 | # Google Maps |
166 | 150 | |
167 | | -# Your Google Maps API key. Required for displaying Google Maps, and using the Google Geocoder services. |
| 151 | +# Your Google Maps API key. Required for displaying Google Maps, and using the |
| 152 | +# Google Geocoder services. |
168 | 153 | $egGoogleMapsKey = ''; # http://code.google.com/apis/maps/signup.html |
169 | 154 | |
170 | | -# String. The Google Maps map name prefix. It can not be identical to the one of another mapping service. |
| 155 | +# String. The Google Maps map name prefix. It can not be identical to the one |
| 156 | +# of another mapping service. |
171 | 157 | $egMapsGoogleMapsPrefix = 'map_google'; |
172 | 158 | |
173 | | -# Integer. The default zoom of a map. This value will only be used when the user does not provide one. |
| 159 | +# Integer. The default zoom of a map. This value will only be used when the |
| 160 | +# user does not provide one. |
174 | 161 | $egMapsGoogleMapsZoom = 14; |
175 | 162 | |
176 | | -# Array of String. The Google Maps v2 default map types. This value will only be used when the user does not provide one. |
| 163 | +# Array of String. The Google Maps v2 default map types. This value will only |
| 164 | +# be used when the user does not provide one. |
177 | 165 | $egMapsGoogleMapsTypes = array( |
178 | 166 | 'normal', |
179 | 167 | 'satellite', |
— | — | @@ -180,15 +168,18 @@ |
181 | 169 | 'physical' |
182 | 170 | ); |
183 | 171 | |
184 | | -# String. The default map type. This value will only be used when the user does not provide one. |
| 172 | +# String. The default map type. This value will only be used when the user does |
| 173 | +# not provide one. |
185 | 174 | $egMapsGoogleMapsType = 'normal'; |
186 | 175 | |
187 | 176 | # Boolean. The default value for enabling or disabling the autozoom of a map. |
188 | 177 | # This value will only be used when the user does not provide one. |
189 | 178 | $egMapsGoogleAutozoom = true; |
190 | 179 | |
191 | | -# Array of String. The default controls for Google Maps v2. This value will only be used when the user does not provide one. |
192 | | -# Available values: auto, large, small, large-original, small-original, zoom, type, type-menu, overview-map, scale, nav-label, overlays |
| 180 | +# Array of String. The default controls for Google Maps v2. This value will |
| 181 | +# only be used when the user does not provide one. |
| 182 | +# Available values: auto, large, small, large-original, small-original, zoom, |
| 183 | +# type, type-menu, overview-map, scale, nav-label, overlays |
193 | 184 | $egMapsGMapControls = array( |
194 | 185 | 'auto', |
195 | 186 | 'scale', |
— | — | @@ -196,8 +187,9 @@ |
197 | 188 | 'overlays' |
198 | 189 | ); |
199 | 190 | |
200 | | -# Array. The default overlays for the Google Maps v2 overlays control, and whether they should be shown at pageload. |
201 | | -# This value will only be used when the user does not provide one. |
| 191 | +# Array. The default overlays for the Google Maps v2 overlays control, and |
| 192 | +# whether they should be shown at pageload. This value will only be used when |
| 193 | +# the user does not provide one. |
202 | 194 | # Available values: photos, videos, wikipedia, webcams |
203 | 195 | $egMapsGMapOverlays = array( |
204 | 196 | 'photos', |
— | — | @@ -206,17 +198,18 @@ |
207 | 199 | 'webcams' |
208 | 200 | ); |
209 | 201 | |
210 | | - |
211 | | - |
212 | 202 | # Google Maps v3 |
213 | 203 | |
214 | | -# String. The Google Maps v3 map name prefix. It can not be identical to the one of another mapping service. |
| 204 | +# String. The Google Maps v3 map name prefix. It can not be identical to the |
| 205 | +# one of another mapping service. |
215 | 206 | $egMapsGMaps3Prefix = 'map_google3'; |
216 | 207 | |
217 | | -# Integer. The default zoom of a map. This value will only be used when the user does not provide one. |
| 208 | +# Integer. The default zoom of a map. This value will only be used when the |
| 209 | +# user does not provide one. |
218 | 210 | $egMapsGMaps3Zoom = 14; |
219 | 211 | |
220 | | -# Array of String. The Google Maps v3 default map types. This value will only be used when the user does not provide one. |
| 212 | +# Array of String. The Google Maps v3 default map types. This value will only |
| 213 | +# be used when the user does not provide one. |
221 | 214 | $egMapsGMaps3Types = array( |
222 | 215 | 'roadmap', |
223 | 216 | 'satellite', |
— | — | @@ -224,38 +217,42 @@ |
225 | 218 | 'terrain' |
226 | 219 | ); |
227 | 220 | |
228 | | -# String. The default map type. This value will only be used when the user does not provide one. |
| 221 | +# String. The default map type. This value will only be used when the user |
| 222 | +# does not provide one. |
229 | 223 | $egMapsGMaps3Type = 'roadmap'; |
230 | 224 | |
231 | | - |
232 | | - |
233 | 225 | # Yahoo! Maps |
234 | 226 | |
235 | 227 | # Your Yahoo! Maps API key. Required for displaying Yahoo! Maps. |
236 | 228 | # Haven't got an API key yet? Get it here: https://developer.yahoo.com/wsregapp/ |
237 | 229 | $egYahooMapsKey = ''; |
238 | 230 | |
239 | | -# String. The Yahoo! maps map name prefix. It can not be identical to the one of another mapping service. |
| 231 | +# String. The Yahoo! maps map name prefix. It can not be identical to the one |
| 232 | +# of another mapping service. |
240 | 233 | $egMapsYahooMapsPrefix = 'map_yahoo'; |
241 | 234 | |
242 | | -# Array of String. The Google Maps default map types. This value will only be used when the user does not provide one. |
| 235 | +# Array of String. The Google Maps default map types. This value will only be |
| 236 | +# used when the user does not provide one. |
243 | 237 | $egMapsYahooMapsTypes = array( |
244 | 238 | 'normal', |
245 | 239 | 'satellite', |
246 | 240 | 'hybrid' |
247 | 241 | ); |
248 | 242 | |
249 | | -# String. The default map type. This value will only be used when the user does not provide one. |
| 243 | +# String. The default map type. This value will only be used when the user does |
| 244 | +# not provide one. |
250 | 245 | $egMapsYahooMapsType = 'normal'; |
251 | 246 | |
252 | | -# Integer. The default zoom of a map. This value will only be used when the user does not provide one. |
| 247 | +# Integer. The default zoom of a map. This value will only be used when the |
| 248 | +# user does not provide one. |
253 | 249 | $egMapsYahooMapsZoom = 4; |
254 | 250 | |
255 | 251 | # Boolean. The default value for enabling or disabling the autozoom of a map. |
256 | 252 | # This value will only be used when the user does not provide one. |
257 | 253 | $egMapsYahooAutozoom = true; |
258 | 254 | |
259 | | -# Array of String. The default controls for Yahoo! Maps. This value will only be used when the user does not provide one. |
| 255 | +# Array of String. The default controls for Yahoo! Maps. This value will only |
| 256 | +# be used when the user does not provide one. |
260 | 257 | # Available values: type, pan, zoom, zoom-short, auto-zoom |
261 | 258 | $egMapsYMapControls = array( |
262 | 259 | 'type', |
— | — | @@ -263,18 +260,20 @@ |
264 | 261 | 'auto-zoom' |
265 | 262 | ); |
266 | 263 | |
267 | | - |
268 | | - |
269 | 264 | # OpenLayers |
270 | 265 | |
271 | | -# String. The OpenLayers map name prefix. It can not be identical to the one of another mapping service. |
| 266 | +# String. The OpenLayers map name prefix. It can not be identical to the one of |
| 267 | +# another mapping service. |
272 | 268 | $egMapsOpenLayersPrefix = 'open_layer'; |
273 | 269 | |
274 | | -# Integer. The default zoom of a map. This value will only be used when the user does not provide one. |
| 270 | +# Integer. The default zoom of a map. This value will only be used when the |
| 271 | +# user does not provide one. |
275 | 272 | $egMapsOpenLayersZoom = 13; |
276 | 273 | |
277 | | -# Array of String. The default controls for Open Layers. This value will only be used when the user does not provide one. |
278 | | -# Available values: layerswitcher, mouseposition, autopanzoom, panzoom, panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink |
| 274 | +# Array of String. The default controls for Open Layers. This value will only |
| 275 | +# be used when the user does not provide one. |
| 276 | +# Available values: layerswitcher, mouseposition, autopanzoom, panzoom, |
| 277 | +# panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink |
279 | 278 | $egMapsOLControls = array( |
280 | 279 | 'layerswitcher', |
281 | 280 | 'mouseposition', |
— | — | @@ -283,7 +282,8 @@ |
284 | 283 | 'navigation' |
285 | 284 | ); |
286 | 285 | |
287 | | -# Array of String. The default layers for Open Layers. This value will only be used when the user does not provide one. |
| 286 | +# Array of String. The default layers for Open Layers. This value will only be |
| 287 | +# used when the user does not provide one. |
288 | 288 | # Available values: google, bing, yahoo, openlayers, nasa |
289 | 289 | $egMapsOLLayers = array( |
290 | 290 | 'openlayers-wms' |
— | — | @@ -306,11 +306,12 @@ |
307 | 307 | 'openlayers-wms' => array( 'OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", |
308 | 308 | {layers: "basic", "sphericalMercator":true} )', 'ol-wms' ), |
309 | 309 | |
310 | | - 'nasa' => 'OpenLayers.Layer.WMS("NASA Global Mosaic", "http://t1.hypercube.telascience.org/cgi-bin/landsat7", |
| 310 | + 'nasa' => 'OpenLayers.Layer.WMS("NASA Global Mosaic", "http://t1.hypercube.telascience.org/cgi-bin/landsat7", |
311 | 311 | {layers: "landsat7", "sphericalMercator":true} )', |
312 | 312 | ); |
313 | 313 | |
314 | | -# Layer group definitions. Group names must be different from layer names, and must only contain layers that are present in $egMapsOLAvailableLayers. |
| 314 | +# Layer group definitions. Group names must be different from layer names, and |
| 315 | +# must only contain layers that are present in $egMapsOLAvailableLayers. |
315 | 316 | $egMapsOLLayerGroups = array( |
316 | 317 | 'yahoo' => array( 'yahoo-normal', 'yahoo-satellite', 'yahoo-hybrid' ), |
317 | 318 | 'bing' => array( 'bing-normal', 'bing-satellite', 'bing-hybrid' ), |
— | — | @@ -329,14 +330,18 @@ |
330 | 331 | |
331 | 332 | # OpenStreetMap (OpenLayers optimized for OSM) |
332 | 333 | |
333 | | -# String. The OSM map name prefix. It can not be identical to the one of another mapping service. |
| 334 | +# String. The OSM map name prefix. It can not be identical to the one of |
| 335 | +# another mapping service. |
334 | 336 | $egMapsOSMPrefix = 'map_osm'; |
335 | 337 | |
336 | | -# Integer. The default zoom of a map. This value will only be used when the user does not provide one. |
| 338 | +# Integer. The default zoom of a map. This value will only be used when the |
| 339 | +# user does not provide one. |
337 | 340 | $egMapsOSMZoom = 13; |
338 | 341 | |
339 | | -# Array of String. The default controls for OSM maps. This value will only be used when the user does not provide one. |
340 | | -# Available values: layerswitcher, mouseposition, autopanzoom, panzoom, panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink |
| 342 | +# Array of String. The default controls for OSM maps. This value will only be |
| 343 | +# used when the user does not provide one. |
| 344 | +# Available values: layerswitcher, mouseposition, autopanzoom, panzoom, |
| 345 | +# panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink |
341 | 346 | $egMapsOSMControls = array( |
342 | 347 | 'layerswitcher', |
343 | 348 | 'mouseposition', |
— | — | @@ -350,5 +355,5 @@ |
351 | 356 | $egMapsOSMStaticAsDefault = false; |
352 | 357 | |
353 | 358 | # Boolean. Indicates whether the user should be able to activate a static map. |
354 | | -# This value will only be used when the user does not provide one. |
355 | | -$egMapsOSMStaticActivatable = true; |
\ No newline at end of file |
| 359 | +# This value will only be used when the user does not provide one. |
| 360 | +$egMapsOSMStaticActivatable = true; |
Index: trunk/extensions/Maps/Maps_Mapper.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * A class that holds static helper functions for common functionality that is not map-spesific. |
6 | 5 | * |
— | — | @@ -14,7 +13,6 @@ |
15 | 14 | } |
16 | 15 | |
17 | 16 | final class MapsMapper { |
18 | | - |
19 | 17 | public static function initialize() { |
20 | 18 | global $egMapsSizeRestrictions, $egMapsMapWidth, $egMapsMapHeight; |
21 | 19 | |
— | — | @@ -265,5 +263,4 @@ |
266 | 264 | ), |
267 | 265 | ); |
268 | 266 | } |
269 | | - |
270 | 267 | } |