Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php |
— | — | @@ -23,17 +23,6 @@ |
24 | 24 | final class MapsGoogleMapsDispMap extends MapsBaseMap { |
25 | 25 | |
26 | 26 | protected function initSpecificParamInfo( array &$parameters ) { |
27 | | - global $egMapsGMapOverlays; |
28 | | - |
29 | | - $parameters = array( |
30 | | - 'overlays' => array( |
31 | | - 'type' => array( 'string', 'list' ), |
32 | | - 'criteria' => array( |
33 | | - 'is_google_overlay' => array() |
34 | | - ), |
35 | | - 'default' => $egMapsGMapOverlays, |
36 | | - ), |
37 | | - ); |
38 | 27 | } |
39 | 28 | |
40 | 29 | /** |
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php |
— | — | @@ -26,6 +26,18 @@ |
27 | 27 | class MapsGoogleMaps extends MapsMappingService { |
28 | 28 | |
29 | 29 | /** |
| 30 | + * A list of supported overlays. |
| 31 | + * |
| 32 | + * @var array |
| 33 | + */ |
| 34 | + protected static $overlayData = array( |
| 35 | + 'photos' => '0', |
| 36 | + 'videos' => '1', |
| 37 | + 'wikipedia' => '2', |
| 38 | + 'webcams' => '3' |
| 39 | + ); |
| 40 | + |
| 41 | + /** |
30 | 42 | * Constructor. |
31 | 43 | * |
32 | 44 | * @since 0.6.6 |
— | — | @@ -48,9 +60,6 @@ |
49 | 61 | Validator::addOutputFormat( 'gmaptype', array( __CLASS__, 'setGMapType' ) ); |
50 | 62 | Validator::addOutputFormat( 'gmaptypes', array( __CLASS__, 'setGMapTypes' ) ); |
51 | 63 | |
52 | | - // TODO |
53 | | - //Validator::addValidationFunction( 'is_google_overlay', array( __CLASS__, 'isGOverlay' ) ); |
54 | | - |
55 | 64 | //$params['zoom']->addCriterion( new CriterionInRange( 0, 20 ) ); |
56 | 65 | //$params['zoom']->setDefault( self::getDefaultZoom() ); |
57 | 66 | |
— | — | @@ -113,7 +122,17 @@ |
114 | 123 | ); |
115 | 124 | |
116 | 125 | // TODO |
117 | | - $params['kml']->outputTypes = array( 'list' => array( 'list', ',', '\'' ) ); |
| 126 | + $params['kml']->outputTypes = array( 'list' => array( 'list', ',', '\'' ) ); |
| 127 | + |
| 128 | + $params['overlays'] = new ListParameter( |
| 129 | + 'overlays', |
| 130 | + ListParameter::DEFAULT_DELIMITER, |
| 131 | + Parameter::TYPE_STRING, |
| 132 | + $egMapsGMapOverlays, |
| 133 | + array( |
| 134 | + new CriterionGoogleOverlay( self::$overlayData ) |
| 135 | + ) |
| 136 | + ); |
118 | 137 | } |
119 | 138 | |
120 | 139 | /** |
— | — | @@ -186,18 +205,6 @@ |
187 | 206 | ); |
188 | 207 | |
189 | 208 | /** |
190 | | - * A list of supported overlays. |
191 | | - * |
192 | | - * @var array |
193 | | - */ |
194 | | - protected static $overlayData = array( |
195 | | - 'photos' => '0', |
196 | | - 'videos' => '1', |
197 | | - 'wikipedia' => '2', |
198 | | - 'webcams' => '3' |
199 | | - ); |
200 | | - |
201 | | - /** |
202 | 209 | * Returns the names of all supported map types. |
203 | 210 | * |
204 | 211 | * @return array |
— | — | @@ -234,29 +241,6 @@ |
235 | 242 | } |
236 | 243 | |
237 | 244 | /** |
238 | | - * Returns the names of all supported map overlays. |
239 | | - * |
240 | | - * @return array |
241 | | - */ |
242 | | - public static function getOverlayNames() { |
243 | | - return array_keys( self::$overlayData ); |
244 | | - } |
245 | | - |
246 | | - /** |
247 | | - * Returns whether the provided value is a valid google overlay. |
248 | | - * |
249 | | - * @param $value |
250 | | - * |
251 | | - * @return boolean |
252 | | - */ |
253 | | - public static function isGOverlay( $value, $name, array $parameters ) { |
254 | | - $value = explode( '-', $value ); |
255 | | - if ( count( $value ) > 2 ) return false; |
256 | | - if ( count( $value ) > 1 && !in_array( $value[1], array( '0', '1' ) ) ) return false; |
257 | | - return in_array( $value[0], self::getOverlayNames() ); |
258 | | - } |
259 | | - |
260 | | - /** |
261 | 245 | * Changes the map type name into the corresponding Google Maps API v2 identifier. |
262 | 246 | * |
263 | 247 | * @param string $type |
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispPoint.php |
— | — | @@ -23,17 +23,6 @@ |
24 | 24 | final class MapsGoogleMapsDispPoint extends MapsBasePointMap { |
25 | 25 | |
26 | 26 | protected function initSpecificParamInfo( array &$parameters ) { |
27 | | - global $egMapsGMapOverlays; |
28 | | - |
29 | | - $parameters = array( |
30 | | - 'overlays' => array( |
31 | | - 'type' => array( 'string', 'list' ), |
32 | | - 'criteria' => array( |
33 | | - 'is_google_overlay' => array() |
34 | | - ), |
35 | | - 'default' => $egMapsGMapOverlays, |
36 | | - ), |
37 | | - ); |
38 | 27 | } |
39 | 28 | |
40 | 29 | /** |