Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_QueryPrinters.php |
— | — | @@ -64,6 +64,12 @@ |
65 | 65 | 'aliases' => array('center'), |
66 | 66 | 'default' => $egMapsDefaultCentre |
67 | 67 | ), |
| 68 | + 'forceshow' => array( |
| 69 | + 'type' => 'boolean', |
| 70 | + 'aliases' => array('force show'), |
| 71 | + 'default' => false, |
| 72 | + 'output-type' => 'boolean' |
| 73 | + ), |
68 | 74 | 'limit' => array(), |
69 | 75 | 'headers' => array(), |
70 | 76 | 'mainlabel' => array(), |
Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_MapPrinter.php |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | |
80 | 80 | if (self::manageMapProperties($this->m_params, __CLASS__)) { |
81 | 81 | // Only create a map when there is at least one result. |
82 | | - if (count($this->m_locations) > 0) { |
| 82 | + if (count($this->m_locations) > 0 || $this->forceshow) { |
83 | 83 | $this->doMapServiceLoad(); |
84 | 84 | |
85 | 85 | $this->setMapName(); |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | $this->addSpecificMapHTML(); |
92 | 92 | } |
93 | 93 | else { |
94 | | - // TODO: add warning when level high enough and append to erro list. |
| 94 | + // TODO: add warning when level high enough and append to error list? |
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | $parameterInfo = array_merge($parameterInfo, $egMapsServices[$this->serviceName]['parameters']); |
121 | 121 | $parameterInfo = array_merge($parameterInfo, $this->spesificParameters); |
122 | 122 | |
123 | | - $manager = new ValidatorManager(); // TODO |
| 123 | + $manager = new ValidatorManager(); |
124 | 124 | |
125 | 125 | $result = $manager->manageMapparameters($mapProperties, $parameterInfo); |
126 | 126 | |
— | — | @@ -276,25 +276,33 @@ |
277 | 277 | * |
278 | 278 | */ |
279 | 279 | private function setCentre() { |
280 | | - // If a centre value is set, use it. |
281 | | - if (strlen($this->centre) > 0) { |
282 | | - // Geocode and convert if required. |
283 | | - $centre = MapsGeocodeUtils::attemptToGeocode($this->centre, $this->geoservice, $this->serviceName); |
284 | | - $centre = MapsUtils::getLatLon($centre); |
285 | | - |
286 | | - $this->centre_lat = $centre['lat']; |
287 | | - $this->centre_lon = $centre['lon']; |
| 280 | + // If there are no results, centre on the default coordinates. |
| 281 | + if ( count($this->m_locations) < 1 ) { |
| 282 | + global $egMapsMapLat, $egMapsMapLon; |
| 283 | + $this->centre_lat = $egMapsMapLat; |
| 284 | + $this->centre_lon = $egMapsMapLon; |
288 | 285 | } |
289 | | - elseif (count($this->m_locations) > 1) { |
290 | | - // 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. |
291 | | - $this->centre_lat = 'null'; |
292 | | - $this->centre_lon = 'null'; |
293 | | - } |
294 | 286 | else { |
295 | | - // If centre is not set and there is exactelly one marker, use it's coordinates. |
296 | | - $this->centre_lat = $this->m_locations[0][0]; |
297 | | - $this->centre_lon = $this->m_locations[0][1]; |
298 | | - } |
| 287 | + // If a centre value is set, use it. |
| 288 | + if (strlen($this->centre) > 0) { |
| 289 | + // Geocode and convert if required. |
| 290 | + $centre = MapsGeocodeUtils::attemptToGeocode($this->centre, $this->geoservice, $this->serviceName); |
| 291 | + $centre = MapsUtils::getLatLon($centre); |
| 292 | + |
| 293 | + $this->centre_lat = $centre['lat']; |
| 294 | + $this->centre_lon = $centre['lon']; |
| 295 | + } |
| 296 | + elseif (count($this->m_locations) > 1) { |
| 297 | + // 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. |
| 298 | + $this->centre_lat = 'null'; |
| 299 | + $this->centre_lon = 'null'; |
| 300 | + } |
| 301 | + else { |
| 302 | + // If centre is not set and there is exactelly one marker, use it's coordinates. |
| 303 | + $this->centre_lat = $this->m_locations[0][0]; |
| 304 | + $this->centre_lon = $this->m_locations[0][1]; |
| 305 | + } |
| 306 | + } |
299 | 307 | } |
300 | 308 | |
301 | 309 | /** |