Index: branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | $fatalError = $validator->hasFatalError(); |
63 | 63 | |
64 | 64 | if ( $fatalError === false ) { |
65 | | - $this->parameters = $validator->getParameters( false ); |
| 65 | + $this->parameters = $validator->getParameterValues(); |
66 | 66 | } |
67 | 67 | else { |
68 | 68 | $this->fatalErrorMsg = |
— | — | @@ -86,6 +86,7 @@ |
87 | 87 | $params = $this->parameters; |
88 | 88 | |
89 | 89 | $queryHandler = new SMQueryHandler( $res, $outputmode, $params ); |
| 90 | + //$queryHandler->setText( ); |
90 | 91 | |
91 | 92 | $this->handleMarkerData( $params, $queryHandler->getLocations() ); |
92 | 93 | |
— | — | @@ -178,7 +179,7 @@ |
179 | 180 | $iconUrl = MapsMapper::getImageUrl( $params['icon'] ); |
180 | 181 | $params['locations'] = array(); |
181 | 182 | |
182 | | - foreach ( array_merge( $params['coordinates'], $queryLocations ) as $location ) { |
| 183 | + foreach ( array_merge( $params['staticlocations'], $queryLocations ) as $location ) { |
183 | 184 | if ( $location->isValid() ) { |
184 | 185 | $jsonObj = $location->getJSONObject( $params['title'], $params['label'], $iconUrl ); |
185 | 186 | |
— | — | @@ -189,7 +190,7 @@ |
190 | 191 | } |
191 | 192 | } |
192 | 193 | |
193 | | - unset( $params['coordinates'] ); |
| 194 | + unset( $params['staticlocations'] ); |
194 | 195 | } |
195 | 196 | |
196 | 197 | /** |
Index: branches/SemanticMaps0.8/includes/queryprinters/SM_QueryHandler.php |
— | — | @@ -19,9 +19,35 @@ |
20 | 20 | |
21 | 21 | // TODO: add system to properly handle query parameters |
22 | 22 | public $template = false; |
| 23 | + |
| 24 | + /** |
| 25 | + * The global icon. |
| 26 | + * |
| 27 | + * @since 0.7.3 |
| 28 | + * |
| 29 | + * @var string |
| 30 | + */ |
23 | 31 | public $icon = ''; |
24 | 32 | |
25 | 33 | /** |
| 34 | + * The global text. |
| 35 | + * |
| 36 | + * @since 0.8 |
| 37 | + * |
| 38 | + * @var string |
| 39 | + */ |
| 40 | + public $text = ''; |
| 41 | + |
| 42 | + /** |
| 43 | + * The global title. |
| 44 | + * |
| 45 | + * @since 0.8 |
| 46 | + * |
| 47 | + * @var string |
| 48 | + */ |
| 49 | + public $title = ''; |
| 50 | + |
| 51 | + /** |
26 | 52 | * Make a separate link to the title or not? |
27 | 53 | * |
28 | 54 | * @since 0.7.3 |
— | — | @@ -66,6 +92,39 @@ |
67 | 93 | } |
68 | 94 | |
69 | 95 | /** |
| 96 | + * Sets the global icon. |
| 97 | + * |
| 98 | + * @since 0.8 |
| 99 | + * |
| 100 | + * @param string $icon |
| 101 | + */ |
| 102 | + public function setIcon( $icon ) { |
| 103 | + $this->icon = $icon; |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * Sets the global title. |
| 108 | + * |
| 109 | + * @since 0.8 |
| 110 | + * |
| 111 | + * @param string $title |
| 112 | + */ |
| 113 | + public function setTitle( $title ) { |
| 114 | + $this->title = $title; |
| 115 | + } |
| 116 | + |
| 117 | + /** |
| 118 | + * Sets the global text. |
| 119 | + * |
| 120 | + * @since 0.8 |
| 121 | + * |
| 122 | + * @param string $text |
| 123 | + */ |
| 124 | + public function setText( $text ) { |
| 125 | + $this->text = $text; |
| 126 | + } |
| 127 | + |
| 128 | + /** |
70 | 129 | * Gets the query result as a list of locations. |
71 | 130 | * |
72 | 131 | * @since 0.7.3 |
Index: branches/SemanticMaps0.8/includes/queryprinters/SM_KMLPrinter.php |
— | — | @@ -57,6 +57,9 @@ |
58 | 58 | protected function getParameterInfo() { |
59 | 59 | $params = array(); |
60 | 60 | |
| 61 | + $params[] = new Parameter( 'text' ); |
| 62 | + $params[] = new Parameter( 'title' ); |
| 63 | + |
61 | 64 | $params[] = new Parameter( 'linkabsolute', Parameter::TYPE_BOOLEAN, true ); |
62 | 65 | |
63 | 66 | $params['pagelinktext'] = new Parameter( 'pagelinktext', Parameter::TYPE_STRING, wfMsg( 'semanticmaps-default-kml-pagelink' ) ); |
— | — | @@ -77,10 +80,11 @@ |
78 | 81 | */ |
79 | 82 | protected function getKML( SMWQueryResult $res, $outputmode, array $params ) { |
80 | 83 | $queryHandler = new SMQueryHandler( $res, $outputmode, $params['linkabsolute'], $params['pagelinktext'], false ); |
81 | | - $locations = $queryHandler->getLocations(); |
| 84 | + $queryHandler->setText( $params['text'] ); |
| 85 | + $queryHandler->setTitle( $params['title'] ); |
82 | 86 | |
83 | 87 | $formatter = new MapsKMLFormatter( $params ); |
84 | | - $formatter->addPlacemarks( $locations ); |
| 88 | + $formatter->addPlacemarks( $queryHandler->getLocations() ); |
85 | 89 | |
86 | 90 | return $formatter->getKML(); |
87 | 91 | } |