Index: branches/Maps0.8/Maps_Settings.php |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | # Commenting or removing a mapping service will make Maps completely ignore it, and so improve performance. |
85 | 85 | |
86 | 86 | # Google Maps API v2 |
87 | | - // include_once $egMapsDir . 'includes/services/GoogleMaps/GoogleMaps.php'; |
| 87 | + include_once $egMapsDir . 'includes/services/GoogleMaps/GoogleMaps.php'; |
88 | 88 | |
89 | 89 | # Google Maps API v3 |
90 | 90 | include_once $egMapsDir . 'includes/services/GoogleMaps3/GoogleMaps3.php'; |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | |
101 | 101 | # Array of String. Array containing all the mapping services that will be made available to the user. |
102 | 102 | $egMapsAvailableServices = array( |
103 | | - //'googlemaps2', |
| 103 | + 'googlemaps2', |
104 | 104 | 'googlemaps3', |
105 | 105 | //'yahoomaps', |
106 | 106 | 'openlayers', |
Index: branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3DispPoint.php |
— | — | @@ -1,27 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Class for handling the display_point(s) parser functions with Google Maps v3. |
6 | | - * |
7 | | - * @file Maps_GoogleMaps3DispPoint.php |
8 | | - * @ingroup MapsGoogleMaps3 |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | -final class MapsGoogleMaps3DispPoint extends MapsBasePointMap { |
13 | | - |
14 | | - /** |
15 | | - * @see MapsBasePointMap::getMapHTML() |
16 | | - */ |
17 | | - public function getMapHTML( array $params, Parser $parser, $mapName ) { |
18 | | - return Html::element( |
19 | | - 'div', |
20 | | - array( |
21 | | - 'id' => $mapName, |
22 | | - 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
23 | | - ), |
24 | | - wfMsg( 'maps-loading-map' ) |
25 | | - ); |
26 | | - } |
27 | | - |
28 | | -} |
Index: branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php |
— | — | @@ -1,26 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Class for handling the display_map parser hook with Google Maps v3. |
6 | | - * |
7 | | - * @ingroup MapsGoogleMaps3 |
8 | | - * |
9 | | - * @author Jeroen De Dauw |
10 | | - */ |
11 | | -final class MapsGoogleMaps3DispMap extends MapsBaseMap { |
12 | | - |
13 | | - /** |
14 | | - * @see MapsBaseMap::getMapHTML() |
15 | | - */ |
16 | | - public function getMapHTML( array $params, Parser $parser, $mapName ) { |
17 | | - return Html::element( |
18 | | - 'div', |
19 | | - array( |
20 | | - 'id' => $mapName, |
21 | | - 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
22 | | - ), |
23 | | - wfMsg( 'maps-loading-map' ) |
24 | | - ); |
25 | | - } |
26 | | - |
27 | | -} |
Index: branches/Maps0.8/includes/services/GoogleMaps3/GoogleMaps3.php |
— | — | @@ -51,16 +51,14 @@ |
52 | 52 | global $wgAutoloadClasses; |
53 | 53 | |
54 | 54 | $wgAutoloadClasses['MapsGoogleMaps3'] = dirname( __FILE__ ) . '/Maps_GoogleMaps3.php'; |
55 | | - $wgAutoloadClasses['MapsGoogleMaps3DispMap'] = dirname( __FILE__ ) . '/Maps_GoogleMaps3DispMap.php'; |
56 | | - $wgAutoloadClasses['MapsGoogleMaps3DispPoint'] = dirname( __FILE__ ) . '/Maps_GoogleMaps3DispPoint.php'; |
57 | 55 | $wgAutoloadClasses['MapsParamGMap3Type'] = dirname( __FILE__ ) . '/Maps_ParamGMap3Type.php'; |
58 | 56 | $wgAutoloadClasses['MapsParamGMap3Typestyle'] = dirname( __FILE__ ) . '/Maps_ParamGMap3Typestyle.php'; |
59 | 57 | $wgAutoloadClasses['MapsParamGMap3Zoomstyle'] = dirname( __FILE__ ) . '/Maps_ParamGMap3Zoomstyle.php'; |
60 | 58 | |
61 | 59 | MapsMappingServices::registerService( 'googlemaps3', 'MapsGoogleMaps3' ); |
62 | 60 | $googleMaps = MapsMappingServices::getServiceInstance( 'googlemaps3' ); |
63 | | - $googleMaps->addFeature( 'display_map', 'MapsGoogleMaps3DispMap' ); |
64 | | - $googleMaps->addFeature( 'display_point', 'MapsGoogleMaps3DispPoint' ); |
| 61 | + $googleMaps->addFeature( 'display_map', 'MapsBaseMap' ); |
| 62 | + $googleMaps->addFeature( 'display_point', 'MapsBasePointMap' ); |
65 | 63 | |
66 | 64 | return true; |
67 | 65 | } |
\ No newline at end of file |
Index: branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMapsDispPoint.php |
— | — | @@ -1,27 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Class for handling the display_point(s) parser functions with Yahoo! Maps. |
6 | | - * |
7 | | - * @file Maps_YahooMapsDispPoint.php |
8 | | - * @ingroup MapsYahooMaps |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | -class MapsYahooMapsDispPoint extends MapsBasePointMap { |
13 | | - |
14 | | - /** |
15 | | - * @see MapsBasePointMap::getMapHTML() |
16 | | - */ |
17 | | - public function getMapHTML( array $params, Parser $parser, $mapName ) { |
18 | | - return Html::element( |
19 | | - 'div', |
20 | | - array( |
21 | | - 'id' => $mapName, |
22 | | - 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
23 | | - ), |
24 | | - wfMsg( 'maps-loading-map' ) |
25 | | - ); |
26 | | - } |
27 | | - |
28 | | -} |
Index: branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMapsDispMap.php |
— | — | @@ -1,27 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Class for handling the display_map parser hook with Yahoo! Maps |
6 | | - * |
7 | | - * @file Maps_YahooMapsDispMap.php |
8 | | - * @ingroup MapsYahooMaps |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | -class MapsYahooMapsDispMap extends MapsBaseMap { |
13 | | - |
14 | | - /** |
15 | | - * @see MapsBaseMap::getMapHTML() |
16 | | - */ |
17 | | - public function getMapHTML( array $params, Parser $parser, $mapName ) { |
18 | | - return Html::element( |
19 | | - 'div', |
20 | | - array( |
21 | | - 'id' => $mapName, |
22 | | - 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
23 | | - ), |
24 | | - wfMsg( 'maps-loading-map' ) |
25 | | - ); |
26 | | - } |
27 | | - |
28 | | -} |
\ No newline at end of file |
Index: branches/Maps0.8/includes/services/YahooMaps/YahooMaps.php |
— | — | @@ -27,15 +27,13 @@ |
28 | 28 | |
29 | 29 | $wgAutoloadClasses['MapsParamYMapType'] = dirname( __FILE__ ) . '/Maps_ParamYMapType.php'; |
30 | 30 | $wgAutoloadClasses['MapsYahooMaps'] = dirname( __FILE__ ) . '/Maps_YahooMaps.php'; |
31 | | - $wgAutoloadClasses['MapsYahooMapsDispMap'] = dirname( __FILE__ ) . '/Maps_YahooMapsDispMap.php'; |
32 | | - $wgAutoloadClasses['MapsYahooMapsDispPoint'] = dirname( __FILE__ ) . '/Maps_YahooMapsDispPoint.php'; |
33 | 31 | |
34 | 32 | MapsMappingServices::registerService( |
35 | 33 | 'yahoomaps', |
36 | 34 | 'MapsYahooMaps', |
37 | 35 | array( |
38 | | - 'display_point' => 'MapsYahooMapsDispPoint', |
39 | | - 'display_map' => 'MapsYahooMapsDispMap' |
| 36 | + 'display_point' => 'MapsBasePointMap', |
| 37 | + 'display_map' => 'MapsBaseMap' |
40 | 38 | ) |
41 | 39 | ); |
42 | 40 | |
Index: branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php |
— | — | @@ -1,27 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Class for handling the display_point(s) parser functions with OpenLayers. |
6 | | - * |
7 | | - * @file Maps_OpenLayersDispPoint.php |
8 | | - * @ingroup MapsOpenLayers |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | -class MapsOpenLayersDispPoint extends MapsBasePointMap { |
13 | | - |
14 | | - /** |
15 | | - * @see MapsBasePointMap::getMapHTML() |
16 | | - */ |
17 | | - public function getMapHTML( array $params, Parser $parser, $mapName ) { |
18 | | - return Html::element( |
19 | | - 'div', |
20 | | - array( |
21 | | - 'id' => $mapName, |
22 | | - 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
23 | | - ), |
24 | | - wfMsg( 'maps-loading-map' ) |
25 | | - ); |
26 | | - } |
27 | | - |
28 | | -} |
Index: branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayersDispMap.php |
— | — | @@ -1,44 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Class for handling the display_map parser hook with OpenLayers. |
6 | | - * |
7 | | - * @file Maps_OpenLayersDispMap.php |
8 | | - * @ingroup MapsOpenLayers |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | -class MapsOpenLayersDispMap extends MapsBaseMap { |
13 | | - |
14 | | - /** |
15 | | - * @see MapsBaseMap::getJSONObject |
16 | | - * |
17 | | - * @since 0.7.3 |
18 | | - * |
19 | | - * @param array $params |
20 | | - * @param Parser $parser |
21 | | - * |
22 | | - * @return mixed |
23 | | - */ |
24 | | - protected function getJSONObject( array $params, Parser $parser ) { |
25 | | - global $wgLang; |
26 | | - $params['langCode'] = $wgLang->getCode(); |
27 | | - $params['mapId'] = $this->service->getMapId( false ); |
28 | | - return $params; |
29 | | - } |
30 | | - |
31 | | - /** |
32 | | - * @see MapsBaseMap::getMapHTML |
33 | | - */ |
34 | | - public function getMapHTML( array $params, Parser $parser, $mapName ) { |
35 | | - return Html::element( |
36 | | - 'div', |
37 | | - array( |
38 | | - 'id' => $mapName, |
39 | | - 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
40 | | - ), |
41 | | - wfMsg( 'maps-loading-map' ) |
42 | | - ); |
43 | | - } |
44 | | - |
45 | | -} |
Index: branches/Maps0.8/includes/services/OpenLayers/OpenLayers.php |
— | — | @@ -40,15 +40,13 @@ |
41 | 41 | |
42 | 42 | $wgAutoloadClasses['CriterionOLLayer'] = dirname( __FILE__ ) . '/CriterionOLLayer.php'; |
43 | 43 | $wgAutoloadClasses['MapsOpenLayers'] = dirname( __FILE__ ) . '/Maps_OpenLayers.php'; |
44 | | -$wgAutoloadClasses['MapsOpenLayersDispMap'] = dirname( __FILE__ ) . '/Maps_OpenLayersDispMap.php'; |
45 | | -$wgAutoloadClasses['MapsOpenLayersDispPoint'] = dirname( __FILE__ ) . '/Maps_OpenLayersDispPoint.php'; |
46 | 44 | $wgAutoloadClasses['MapsParamOLLayers'] = dirname( __FILE__ ) . '/Maps_ParamOLLayers.php'; |
47 | 45 | |
48 | 46 | MapsMappingServices::registerService( |
49 | 47 | 'openlayers', |
50 | 48 | 'MapsOpenLayers', |
51 | 49 | array( |
52 | | - 'display_point' => 'MapsOpenLayersDispPoint', |
53 | | - 'display_map' => 'MapsOpenLayersDispMap' |
| 50 | + 'display_point' => 'MapsBasePointMap', |
| 51 | + 'display_map' => 'MapsBaseMap' |
54 | 52 | ) |
55 | 53 | ); |
Index: branches/Maps0.8/includes/features/Maps_BasePointMap.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | * |
12 | 12 | * @author Jeroen De Dauw |
13 | 13 | */ |
14 | | -abstract class MapsBasePointMap { |
| 14 | +class MapsBasePointMap { |
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @var iMappingService |
— | — | @@ -19,19 +19,6 @@ |
20 | 20 | |
21 | 21 | protected $markerData = array(); |
22 | 22 | |
23 | | - /** |
24 | | - * Returns the HTML to display the map. |
25 | | - * |
26 | | - * @since 0.8 |
27 | | - * |
28 | | - * @param array $params |
29 | | - * @param Parser $parser |
30 | | - * @param string $mapName |
31 | | - * |
32 | | - * @return string |
33 | | - */ |
34 | | - protected abstract function getMapHTML( array $params, Parser $parser, $mapName ); |
35 | | - |
36 | 23 | public function __construct( iMappingService $service ) { |
37 | 24 | $this->service = $service; |
38 | 25 | } |
— | — | @@ -89,6 +76,28 @@ |
90 | 77 | } |
91 | 78 | |
92 | 79 | /** |
| 80 | + * Returns the HTML to display the map. |
| 81 | + * |
| 82 | + * @since 0.8 |
| 83 | + * |
| 84 | + * @param array $params |
| 85 | + * @param Parser $parser |
| 86 | + * @param string $mapName |
| 87 | + * |
| 88 | + * @return string |
| 89 | + */ |
| 90 | + protected function getMapHTML( array $params, Parser $parser, $mapName ) { |
| 91 | + return Html::element( |
| 92 | + 'div', |
| 93 | + array( |
| 94 | + 'id' => $mapName, |
| 95 | + 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
| 96 | + ), |
| 97 | + wfMsg( 'maps-loading-map' ) |
| 98 | + ); |
| 99 | + } |
| 100 | + |
| 101 | + /** |
93 | 102 | * Returns the JSON with the maps data. |
94 | 103 | * |
95 | 104 | * @since 0.8 |
Index: branches/Maps0.8/includes/features/Maps_BaseMap.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | * |
12 | 12 | * @author Jeroen De Dauw |
13 | 13 | */ |
14 | | -abstract class MapsBaseMap { |
| 14 | +class MapsBaseMap { |
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @since 0.6.x |
— | — | @@ -27,19 +27,6 @@ |
28 | 28 | protected $properties = array(); |
29 | 29 | |
30 | 30 | /** |
31 | | - * Returns the HTML to display the map. |
32 | | - * |
33 | | - * @since 0.8 |
34 | | - * |
35 | | - * @param array $params |
36 | | - * @param Parser $parser |
37 | | - * @param string $mapName |
38 | | - * |
39 | | - * @return string |
40 | | - */ |
41 | | - protected abstract function getMapHTML( array $params, Parser $parser, $mapName ); |
42 | | - |
43 | | - /** |
44 | 31 | * Constructor. |
45 | 32 | * |
46 | 33 | * @param MapsMappingService $service |
— | — | @@ -91,6 +78,28 @@ |
92 | 79 | } |
93 | 80 | |
94 | 81 | /** |
| 82 | + * Returns the HTML to display the map. |
| 83 | + * |
| 84 | + * @since 0.8 |
| 85 | + * |
| 86 | + * @param array $params |
| 87 | + * @param Parser $parser |
| 88 | + * @param string $mapName |
| 89 | + * |
| 90 | + * @return string |
| 91 | + */ |
| 92 | + protected function getMapHTML( array $params, Parser $parser, $mapName ) { |
| 93 | + return Html::element( |
| 94 | + 'div', |
| 95 | + array( |
| 96 | + 'id' => $mapName, |
| 97 | + 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
| 98 | + ), |
| 99 | + wfMsg( 'maps-loading-map' ) |
| 100 | + ); |
| 101 | + } |
| 102 | + |
| 103 | + /** |
95 | 104 | * Returns the JSON with the maps data. |
96 | 105 | * |
97 | 106 | * @since 0.7.3 |