forked from ProfessionalWiki/Maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Maps_Settings.php
301 lines (230 loc) · 11.2 KB
/
Maps_Settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<?php
/**
* File defining the settings for the Maps extension.
*
* NOTICE:
* Changing one of these settings can be done by copying or cutting it,
* and placing it in LocalSettings.php, AFTER the inclusion of Maps.
*
* @author Jeroen De Dauw
*/
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'Not an entry point.' );
}
// Mapping services configuration
// Array of String. Array containing all the mapping services that will be made available to the user.
$GLOBALS['egMapsAvailableServices'] = [
'googlemaps3',
'openlayers',
'leaflet',
];
// String. The default mapping service, which will be used when no default
// service is present in the $GLOBALS['egMapsDefaultServices'] array for a certain feature.
// A service that supports all features is recommended. This service needs to be
// enabled, if not, the first one from the available services will be taken.
$GLOBALS['egMapsDefaultService'] = 'googlemaps3';
// Array of String. The default mapping service for each feature, which will be
// used when no valid service is provided by the user. Each service needs to be
// enabled, if not, the first one from the available services will be taken.
// Note: The default service needs to be available for the feature you set it
// for, since it's used as a fallback mechanism.
$GLOBALS['egMapsDefaultServices'] = [
'display_map' => $GLOBALS['egMapsDefaultService'],
];
// Geocoding
// Array of String. Array containing all the geocoding services that will be
// made available to the user. Currently Maps provides the following services:
// geonames, google
// It is recommended that when using GeoNames you get a GeoNames webservice account
// at http://www.geonames.org/login and set the username to $GLOBALS['egMapsGeoNamesUser'] below.
// Not doing this will result into a legacy service being used, which might be
// disabled at some future point.
$GLOBALS['egMapsAvailableGeoServices'] = [
'geonames',
'google',
'geocoderus',
];
// String. The default geocoding service, which will be used when no service is
// is provided by the user. This service needs to be enabled, if not, the first
// one from the available services will be taken.
$GLOBALS['egMapsDefaultGeoService'] = 'geonames';
// Boolean. Indicates if geocoders can override the default geoservice based on
// the used mapping service.
$GLOBALS['egMapsUserGeoOverrides'] = true;
// Boolean. Sets if coordinates should be allowed in geocoding calls.
$GLOBALS['egMapsAllowCoordsGeocoding'] = true;
// Boolean. Sets if geocoded addresses should be stored in a cache.
$GLOBALS['egMapsEnableGeoCache'] = true;
// String. GeoNames API user/application name.
// Obtain an account here: http://www.geonames.org/login
// Do not forget to activate your account for API usage!
$GLOBALS['egMapsGeoNamesUser'] = '';
// Coordinate configuration
// The coordinate notations that should be available.
$GLOBALS['egMapsAvailableCoordNotations'] = [
Maps_COORDS_FLOAT,
Maps_COORDS_DMS,
Maps_COORDS_DM,
Maps_COORDS_DD
];
// Enum. The default output format of coordinates.
// Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD
$GLOBALS['egMapsCoordinateNotation'] = Maps_COORDS_DMS;
// Boolean. Indicates if coordinates should be outputted in directional notation by default.
// Recommended to be true for Maps_COORDS_DMS and false for Maps_COORDS_FLOAT.
$GLOBALS['egMapsCoordinateDirectional'] = true;
// Boolean. Sets if direction labels should be translated to their equivalent in the wiki language or not.
$GLOBALS['egMapsInternatDirectionLabels'] = true;
// Distance configuration
// Array. A list of units (keys) and how many meters they represent (value).
// No spaces! If the unit consists out of multiple words, just write them together.
$GLOBALS['egMapsDistanceUnits'] = [
'm' => 1,
'meter' => 1,
'meters' => 1,
'km' => 1000,
'kilometers' => 1000,
'kilometres' => 1000,
'mi' => 1609.344,
'mile' => 1609.344,
'miles' => 1609.344,
'nm' => 1852,
'nauticalmile' => 1852,
'nauticalmiles' => 1852,
];
// String. The default unit for distances.
$GLOBALS['egMapsDistanceUnit'] = 'm';
// Integer. The default amount of fractal digits in a distance.
$GLOBALS['egMapsDistanceDecimals'] = 2;
// General map configuration
// Integer or string. The default width and height of a map. These values will
// only be used when the user does not provide them.
$GLOBALS['egMapsMapWidth'] = 'auto';
$GLOBALS['egMapsMapHeight'] = 350;
// Array. The minimum and maximum width and height for all maps. First min and
// max for absolute values, then min and max for percentage values. When the
// height or width exceed their limits, they will be changed to the closest
// allowed value.
$GLOBALS['egMapsSizeRestrictions'] = [
'width' => [ 50, 1020, 1, 100 ],
'height' => [ 50, 1000, 1, 100 ],
];
// String. The default centre for maps. Can be either a set of coordinates or an address.
$GLOBALS['egMapsDefaultMapCentre'] = '0, 0';
// Strings. The default content for all pop-ups. This value will only be used
// when the user does not provide one.
$GLOBALS['egMapsDefaultTitle'] = '';
$GLOBALS['egMapsDefaultLabel'] = '';
$GLOBALS['egMapsResizableByDefault'] = false;
$GLOBALS['egMapsRezoomForKML'] = false;
// Other general configuration
// When true, debugging messages will be logged using mw.log(). Do not use on production wikis.
$GLOBALS['egMapsDebugJS'] = false;
// Namespace index start of the mapping namespaces.
$GLOBALS['egMapsNamespaceIndex'] = 420;
// Boolean. Controls if you can specify images using a full path in layers.
$GLOBALS['egMapsAllowExternalImages'] = true;
// Boolean. Sets if pages with maps should be put in special category
$GLOBALS['egMapsEnableCategory'] = true;
// Specific mapping service configuration
// Google Maps v3
// Integer. The default zoom of a map. This value will only be used when the
// user does not provide one.
$GLOBALS['egMapsGMaps3Zoom'] = 14;
// Array of String. The Google Maps v3 default map types. This value will only
// be used when the user does not provide one.
$GLOBALS['egMapsGMaps3Types'] = [
'roadmap',
'satellite',
'hybrid',
'terrain'
];
// String. The default map type. This value will only be used when the user
// does not provide one.
$GLOBALS['egMapsGMaps3Type'] = 'roadmap';
// Array. List of controls to display onto maps by default.
$GLOBALS['egMapsGMaps3Controls'] = [
'pan',
'zoom',
'type',
'scale',
'streetview'
];
// String. The default style for the type control.
// horizontal, vertical or default
$GLOBALS['egMapsGMaps3DefTypeStyle'] = 'default';
// String. The default style for the zoom control.
// small, large or default
$GLOBALS['egMapsGMaps3DefZoomStyle'] = 'default';
// Boolean. Open the info windows on load by default?
$GLOBALS['egMapsGMaps3AutoInfoWindows'] = false;
// Array. Layers to load by default.
// traffic and bicycling
$GLOBALS['egMapsGMaps3Layers'] = [];
// Integer. Default tilt when using Google Maps.
$GLOBALS['egMapsGMaps3DefaultTilt'] = 0;
// Show points of interest or not.
$GLOBALS['egMapsShowPOI'] = true;
// String. Set the language when rendering Google Maps.
$GLOBALS['egMapsGMaps3Language'] = '';
// OpenLayers
// Integer. The default zoom of a map. This value will only be used when the
// user does not provide one.
$GLOBALS['egMapsOpenLayersZoom'] = 13;
// Array of String. The default controls for Open Layers. This value will only
// be used when the user does not provide one.
// Available values: layerswitcher, mouseposition, autopanzoom, panzoom,
// panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
$GLOBALS['egMapsOLControls'] = [
'layerswitcher',
'mouseposition',
'autopanzoom',
'scaleline',
'navigation'
];
// Array of String. The default layers for Open Layers. This value will only be
// used when the user does not provide one.
$GLOBALS['egMapsOLLayers'] = [
'osm-mapnik',
'osm-cyclemap'
];
// The difinitions for the layers that should be available for the user.
$GLOBALS['egMapsOLAvailableLayers'] = [
//'google' => array( 'OpenLayers.Layer.Google("Google Streets")' ),
'bing-normal' => [ 'OpenLayers.Layer.VirtualEarth( "Bing Streets", {type: VEMapStyle.Shaded, "sphericalMercator":true} )', 'bing' ],
'bing-satellite' => [ 'OpenLayers.Layer.VirtualEarth( "Bing Satellite", {type: VEMapStyle.Aerial, "sphericalMercator":true} )', 'bing' ],
'bing-hybrid' => [ 'OpenLayers.Layer.VirtualEarth( "Bing Hybrid", {type: VEMapStyle.Hybrid, "sphericalMercator":true} )', 'bing' ],
'yahoo-normal' => [ 'OpenLayers.Layer.Yahoo( "Yahoo! Streets", {"sphericalMercator":true} )', 'yahoo' ],
'yahoo-hybrid' => [ 'OpenLayers.Layer.Yahoo( "Yahoo! Hybrid", {"type": YAHOO_MAP_HYB, "sphericalMercator":true} )', 'yahoo' ],
'yahoo-satellite' => [ 'OpenLayers.Layer.Yahoo( "Yahoo! Satellite", {"type": YAHOO_MAP_SAT, "sphericalMercator":true} )', 'yahoo' ],
'osm-mapnik' => [ 'OpenLayers.Layer.OSM.Mapnik("OSM Mapnik")', 'osm' ],
'osm-cyclemap' => [ 'OpenLayers.Layer.OSM.CycleMap("OSM Cycle Map")', 'osm' ],
'osm-mapquest' => [ 'OpenLayers.Layer.OSM.Mapquest("Mapquest OSM")', 'osm' ],
'google-normal' => [ 'OpenLayers.Layer.Google("Google Streets", {type: google.maps.MapTypeId.STREETS, numZoomLevels: 20})', 'google' ],
'google-satellite' => [ 'OpenLayers.Layer.Google("Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22})', 'google' ],
'google-hybrid' => [ 'OpenLayers.Layer.Google("Google Hybrid", {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20})', 'google' ],
'google-terrain' => [ 'OpenLayers.Layer.Google("Google Terrain", {type: google.maps.MapTypeId.TERRAIN, numZoomLevels: 22})', 'google' ],
'nasa' => 'OpenLayers.Layer.WMS("NASA Global Mosaic", "http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7", "sphericalMercator":true} )',
];
// Layer group definitions. Group names must be different from layer names, and
// must only contain layers that are present in $GLOBALS['egMapsOLAvailableLayers'].
$GLOBALS['egMapsOLLayerGroups'] = [
'yahoo' => [ 'yahoo-normal', 'yahoo-satellite', 'yahoo-hybrid' ],
'bing' => [ 'bing-normal', 'bing-satellite', 'bing-hybrid' ],
'google' => [ 'google-normal', 'google-satellite', 'google-terrain', 'google-hybrid' ],
'osm' => [ 'osm-mapnik', 'osm-cyclemap' ],
];
global $wgJsMimeType;
// Layer dependencies
$GLOBALS['egMapsOLLayerDependencies'] = [
'yahoo' => "<style type='text/css'> #controls {width: 512px;}</style><script src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers'></script>",
'bing' => "<script type='$wgJsMimeType' src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>",
'ol-wms' => "<script type='$wgJsMimeType' src='http://clients.multimap.com/API/maps/1.1/metacarta_04'></script>",
'google' => "<script src='http://maps.google.com/maps/api/js?sensor=false'></script>",
];
// Leaflet
// Integer. The default zoom of a map. This value will only be used when the
// user does not provide one.
$GLOBALS['egMapsLeafletZoom'] = 14;
$GLOBALS['egMapsGlobalJSVars'] = [];