Index: trunk/extensions/Maps/GoogleMaps3/Maps_GoogleMaps3DispPoint.php |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | zoom: $this->zoom, |
71 | 71 | lat: $this->centre_lat, |
72 | 72 | lon: $this->centre_lon, |
73 | | - types: [$this->types], |
| 73 | + types: [], |
74 | 74 | mapTypeId: $this->type |
75 | 75 | }, |
76 | 76 | [$this->markerString] |
Index: trunk/extensions/Maps/GoogleMaps3/Maps_GoogleMaps3DispMap.php |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | zoom: $this->zoom, |
68 | 68 | lat: $this->centre_lat, |
69 | 69 | lon: $this->centre_lon, |
70 | | - types: [$this->types], |
| 70 | + types: [], |
71 | 71 | mapTypeId: $this->type |
72 | 72 | }, |
73 | 73 | [] |
Index: trunk/extensions/Maps/GoogleMaps3/Maps_GoogleMaps3.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | |
24 | 24 | $egMapsServices['googlemaps3'] = array( |
25 | 25 | 'pf' => array( |
26 | | - 'display_point' => array('class' => 'MapsGoogleMaps3DispPoint', 'file' => 'GoogleMaps3/Maps_GoogleMaps3DispPoint.php', 'local' => true), |
| 26 | + //'display_point' => array('class' => 'MapsGoogleMaps3DispPoint', 'file' => 'GoogleMaps3/Maps_GoogleMaps3DispPoint.php', 'local' => true), |
27 | 27 | 'display_map' => array('class' => 'MapsGoogleMaps3DispMap', 'file' => 'GoogleMaps3/Maps_GoogleMaps3DispMap.php', 'local' => true), |
28 | 28 | ), |
29 | 29 | 'classes' => array( |
Index: trunk/extensions/Maps/ParserFunctions/Maps_ParserFunctions.php |
— | — | @@ -117,8 +117,9 @@ |
118 | 118 | |
119 | 119 | if ($coords) { |
120 | 120 | if (! self::paramIsPresent('service', $map, $paramInfo)) $map['service'] = ''; |
121 | | - $map['service'] = MapsMapper::getValidService($map['service'], 'pf'); |
122 | | - |
| 121 | + |
| 122 | + $map['service'] = MapsMapper::getValidService($map['service'], 'pf', $parserFunction); |
| 123 | + |
123 | 124 | $mapClass = self::getParserClassInstance($map['service'], $parserFunction); |
124 | 125 | |
125 | 126 | // Call the function according to the map service to get the HTML output |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define('Maps_VERSION', '0.5.3 a5'); |
| 37 | + define('Maps_VERSION', '0.5.3 rc1'); |
38 | 38 | |
39 | 39 | $egMapsScriptPath = $wgScriptPath . '/extensions/Maps'; |
40 | 40 | $egMapsIP = $IP . '/extensions/Maps'; |
Index: trunk/extensions/Maps/Maps_Mapper.php |
— | — | @@ -68,19 +68,42 @@ |
69 | 69 | * |
70 | 70 | * @param string $service |
71 | 71 | * @param string $feature |
| 72 | + * @param string $subfeature |
72 | 73 | * |
73 | 74 | * @return string |
74 | 75 | */ |
75 | | - public static function getValidService($service, $feature) { |
| 76 | + public static function getValidService($service, $feature, $subfeature = '') { |
76 | 77 | global $egMapsAvailableServices, $egMapsDefaultService, $egMapsDefaultServices, $egMapsServices; |
77 | 78 | |
78 | 79 | $service = self::getMainServiceName($service); |
79 | 80 | |
80 | 81 | $shouldChange = ! array_key_exists($service, $egMapsServices); |
81 | | - if (! $shouldChange) $shouldChange = ! array_key_exists($feature, $egMapsServices[$service]); |
| 82 | + if (! $shouldChange) { |
| 83 | + if (array_key_exists($feature, $egMapsServices[$service])) { |
| 84 | + $shouldChange = is_array($egMapsServices[$service][$feature]) && !array_key_exists($subfeature, $egMapsServices[$service][$feature]); |
| 85 | + } |
| 86 | + else { |
| 87 | + $shouldChange = true; |
| 88 | + } |
| 89 | + } |
82 | 90 | |
83 | 91 | if ($shouldChange) { |
84 | | - $service = array_key_exists($feature, $egMapsDefaultServices) ? $egMapsDefaultServices[$feature] : $egMapsDefaultService; |
| 92 | + if (array_key_exists($feature, $egMapsDefaultServices)) { |
| 93 | + if (is_array($egMapsDefaultServices[$feature])) { |
| 94 | + if (array_key_exists($subfeature, $egMapsDefaultServices[$feature])) { |
| 95 | + $service = $egMapsDefaultServices[$feature][$subfeature]; |
| 96 | + } |
| 97 | + else { |
| 98 | + $service = $egMapsDefaultService; |
| 99 | + } |
| 100 | + } |
| 101 | + else { |
| 102 | + $service = $egMapsDefaultServices[$feature]; |
| 103 | + } |
| 104 | + } |
| 105 | + else { |
| 106 | + $service = $egMapsDefaultService; |
| 107 | + } |
85 | 108 | } |
86 | 109 | |
87 | 110 | if(! in_array($service, $egMapsAvailableServices)) $service = $egMapsDefaultService; |
Index: trunk/extensions/Maps/Maps_Settings.php |
— | — | @@ -79,7 +79,12 @@ |
80 | 80 | # Array of String. The default mapping service for each feature, which will be used when no valid service is provided by the user. |
81 | 81 | # Each service needs to be enabled, if not, the first one from the available services will be taken. |
82 | 82 | # Note: The default service needs to be available for the feature you set it for, since it's used as a fallback mechanism. |
83 | | -$egMapsDefaultServices = array('pf' => 'googlemaps2'); |
| 83 | +$egMapsDefaultServices = array( |
| 84 | + 'pf' => array( |
| 85 | + 'display_point' => 'googlemaps2', |
| 86 | + 'display_map' => 'googlemaps2' |
| 87 | + ) |
| 88 | +); |
84 | 89 | |
85 | 90 | |
86 | 91 | |