Index: trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispPoint.php |
— | — | @@ -1,32 +1,20 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * File holding the MapsGoogleMaps3DispPoint class. |
| 5 | + * Class for handling the display_point(s) parser functions with Google Maps v3. |
6 | 6 | * |
7 | 7 | * @file Maps_GoogleMaps3DispPoint.php |
8 | 8 | * @ingroup MapsGoogleMaps3 |
9 | 9 | * |
10 | 10 | * @author Jeroen De Dauw |
11 | 11 | */ |
12 | | - |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
14 | | - die( 'Not an entry point.' ); |
15 | | -} |
16 | | - |
17 | | -/** |
18 | | - * Class for handling the display_point(s) parser functions with Google Maps v3. |
19 | | - * |
20 | | - * @ingroup MapsGoogleMaps3 |
21 | | - * |
22 | | - * @author Jeroen De Dauw |
23 | | - */ |
24 | 12 | final class MapsGoogleMaps3DispPoint extends MapsBasePointMap { |
25 | 13 | |
26 | 14 | /** |
27 | 15 | * @see MapsBaseMap::addSpecificMapHTML |
28 | 16 | * |
29 | 17 | */ |
30 | | - public function addSpecificMapHTML() { |
| 18 | + public function addSpecificMapHTML( Parser $parser ) { |
31 | 19 | $mapName = $this->service->getMapId();; |
32 | 20 | |
33 | 21 | $this->output .= Html::element( |
— | — | @@ -38,7 +26,7 @@ |
39 | 27 | null |
40 | 28 | ); |
41 | 29 | |
42 | | - $this->parser->getOutput()->addHeadItem( |
| 30 | + $parser->getOutput()->addHeadItem( |
43 | 31 | Html::inlineScript( <<<EOT |
44 | 32 | addOnloadHook( |
45 | 33 | function() { |
Index: trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispPoint.php |
— | — | @@ -1,29 +1,19 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * File holding the MapsYahooMapsDispPoint class. |
| 5 | + * Class for handling the display_point(s) parser functions with Yahoo! Maps. |
6 | 6 | * |
7 | 7 | * @file Maps_YahooMapsDispPoint.php |
8 | 8 | * @ingroup MapsYahooMaps |
9 | 9 | * |
10 | 10 | * @author Jeroen De Dauw |
11 | 11 | */ |
12 | | - |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
14 | | - die( 'Not an entry point.' ); |
15 | | -} |
16 | | - |
17 | | -/** |
18 | | - * Class for handling the display_point(s) parser functions with Yahoo! Maps. |
19 | | - * |
20 | | - * @author Jeroen De Dauw |
21 | | - */ |
22 | 12 | class MapsYahooMapsDispPoint extends MapsBasePointMap { |
23 | 13 | |
24 | 14 | /** |
25 | 15 | * @see MapsBaseMap::addSpecificMapHTML |
26 | 16 | */ |
27 | | - public function addSpecificMapHTML() { |
| 17 | + public function addSpecificMapHTML( Parser $parser ) { |
28 | 18 | $mapName = $this->service->getMapId(); |
29 | 19 | |
30 | 20 | $this->output .= Html::element( |
— | — | @@ -35,7 +25,7 @@ |
36 | 26 | wfMsg( 'maps-loading-map' ) |
37 | 27 | ); |
38 | 28 | |
39 | | - $this->parser->getOutput()->addHeadItem( |
| 29 | + $parser->getOutput()->addHeadItem( |
40 | 30 | Html::inlineScript( <<<EOT |
41 | 31 | addOnloadHook( |
42 | 32 | function() { |
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php |
— | — | @@ -1,29 +1,19 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * File holding the MapsOpenLayersDispPoint class. |
| 5 | + * Class for handling the display_point(s) parser functions with OpenLayers. |
6 | 6 | * |
7 | 7 | * @file Maps_OpenLayersDispPoint.php |
8 | 8 | * @ingroup MapsOpenLayers |
9 | 9 | * |
10 | 10 | * @author Jeroen De Dauw |
11 | 11 | */ |
12 | | - |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
14 | | - die( 'Not an entry point.' ); |
15 | | -} |
16 | | - |
17 | | -/** |
18 | | - * Class for handling the display_point(s) parser functions with OpenLayers. |
19 | | - * |
20 | | - * @author Jeroen De Dauw |
21 | | - */ |
22 | 12 | class MapsOpenLayersDispPoint extends MapsBasePointMap { |
23 | 13 | |
24 | 14 | /** |
25 | 15 | * @see MapsBaseMap::addSpecificMapHTML |
26 | 16 | */ |
27 | | - public function addSpecificMapHTML() { |
| 17 | + public function addSpecificMapHTML( Parser $parser ) { |
28 | 18 | global $wgLang; |
29 | 19 | |
30 | 20 | $layerItems = $this->service->createLayersStringAndLoadDependencies( $this->layers ); |
— | — | @@ -41,7 +31,7 @@ |
42 | 32 | |
43 | 33 | $langCode = $wgLang->getCode(); |
44 | 34 | |
45 | | - $this->parser->getOutput()->addHeadItem( |
| 35 | + $parser->getOutput()->addHeadItem( |
46 | 36 | Html::inlineScript( <<<EOT |
47 | 37 | addOnloadHook( |
48 | 38 | function() { |
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispPoint.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | /** |
30 | 30 | * @see MapsBaseMap::addSpecificMapHTML |
31 | 31 | */ |
32 | | - public function addSpecificMapHTML() { |
| 32 | + public function addSpecificMapHTML( Parser $parser ) { |
33 | 33 | $mapName = $this->service->getMapId(); |
34 | 34 | |
35 | 35 | $this->service->addOverlayOutput( $this->output, $mapName, $this->overlays, $this->controls ); |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | wfMsg( 'maps-loading-map' ) |
44 | 44 | ); |
45 | 45 | |
46 | | - $this->parser->getOutput()->addHeadItem( |
| 46 | + $parser->getOutput()->addHeadItem( |
47 | 47 | Html::inlineScript( |
48 | 48 | <<<EOT |
49 | 49 | addOnloadHook( |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | * @return array |
86 | 86 | */ |
87 | 87 | protected function getParameterInfo() { |
88 | | - global $egMapsMapWidth, $egMapsMapHeight, $egMapsDefaultServices, $egMapsDefaultTitle, $egMapsDefaultLabel; |
| 88 | + global $egMapsMapWidth, $egMapsMapHeight, $egMapsDefaultServices, $egMapsDefaultTitle, $egMapsDefaultLabel, $egMapsDefaultMapCentre; |
89 | 89 | |
90 | 90 | // TODO |
91 | 91 | //Validator::addOutputFormat( 'geoPoints', array( __CLASS__, 'formatGeoPoints' ) ); |
— | — | @@ -164,18 +164,12 @@ |
165 | 165 | */ |
166 | 166 | public function render( array $parameters ) { |
167 | 167 | // Get the instance of the service class. |
168 | | - $service = MapsMappingServices::getValidServiceInstance( $parameters['mappingservice'], $this->getName() ); |
| 168 | + $service = MapsMappingServices::getServiceInstance( $parameters['mappingservice'], $this->getName() ); |
169 | 169 | |
170 | 170 | // Get an instance of the class handling the current parser hook and service. |
171 | 171 | $mapClass = $service->getFeatureInstance( $this->getName() ); |
172 | 172 | |
173 | | - if ( $mapClass === false ) { |
174 | | - return ''; // TODO |
175 | | - } |
176 | | - else { |
177 | | - return ''; // TODO |
178 | | - //return $mapClass->getMapHtml( $parameters ); |
179 | | - } |
| 173 | + return $mapClass->getMapHtml( $parameters, $this->parser ); |
180 | 174 | } |
181 | 175 | |
182 | 176 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/includes/features/Maps_BasePointMap.php |
— | — | @@ -77,25 +77,27 @@ |
78 | 78 | * mapping services, calling the specific methods and finally returning the resulting output. |
79 | 79 | * |
80 | 80 | * @param array $params |
| 81 | + * @param Parser $parser |
81 | 82 | * |
82 | 83 | * @return html |
83 | 84 | */ |
84 | | - public final function getMapHtml( array $params ) { |
| 85 | + public final function getMapHtml( array $params, Parser $parser ) { |
85 | 86 | $this->setMapProperties( $params ); |
86 | 87 | |
87 | 88 | $this->setMarkerData(); |
88 | 89 | |
89 | 90 | $this->setCentre(); |
90 | 91 | |
| 92 | + // TODO |
91 | 93 | if ( count( $this->markerData ) <= 1 && $this->zoom == 'null' ) { |
92 | 94 | $this->zoom = $this->service->getDefaultZoom(); |
93 | 95 | } |
94 | 96 | |
95 | 97 | $this->markerJs = $this->service->createMarkersJs( $this->markerData ); |
96 | 98 | |
97 | | - $this->addSpecificMapHTML(); |
| 99 | + $this->addSpecificMapHTML( $parser ); |
98 | 100 | |
99 | | - $this->service->addDependencies( $this->parser ); |
| 101 | + $this->service->addDependencies( $parser ); |
100 | 102 | |
101 | 103 | return $this->output; |
102 | 104 | } |
— | — | @@ -112,6 +114,7 @@ |
113 | 115 | $this->title = $parser->parse( $this->title, $wgTitle, new ParserOptions() )->getText(); |
114 | 116 | $this->label = $parser->parse( $this->label, $wgTitle, new ParserOptions() )->getText(); |
115 | 117 | |
| 118 | + /* TODO |
116 | 119 | // Each $args is an array containg the coordinate set as first element, possibly followed by meta data. |
117 | 120 | foreach ( $this->coordinates as $args ) { |
118 | 121 | $markerData = MapsCoordinateParser::parseCoordinates( array_shift( $args ) ); |
— | — | @@ -159,6 +162,7 @@ |
160 | 163 | |
161 | 164 | $this->markerData[] = $markerData; |
162 | 165 | } |
| 166 | + */ |
163 | 167 | } |
164 | 168 | |
165 | 169 | /** |