Index: trunk/extensions/SemanticMaps/SemanticMaps.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | |
37 | 37 | // Only initialize the extension when all dependencies are present. |
38 | 38 | if ( defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' ) ) { |
39 | | - define( 'SM_VERSION', '0.6.4 a10' ); |
| 39 | + define( 'SM_VERSION', '0.6.4 a11' ); |
40 | 40 | |
41 | 41 | $useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath; |
42 | 42 | $smgScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/SemanticMaps'; |
Index: trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php |
— | — | @@ -315,10 +315,24 @@ |
316 | 316 | // Geocode and convert if required. |
317 | 317 | $centre = MapsGeocoder::attemptToGeocode( $this->centre, $this->geoservice, $this->mService->getName() ); |
318 | 318 | |
319 | | - $this->centreLat = $centre['lat']; |
320 | | - $this->centreLon = $centre['lon']; |
| 319 | + if ( $centre ) { |
| 320 | + $this->centreLat = $centre['lat']; |
| 321 | + $this->centreLon = $centre['lon']; |
| 322 | + } |
| 323 | + else { |
| 324 | + $this->setCentreDefault(); |
| 325 | + } |
321 | 326 | } |
322 | | - elseif ( count( $this->mLocations ) > 1 ) { |
| 327 | + else { |
| 328 | + $this->setCentreDefault(); |
| 329 | + } |
| 330 | + } |
| 331 | + |
| 332 | + /** |
| 333 | + * Figures out the default value for the centre. |
| 334 | + */ |
| 335 | + private function setCentreDefault() { |
| 336 | + if ( count( $this->mLocations ) > 1 ) { |
323 | 337 | // If centre is not set, and there are multiple points, set the values to null, to be auto determined by the JS of the mapping API. |
324 | 338 | $this->centreLat = 'null'; |
325 | 339 | $this->centreLon = 'null'; |
— | — | @@ -334,7 +348,7 @@ |
335 | 349 | |
336 | 350 | $this->centreLat = $egMapsMapLat; |
337 | 351 | $this->centreLon = $egMapsMapLon; |
338 | | - } |
| 352 | + } |
339 | 353 | } |
340 | 354 | |
341 | 355 | /** |