Index: trunk/extensions/Maps/includes/services/GoogleMaps/GoogleMapFunctions.js |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | var GOverlays = [ |
14 | 14 | new GLayer("com.panoramio.all"), |
15 | 15 | new GLayer("com.youtube.all"), |
16 | | - new GLayer("org.wikipedia.en"), |
| 16 | + new GLayer("org.wikipedia.nl"), |
17 | 17 | new GLayer("com.google.webcams") |
18 | 18 | ]; |
19 | 19 | |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Coordinates.php |
— | — | @@ -118,14 +118,12 @@ |
119 | 119 | public function render( array $parameters ) { |
120 | 120 | $parsedCoords = MapsCoordinateParser::parseCoordinates( $parameters['location'] ); |
121 | 121 | |
122 | | - if ( $parsedCoords ) { |
123 | | - $output = MapsCoordinateParser::formatCoordinates( $parsedCoords, $parameters['format'], $parameters['directional'] ); |
124 | | - } else { |
| 122 | + if ( !$parsedCoords ) { |
125 | 123 | // The coordinates should be valid when this method gets called. |
126 | 124 | throw new Exception( 'Attempt to format an invalid set of coordinates' ); |
127 | 125 | } |
128 | 126 | |
129 | | - return $output; |
| 127 | + return MapsCoordinateParser::formatCoordinates( $parsedCoords, $parameters['format'], $parameters['directional'] ); |
130 | 128 | } |
131 | 129 | |
132 | 130 | /** |
— | — | @@ -137,4 +135,4 @@ |
138 | 136 | return wfMsg( 'maps-coordinates-description' ); |
139 | 137 | } |
140 | 138 | |
141 | | -} |
\ No newline at end of file |
| 139 | +} |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Distance.php |
— | — | @@ -106,8 +106,11 @@ |
107 | 107 | * @return string |
108 | 108 | */ |
109 | 109 | public function render( array $parameters ) { |
110 | | - $distanceInMeters = MapsDistanceParser::parseDistance( $parameters['distance'] ); |
111 | | - return MapsDistanceParser::formatDistance( $distanceInMeters, $parameters['unit'], $parameters['decimals'] ); |
| 110 | + return MapsDistanceParser::formatDistance( |
| 111 | + MapsDistanceParser::parseDistance( $parameters['distance'] ), |
| 112 | + $parameters['unit'], |
| 113 | + $parameters['decimals'] |
| 114 | + ); |
112 | 115 | } |
113 | 116 | |
114 | 117 | /** |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php |
— | — | @@ -163,20 +163,18 @@ |
164 | 164 | $location = MapsCoordinateParser::parseCoordinates( $parameters['location'] ); |
165 | 165 | } |
166 | 166 | |
167 | | - // TODO |
168 | | - if ( $location ) { |
169 | | - $destination = MapsGeoFunctions::findDestination( |
170 | | - $location, |
171 | | - $parameters['bearing'], |
172 | | - MapsDistanceParser::parseDistance( $parameters['distance'] ) |
173 | | - ); |
174 | | - $output = MapsCoordinateParser::formatCoordinates( $destination, $parameters['format'], $parameters['directional'] ); |
175 | | - } else { |
| 167 | + if ( !$location ) { |
176 | 168 | // The location should be valid when this method gets called. |
177 | | - throw new Exception( 'Attempt to find a destination from an invalid location' ); |
178 | | - } |
| 169 | + throw new Exception( 'Attempt to find a destination from an invalid location' ); |
| 170 | + } |
| 171 | + |
| 172 | + $destination = MapsGeoFunctions::findDestination( |
| 173 | + $location, |
| 174 | + $parameters['bearing'], |
| 175 | + MapsDistanceParser::parseDistance( $parameters['distance'] ) |
| 176 | + ); |
179 | 177 | |
180 | | - return $output; |
| 178 | + return MapsCoordinateParser::formatCoordinates( $destination, $parameters['format'], $parameters['directional'] ); |
181 | 179 | } |
182 | 180 | |
183 | 181 | /** |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Geocode.php |
— | — | @@ -151,13 +151,11 @@ |
152 | 152 | $parameters['directional'] |
153 | 153 | ); |
154 | 154 | |
155 | | - $output = $geovalues ? $geovalues : ''; |
| 155 | + return $geovalues ? $geovalues : ''; |
156 | 156 | } |
157 | 157 | else { |
158 | | - $output = htmlspecialchars( wfMsg( 'maps-geocoder-not-available' ) ); |
| 158 | + return htmlspecialchars( wfMsg( 'maps-geocoder-not-available' ) ); |
159 | 159 | } |
160 | | - |
161 | | - return $output; |
162 | 160 | } |
163 | 161 | |
164 | 162 | /** |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Geodistance.php |
— | — | @@ -159,14 +159,12 @@ |
160 | 160 | $end = MapsCoordinateParser::parseCoordinates( $parameters['location2'] ); |
161 | 161 | } |
162 | 162 | |
163 | | - if ( $start && $end ) { |
164 | | - $output = MapsDistanceParser::formatDistance( MapsGeoFunctions::calculateDistance( $start, $end ), $parameters['unit'], $parameters['decimals'] ); |
165 | | - } else { |
| 163 | + if ( !$start || !$end ) { |
166 | 164 | // The locations should be valid when this method gets called. |
167 | | - throw new Exception( 'Attempt to find the distance between locations of at least one is invalid' ); |
| 165 | + throw new Exception( 'Attempt to find the distance between locations of at least one is invalid' ); |
168 | 166 | } |
169 | 167 | |
170 | | - return $output; |
| 168 | + return MapsDistanceParser::formatDistance( MapsGeoFunctions::calculateDistance( $start, $end ), $parameters['unit'], $parameters['decimals'] ); |
171 | 169 | } |
172 | 170 | |
173 | 171 | /** |
— | — | @@ -178,4 +176,4 @@ |
179 | 177 | return wfMsg( 'maps-geodistance-description' ); |
180 | 178 | } |
181 | 179 | |
182 | | -} |
\ No newline at end of file |
| 180 | +} |