Index: trunk/extensions/Maps/ParserFunctions/Maps_ParserFunctions.php |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | 'in_array' => $egMapsAvailableServices |
65 | 65 | ), |
66 | 66 | 'default' => $egMapsDefaultService |
67 | | - ), |
| 67 | + ), |
68 | 68 | 'coordinates' => array( |
69 | 69 | 'aliases' => array('coords', 'location', 'locations'), |
70 | 70 | 'criteria' => array( |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | include_once('extensions/Validator/Validator.php'); |
30 | 30 | } |
31 | 31 | |
32 | | -define('Maps_VERSION', '0.5 a12'); |
| 32 | +define('Maps_VERSION', '0.5 a13'); |
33 | 33 | |
34 | 34 | $egMapsScriptPath = $wgScriptPath . '/extensions/Maps'; |
35 | 35 | $egMapsIP = $IP . '/extensions/Maps'; |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispMap.php |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | <script type='$wgJsMimeType'>slippymaps['$this->mapName'] = new slippymap_map('$this->mapName', { |
56 | 56 | mode: 'osm-wm', |
57 | 57 | layer: 'osm-like', |
58 | | - locale: 'en', |
| 58 | + locale: '$this->lang', |
59 | 59 | lat: $this->centre_lat, |
60 | 60 | lon: $this->centre_lon, |
61 | 61 | zoom: $this->zoom, |
Index: trunk/extensions/Maps/OpenStreetMap/OSMFunctions.js |
— | — | @@ -176,6 +176,7 @@ |
177 | 177 | return map; |
178 | 178 | } |
179 | 179 | |
| 180 | +/* |
180 | 181 | slippymap_map.prototype.resetPosition = function() { |
181 | 182 | this.map.setCenter(new OpenLayers.LonLat(this.lon, this.lat).transform(new OpenLayers.Projection('EPSG:4326'), this.map.getProjectionObject()), this.zoom); |
182 | 183 | } |
— | — | @@ -190,6 +191,7 @@ |
191 | 192 | "<slippymap lat=" + LL.lat + " lon=" + LL.lon + " zoom=" + Z + " width=" + size.w + " height=" + size.h + " mode=" + this.mode + " layer=" + this.layer + (this.marker == 0 ? "" : " marker=" + this.marker) + " />" |
192 | 193 | ); |
193 | 194 | } |
| 195 | +*/ |
194 | 196 | |
195 | 197 | function getOSMMarkerData(lon, lat, title, label, icon) { |
196 | 198 | lonLat = new OpenLayers.LonLat(lon, lat); |
— | — | @@ -201,6 +203,7 @@ |
202 | 204 | }; |
203 | 205 | } |
204 | 206 | |
| 207 | + |
205 | 208 | function getOSMMarker(markerLayer, markerData, projectionObject) { |
206 | 209 | var marker; |
207 | 210 | |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSM.php |
— | — | @@ -47,17 +47,25 @@ |
48 | 48 | } |
49 | 49 | |
50 | 50 | private static function initializeParams() { |
| 51 | + global $wgLang; |
51 | 52 | global $egMapsServices, $egMapsOSMZoom, $egMapsOSMControls; |
52 | 53 | |
53 | 54 | $egMapsServices[self::SERVICE_NAME]['parameters'] = array( |
54 | | - 'zoom' => array( |
55 | | - 'default' => $egMapsOSMZoom, |
56 | | - ), |
57 | | - 'controls' => array( |
58 | | - 'criteria' => array(), // TODO |
59 | | - 'default' => implode(',', $egMapsOSMControls) |
60 | | - ), |
61 | | - ); |
| 55 | + 'zoom' => array( |
| 56 | + 'default' => $egMapsOSMZoom, |
| 57 | + ), |
| 58 | + 'controls' => array( |
| 59 | + 'criteria' => array(), // TODO |
| 60 | + 'default' => implode(',', $egMapsOSMControls) |
| 61 | + ), |
| 62 | + 'lang' => array( |
| 63 | + 'aliases' => array('locale', 'language'), |
| 64 | + 'criteria' => array( |
| 65 | + 'in_array' => array_keys( Language::getLanguageNames( false ) ) |
| 66 | + ), |
| 67 | + 'default' => $wgLang->getCode() |
| 68 | + ), |
| 69 | + ); |
62 | 70 | } |
63 | 71 | |
64 | 72 | // TODO: create a modular system for this SlippyMap code |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispPoint.php |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | <script type='$wgJsMimeType'>slippymaps['$this->mapName'] = new slippymap_map('$this->mapName', { |
69 | 69 | mode: 'osm-wm', |
70 | 70 | layer: 'osm-like', |
71 | | - locale: 'en', |
| 71 | + locale: '$this->lang', |
72 | 72 | lat: $this->centre_lat, |
73 | 73 | lon: $this->centre_lon, |
74 | 74 | zoom: $this->zoom, |
— | — | @@ -75,7 +75,6 @@ |
76 | 76 | height: $this->height, |
77 | 77 | markers: [$this->markerString], |
78 | 78 | controls: [$controlItems] |
79 | | - |
80 | 79 | });</script> |
81 | 80 | |
82 | 81 | <!-- map div --> |
Index: trunk/extensions/Maps/Maps_Mapper.php |
— | — | @@ -22,13 +22,13 @@ |
23 | 23 | * @var array |
24 | 24 | */ |
25 | 25 | private static $mainParams; |
26 | | - |
| 26 | + |
27 | 27 | public static function initializeMainParams() { |
28 | 28 | global $egMapsAvailableServices, $egMapsDefaultService, $egMapsAvailableGeoServices, $egMapsDefaultGeoService, $egMapsDefaultCentre; |
29 | 29 | global $egMapsSizeRestrictions, $egMapsMapWidth, $egMapsMapHeight, $egMapsDefaultTitle, $egMapsDefaultLabel; |
30 | | - |
| 30 | + |
31 | 31 | self::$mainParams = array |
32 | | - ( |
| 32 | + ( |
33 | 33 | 'zoom' => array( |
34 | 34 | 'aliases' => array(), |
35 | 35 | 'criteria' => array( |
— | — | @@ -50,22 +50,15 @@ |
51 | 51 | 'is_numeric' => array(), |
52 | 52 | 'in_range' => $egMapsSizeRestrictions['height'] |
53 | 53 | ), |
54 | | - 'default' => $egMapsMapHeight |
| 54 | + 'default' => $egMapsMapHeight |
55 | 55 | ), |
56 | 56 | 'controls' => array( |
57 | 57 | 'aliases' => array(), |
58 | 58 | 'criteria' => array(), |
59 | | - ), |
60 | | - 'lang' => array( |
61 | | - 'aliases' => array('locale', 'language'), |
62 | | - 'criteria' => array( |
63 | | - 'not_empty' => array() |
64 | | - ), |
65 | | - 'default' => '' |
66 | | - ), |
| 59 | + ), |
67 | 60 | ); |
68 | | - } |
69 | | - |
| 61 | + } |
| 62 | + |
70 | 63 | /** |
71 | 64 | * Returns the main parameters array. |
72 | 65 | * |