Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -120,6 +120,7 @@ |
121 | 121 | |
122 | 122 | // Autoload the "includes/manipulations/" classes. |
123 | 123 | $manDir = $incDir . 'manipulations/'; |
| 124 | + $wgAutoloadClasses['MapsParamCoordSet'] = $manDir . 'Maps_ParamCoordSet.php'; |
124 | 125 | $wgAutoloadClasses['MapsParamService'] = $manDir . 'Maps_ParamService.php'; |
125 | 126 | |
126 | 127 | // Autoload the "includes/parserHooks/" classes. |
Index: trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * @since 0.7 |
8 | 8 | * |
9 | 9 | * @file Maps_ParamService.php |
10 | | - * @ingroup Validator |
| 10 | + * @ingroup Maps |
11 | 11 | * @ingroup ParameterManipulations |
12 | 12 | * |
13 | 13 | * @author Jeroen De Dauw |
Index: trunk/extensions/Maps/includes/Maps_Mapper.php |
— | — | @@ -13,33 +13,6 @@ |
14 | 14 | final class MapsMapper { |
15 | 15 | |
16 | 16 | /** |
17 | | - * Formats a location to a coordinate set in a certain representation. |
18 | | - * |
19 | | - * @since 0.6 |
20 | | - * |
21 | | - * @param string $locations |
22 | | - * @param string $name The name of the parameter. |
23 | | - * @param array $parameters Array containing data about the so far handled parameters. |
24 | | - */ |
25 | | - public static function formatLocation( &$location, $name, array $parameters ) { |
26 | | - if ( self::geocoderIsAvailable() ) { |
27 | | - // TODO |
28 | | - //$geoService = array_key_exists( 'geoservice', $parameters ) ? $parameters['geoservice']['value'] : ''; |
29 | | - //$mappingService = array_key_exists( 'mappingservice', $parameters ) ? $parameters['mappingservice']['value'] : false; |
30 | | - $location = MapsGeocoders::attemptToGeocodeToString( $location/*, $geoService, $mappingService*/ ); |
31 | | - } else { |
32 | | - $location = MapsCoordinateParser::parseAndFormat( $location ); |
33 | | - } |
34 | | - } |
35 | | - |
36 | | - /** |
37 | | - * @deprecated Method moved to MapsMappingServices. Will be removed in 0.7. |
38 | | - */ |
39 | | - public static function getValidService( $service, $feature ) { |
40 | | - MapsMappingServices::getValidServiceInstance( $service, $feature ); |
41 | | - } |
42 | | - |
43 | | - /** |
44 | 17 | * Determines if a value is a valid map dimension, and optionally corrects it. |
45 | 18 | * |
46 | 19 | * @since 0.6 |
— | — | @@ -116,17 +89,6 @@ |
117 | 90 | public static function setMapDimension( &$value, $name, array $parameters, $dimension, $default ) { |
118 | 91 | self::isMapDimension( $value, $name, $parameters, $dimension, true, $default ); |
119 | 92 | } |
120 | | - |
121 | | - /** |
122 | | - * Returns a boolean indicating if MapsGeocoders is available. |
123 | | - * |
124 | | - * @deprecated - use MapsGeocoders::canGeocode() instead |
125 | | - * |
126 | | - * @return Boolean |
127 | | - */ |
128 | | - public static function geocoderIsAvailable() { |
129 | | - return MapsGeocoders::canGeocode(); |
130 | | - } |
131 | 93 | |
132 | 94 | /** |
133 | 95 | * Add a JavaScript file out of skins/common, or a given relative path. |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php |
— | — | @@ -139,7 +139,7 @@ |
140 | 140 | * @return string |
141 | 141 | */ |
142 | 142 | public function render( array $parameters ) { |
143 | | - $canGeocode = MapsMapper::geocoderIsAvailable(); |
| 143 | + $canGeocode = MapsGeocoders::canGeocode(); |
144 | 144 | |
145 | 145 | if ( $canGeocode ) { |
146 | 146 | $location = MapsGeocoders::attemptToGeocode( |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php |
— | — | @@ -63,21 +63,12 @@ |
64 | 64 | |
65 | 65 | $params['mappingservice']->default = $egMapsDefaultServices['display_map']; |
66 | 66 | |
67 | | - $params['coordinates'] = new Parameter( |
68 | | - 'coordinates', |
69 | | - Parameter::TYPE_STRING, |
70 | | - null, |
71 | | - array( 'coords', 'location', 'address' ), |
72 | | - array( |
73 | | - new CriterionIsLocation(), |
74 | | - ) |
75 | | - ); |
76 | | - |
| 67 | + $params['coordinates'] = new Parameter( 'coordinates' ); |
| 68 | + $params['coordinates']->addAliases( 'coords', 'location', 'address' ); |
| 69 | + $params['coordinates']->addCriteria( new CriterionIsLocation() ); |
| 70 | + $params['coordinates']->addManipulations( new MapsParamCoordSet() ); |
77 | 71 | $params['coordinates']->lowerCaseValue = false; |
78 | 72 | |
79 | | - // TODO |
80 | | - $params['coordinates']->outputTypes = array( 'coordinateSet' => array( 'coordinateSet' ) ); |
81 | | - |
82 | 73 | return $params; |
83 | 74 | } |
84 | 75 | |