Index: trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php |
— | — | @@ -0,0 +1,42 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * This file contains registration |
| 6 | + * |
| 7 | + * |
| 8 | + * |
| 9 | + * @file Maps_Coordinates.php |
| 10 | + * @ingroup Maps |
| 11 | + * |
| 12 | + * @author Jeroen De Dauw |
| 13 | + */ |
| 14 | + |
| 15 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 16 | + die( 'Not an entry point.' ); |
| 17 | +} |
| 18 | + |
| 19 | +$wgHooks['LanguageGetMagic'][] = 'efMapsCoordinatesMagic'; |
| 20 | +$wgHooks['ParserFirstCallInit'][] = 'efMapsCoordinatesFunction'; |
| 21 | + |
| 22 | +/** |
| 23 | + * Adds the magic words for the parser functions. |
| 24 | + */ |
| 25 | +function efMapsCoordinatesMagic( &$magicWords, $langCode ) { |
| 26 | + $magicWords['coordinates'] = array( 0, 'coordinates' ); |
| 27 | + |
| 28 | + return true; // Unless we return true, other parser functions won't get loaded. |
| 29 | +} |
| 30 | + |
| 31 | +/** |
| 32 | + * Adds the parser function hooks. |
| 33 | + */ |
| 34 | +function efMapsCoordinatesFunction( &$wgParser ) { |
| 35 | + // Hooks to enable the geocoding parser functions. |
| 36 | + $wgParser->setFunctionHook( 'coordinates', 'efMapsRenderCoordinates' ); |
| 37 | + |
| 38 | + return true; |
| 39 | +} |
| 40 | + |
| 41 | +function efMapsRenderCoordinates() { |
| 42 | + |
| 43 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 44 | + native |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define( 'Maps_VERSION', '0.6 a8' ); |
| 37 | + define( 'Maps_VERSION', '0.6 a9' ); |
38 | 38 | |
39 | 39 | // The different coordinate notations. |
40 | 40 | define( 'Maps_COORDS_FLOAT', 'float' ); |
Index: trunk/extensions/Maps/Maps_Settings.php |
— | — | @@ -37,7 +37,11 @@ |
38 | 38 | |
39 | 39 | # Array of String. Array containing all the geocoding services that will be made available to the user. |
40 | 40 | # Currently Maps provides the following services: geonames, google, yahoo |
41 | | -$egMapsAvailableGeoServices = array('geonames', 'google', 'yahoo'); |
| 41 | +$egMapsAvailableGeoServices = array( |
| 42 | + 'geonames', |
| 43 | + 'google', |
| 44 | + 'yahoo' |
| 45 | +); |
42 | 46 | |
43 | 47 | # String. The default geocoding service, which will be used when no service is provided by the user. |
44 | 48 | # This service needs to be enabled, if not, the first one from the available services will be taken. |
— | — | @@ -47,9 +51,10 @@ |
48 | 52 | |
49 | 53 | # Include the parser functions that should be loaded into Maps. |
50 | 54 | # Commenting or removing a parser functions will cause Maps to completely ignore it, and so improve performance. |
51 | | -include_once $egMapsDir . 'ParserFunctions/DisplayMap/Maps_DisplayMap.php'; // display_map |
52 | | -include_once $egMapsDir . 'ParserFunctions/DisplayPoint/Maps_DisplayPoint.php'; // display_point(s) |
53 | | -include_once $egMapsDir . 'ParserFunctions/Geocode/Maps_GeocodeFunctions.php'; // geocode, geocodelon, geocodelat |
| 55 | +include_once $egMapsDir . 'ParserFunctions/DisplayMap/Maps_DisplayMap.php'; // #display_map |
| 56 | +include_once $egMapsDir . 'ParserFunctions/DisplayPoint/Maps_DisplayPoint.php'; // #display_point(s) |
| 57 | +include_once $egMapsDir . 'ParserFunctions/Geocode/Maps_GeocodeFunctions.php'; // #geocode, #geocodelat, #geocodelon |
| 58 | +include_once $egMapsDir . 'ParserFunctions/Coordinates/Maps_Coordinates.php'; // #coordinates |
54 | 59 | |
55 | 60 | |
56 | 61 | |
— | — | @@ -57,9 +62,6 @@ |
58 | 63 | # Mapping services configuration |
59 | 64 | # Note: You can not use aliases in the settings. Use the main service names. |
60 | 65 | |
61 | | -# Initialization of the mapping services array. |
62 | | -$egMapsServices = array(); |
63 | | - |
64 | 66 | # Include the mapping services that should be loaded into Maps. |
65 | 67 | # Commenting or removing a mapping service will cause Maps to completely ignore it, and so improve performance. |
66 | 68 | include_once $egMapsDir . 'GoogleMaps/Maps_GoogleMaps.php'; // Google Maps |
— | — | @@ -70,7 +72,12 @@ |
71 | 73 | |
72 | 74 | # Array of String. Array containing all the mapping services that will be made available to the user. |
73 | 75 | # Currently Maps provides the following services: googlemaps, yahoomaps, openlayers |
74 | | -$egMapsAvailableServices = array( 'googlemaps2', 'googlemaps3', 'yahoomaps', 'openlayers' ); |
| 76 | +$egMapsAvailableServices = array( |
| 77 | + 'googlemaps2', |
| 78 | + 'googlemaps3', |
| 79 | + 'yahoomaps', |
| 80 | + 'openlayers' |
| 81 | +); |
75 | 82 | |
76 | 83 | # String. The default mapping service, which will be used when no default service is present in the |
77 | 84 | # $egMapsDefaultServices array for a certain feature. A service that supports all features is recommended. |
— | — | @@ -91,10 +98,6 @@ |
92 | 99 | |
93 | 100 | |
94 | 101 | |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | 102 | # General configuration |
100 | 103 | |
101 | 104 | # Boolean. Indicates if minified js files should be used where available. |
— | — | @@ -106,6 +109,13 @@ |
107 | 110 | |
108 | 111 | # Coordinate configuration |
109 | 112 | |
| 113 | +$egMapsAvailableCoordNotations = array( |
| 114 | + Maps_COORDS_FLOAT, |
| 115 | + Maps_COORDS_DMS, |
| 116 | + Maps_COORDS_DM, |
| 117 | + Maps_COORDS_DD |
| 118 | +); |
| 119 | + |
110 | 120 | # Enum. The default output format of coordinates. |
111 | 121 | # Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD |
112 | 122 | $egMapsCoordinateNotation = Maps_COORDS_FLOAT; |
— | — | @@ -117,6 +127,8 @@ |
118 | 128 | |
119 | 129 | |
120 | 130 | |
| 131 | + |
| 132 | + |
121 | 133 | # General map configuration |
122 | 134 | |
123 | 135 | # Integer or string. The default width and height of a map. These values will only be used when the user does not provide them. |
— | — | @@ -163,7 +175,12 @@ |
164 | 176 | $egMapsGoogleMapsZoom = 14; |
165 | 177 | |
166 | 178 | # Array of String. The Google Maps v2 default map types. This value will only be used when the user does not provide one. |
167 | | -$egMapsGoogleMapsTypes = array( 'normal', 'satellite', 'hybrid', 'physical' ); |
| 179 | +$egMapsGoogleMapsTypes = array( |
| 180 | + 'normal', |
| 181 | + 'satellite', |
| 182 | + 'hybrid', |
| 183 | + 'physical' |
| 184 | +); |
168 | 185 | |
169 | 186 | # String. The default map type. This value will only be used when the user does not provide one. |
170 | 187 | $egMapsGoogleMapsType = 'normal'; |
— | — | @@ -174,12 +191,22 @@ |
175 | 192 | |
176 | 193 | # Array of String. The default controls for Google Maps v2. This value will only be used when the user does not provide one. |
177 | 194 | # Available values: auto, large, small, large-original, small-original, zoom, type, type-menu, overview-map, scale, nav-label, overlays |
178 | | -$egMapsGMapControls = array( 'auto', 'scale', 'type', 'overlays' ); |
| 195 | +$egMapsGMapControls = array( |
| 196 | + 'auto', |
| 197 | + 'scale', |
| 198 | + 'type', |
| 199 | + 'overlays' |
| 200 | +); |
179 | 201 | |
180 | 202 | # Array. The default overlays for the Google Maps v2 overlays control, and whether they should be shown at pageload. |
181 | 203 | # This value will only be used when the user does not provide one. |
182 | 204 | # Available values: photos, videos, wikipedia, webcams |
183 | | -$egMapsGMapOverlays = array( 'photos', 'videos', 'wikipedia', 'webcams' ); |
| 205 | +$egMapsGMapOverlays = array( |
| 206 | + 'photos', |
| 207 | + 'videos', |
| 208 | + 'wikipedia', |
| 209 | + 'webcams' |
| 210 | +); |
184 | 211 | |
185 | 212 | |
186 | 213 | |
— | — | @@ -192,7 +219,12 @@ |
193 | 220 | $egMapsGMaps3Zoom = 14; |
194 | 221 | |
195 | 222 | # Array of String. The Google Maps v3 default map types. This value will only be used when the user does not provide one. |
196 | | -$egMapsGMaps3Types = array( 'roadmap', 'satellite', 'hybrid', 'terrain' ); |
| 223 | +$egMapsGMaps3Types = array( |
| 224 | + 'roadmap', |
| 225 | + 'satellite', |
| 226 | + 'hybrid', |
| 227 | + 'terrain' |
| 228 | +); |
197 | 229 | |
198 | 230 | # String. The default map type. This value will only be used when the user does not provide one. |
199 | 231 | $egMapsGMaps3Type = 'roadmap'; |
— | — | @@ -209,7 +241,11 @@ |
210 | 242 | $egMapsYahooMapsPrefix = 'map_yahoo'; |
211 | 243 | |
212 | 244 | # Array of String. The Google Maps default map types. This value will only be used when the user does not provide one. |
213 | | -$egMapsYahooMapsTypes = array( 'normal', 'satellite', 'hybrid' ); |
| 245 | +$egMapsYahooMapsTypes = array( |
| 246 | + 'normal', |
| 247 | + 'satellite', |
| 248 | + 'hybrid' |
| 249 | +); |
214 | 250 | |
215 | 251 | # String. The default map type. This value will only be used when the user does not provide one. |
216 | 252 | $egMapsYahooMapsType = 'normal'; |
— | — | @@ -223,7 +259,11 @@ |
224 | 260 | |
225 | 261 | # Array of String. The default controls for Yahoo! Maps. This value will only be used when the user does not provide one. |
226 | 262 | # Available values: type, pan, zoom, zoom-short, auto-zoom |
227 | | -$egMapsYMapControls = array( 'type', 'pan', 'auto-zoom' ); |
| 263 | +$egMapsYMapControls = array( |
| 264 | + 'type', |
| 265 | + 'pan', |
| 266 | + 'auto-zoom' |
| 267 | +); |
228 | 268 | |
229 | 269 | |
230 | 270 | |
— | — | @@ -237,11 +277,19 @@ |
238 | 278 | |
239 | 279 | # Array of String. The default controls for Open Layers. This value will only be used when the user does not provide one. |
240 | 280 | # Available values: layerswitcher, mouseposition, autopanzoom, panzoom, panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink |
241 | | -$egMapsOLControls = array( 'layerswitcher', 'mouseposition', 'autopanzoom', 'scaleline', 'navigation' ); |
| 281 | +$egMapsOLControls = array( |
| 282 | + 'layerswitcher', |
| 283 | + 'mouseposition', |
| 284 | + 'autopanzoom', |
| 285 | + 'scaleline', |
| 286 | + 'navigation' |
| 287 | +); |
242 | 288 | |
243 | 289 | # Array of String. The default layers for Open Layers. This value will only be used when the user does not provide one. |
244 | 290 | # Available values: google, bing, yahoo, openlayers, nasa |
245 | | -$egMapsOLLayers = array( 'openlayers-wms' ); |
| 291 | +$egMapsOLLayers = array( |
| 292 | + 'openlayers-wms' |
| 293 | +); |
246 | 294 | |
247 | 295 | # The difinitions for the layers that should be available for the user. |
248 | 296 | $egMapsOLAvailableLayers = array( |
— | — | @@ -291,7 +339,13 @@ |
292 | 340 | |
293 | 341 | # Array of String. The default controls for OSM maps. This value will only be used when the user does not provide one. |
294 | 342 | # Available values: layerswitcher, mouseposition, autopanzoom, panzoom, panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink |
295 | | -$egMapsOSMControls = array( 'layerswitcher', 'mouseposition', 'autopanzoom', 'scaleline', 'navigation' ); |
| 343 | +$egMapsOSMControls = array( |
| 344 | + 'layerswitcher', |
| 345 | + 'mouseposition', |
| 346 | + 'autopanzoom', |
| 347 | + 'scaleline', |
| 348 | + 'navigation' |
| 349 | +); |
296 | 350 | |
297 | 351 | # Boolean. Indicates whether you want to get a static map (image) or not. |
298 | 352 | # This value will only be used when the user does not provide one. |