Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsQP.php |
— | — | @@ -14,6 +14,10 @@ |
15 | 15 | |
16 | 16 | final class SMYahooMapsQP extends SMMapPrinter { |
17 | 17 | |
| 18 | + protected function getServiceName() { |
| 19 | + return 'yahoomaps'; |
| 20 | + } |
| 21 | + |
18 | 22 | /** |
19 | 23 | * @see SMMapPrinter::setQueryPrinterSettings() |
20 | 24 | */ |
— | — | @@ -31,7 +35,7 @@ |
32 | 36 | protected function doMapServiceLoad() { |
33 | 37 | global $egYahooMapsOnThisPage, $wgParser; |
34 | 38 | |
35 | | - MapsYahooMaps::addYMapDependencies( $wgParser ); |
| 39 | + MapsYahooMaps::addDependencies( $wgParser ); |
36 | 40 | $egYahooMapsOnThisPage++; |
37 | 41 | |
38 | 42 | $this->elementNr = $egYahooMapsOnThisPage; |
Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFormInput.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | global $wgOut; |
40 | 40 | global $smgScriptPath, $smgYahooFormsOnThisPage, $smgStyleVersion, $egMapsJsExt; |
41 | 41 | |
42 | | - MapsYahooMaps::addYMapDependencies( $wgOut ); |
| 42 | + MapsYahooMaps::addDependencies( $wgOut ); |
43 | 43 | |
44 | 44 | if ( empty( $smgYahooFormsOnThisPage ) ) { |
45 | 45 | $smgYahooFormsOnThisPage = 0; |
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php |
— | — | @@ -15,6 +15,10 @@ |
16 | 16 | |
17 | 17 | final class SMOpenLayersQP extends SMMapPrinter { |
18 | 18 | |
| 19 | + protected function getServiceName() { |
| 20 | + return 'openlayers'; |
| 21 | + } |
| 22 | + |
19 | 23 | /** |
20 | 24 | * @see SMMapPrinter::setQueryPrinterSettings() |
21 | 25 | * |
— | — | @@ -33,7 +37,7 @@ |
34 | 38 | protected function doMapServiceLoad() { |
35 | 39 | global $wgParser, $egOpenLayersOnThisPage; |
36 | 40 | |
37 | | - MapsOpenLayers::addOLDependencies( $wgParser); |
| 41 | + MapsOpenLayers::addDependencies( $wgParser); |
38 | 42 | $egOpenLayersOnThisPage++; |
39 | 43 | |
40 | 44 | $this->elementNr = $egOpenLayersOnThisPage; |
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | global $wgOut; |
39 | 39 | global $smgScriptPath, $smgOLFormsOnThisPage, $smgStyleVersion, $egMapsJsExt; |
40 | 40 | |
41 | | - MapsOpenLayers::addOLDependencies( $wgOut ); |
| 41 | + MapsOpenLayers::addDependencies( $wgOut ); |
42 | 42 | |
43 | 43 | if ( empty( $smgOLFormsOnThisPage ) ) { |
44 | 44 | $smgOLFormsOnThisPage = 0; |
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsQP.php |
— | — | @@ -16,7 +16,9 @@ |
17 | 17 | |
18 | 18 | final class SMGoogleMapsQP extends SMMapPrinter { |
19 | 19 | |
20 | | - protected $specificParameters; |
| 20 | + protected function getServiceName() { |
| 21 | + return 'googlemaps'; |
| 22 | + } |
21 | 23 | |
22 | 24 | /** |
23 | 25 | * @see SMMapPrinter::setQueryPrinterSettings() |
— | — | @@ -47,7 +49,7 @@ |
48 | 50 | |
49 | 51 | if ( empty( $egGoogleMapsOnThisPage ) ) { |
50 | 52 | $egGoogleMapsOnThisPage = 0; |
51 | | - MapsGoogleMaps::addGMapDependencies( $wgParser ); |
| 53 | + MapsGoogleMaps::addDependencies( $wgParser ); |
52 | 54 | } |
53 | 55 | |
54 | 56 | $egGoogleMapsOnThisPage++; |
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsFormInput.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | global $wgOut; |
43 | 43 | global $smgScriptPath, $smgGoogleFormsOnThisPage, $smgStyleVersion, $egMapsJsExt; |
44 | 44 | |
45 | | - MapsGoogleMaps::addGMapDependencies( $wgOut ); |
| 45 | + MapsGoogleMaps::addDependencies( $wgOut ); |
46 | 46 | |
47 | 47 | if ( empty( $smgGoogleFormsOnThisPage ) ) { |
48 | 48 | $smgGoogleFormsOnThisPage = 0; |
Index: trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php |
— | — | @@ -38,6 +38,8 @@ |
39 | 39 | */ |
40 | 40 | protected abstract function doMapServiceLoad(); |
41 | 41 | |
| 42 | + protected abstract function getServiceName(); |
| 43 | + |
42 | 44 | /** |
43 | 45 | * Gets the query result |
44 | 46 | */ |
— | — | @@ -61,6 +63,12 @@ |
62 | 64 | protected $specificParameters = array(); |
63 | 65 | |
64 | 66 | public function __construct( $format, $inline, /* MapsMappingService */ $service = null ) { |
| 67 | + // TODO: this is a hack since I can't find a way to pass along the service object here when the QP is created in SMW. |
| 68 | + if ( $service == null ) { |
| 69 | + global $egMapsServices; |
| 70 | + $service = $egMapsServices[$this->getServiceName()]; |
| 71 | + } |
| 72 | + |
65 | 73 | $this->mService = $service; |
66 | 74 | } |
67 | 75 | |