Index: branches/Maps0.8/Maps.php |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | // Autoload the "includes/manipulations/" classes. |
108 | 108 | $manDir = $incDir . 'manipulations/'; |
109 | 109 | $wgAutoloadClasses['MapsParamDimension'] = $manDir . 'Maps_ParamDimension.php'; |
110 | | -$wgAutoloadClasses['MapsParamImage'] = $manDir . 'Maps_ParamImage.php'; |
| 110 | +$wgAutoloadClasses['MapsParamFile'] = $manDir . 'Maps_ParamFile.php'; |
111 | 111 | $wgAutoloadClasses['MapsParamLocation'] = $manDir . 'Maps_ParamLocation.php'; |
112 | 112 | $wgAutoloadClasses['MapsParamService'] = $manDir . 'Maps_ParamService.php'; |
113 | 113 | $wgAutoloadClasses['MapsParamZoom'] = $manDir . 'Maps_ParamZoom.php'; |
— | — | @@ -194,7 +194,7 @@ |
195 | 195 | # Mapping services |
196 | 196 | |
197 | 197 | # Google Maps API v2 |
198 | | - // include_once $egMapsDir . 'includes/services/GoogleMaps/GoogleMaps.php'; |
| 198 | + include_once $egMapsDir . 'includes/services/GoogleMaps/GoogleMaps.php'; |
199 | 199 | |
200 | 200 | # Google Maps API v3 |
201 | 201 | include_once $egMapsDir . 'includes/services/GoogleMaps3/GoogleMaps3.php'; |
— | — | @@ -264,8 +264,7 @@ |
265 | 265 | 'name' => wfMsg( 'maps_name' ), |
266 | 266 | 'version' => Maps_VERSION, |
267 | 267 | 'author' => array( |
268 | | - '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]', |
269 | | - '[http://www.mediawiki.org/wiki/Extension:Maps/Credits ' . wfMsg( 'maps-others' ) . ']' |
| 268 | + '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]' |
270 | 269 | ), |
271 | 270 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Maps', |
272 | 271 | 'description' => wfMsgExt( 'maps_desc', 'parsemag', $servicesList ), |
Index: branches/Maps0.8/Maps_Settings.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | |
27 | 27 | # Array of String. Array containing all the mapping services that will be made available to the user. |
28 | 28 | $egMapsAvailableServices = array( |
29 | | - //'googlemaps2', |
| 29 | + 'googlemaps2', |
30 | 30 | 'googlemaps3', |
31 | 31 | 'yahoomaps', |
32 | 32 | 'openlayers', |
Index: branches/Maps0.8/includes/services/GoogleMaps/GoogleMaps.php |
— | — | @@ -62,8 +62,8 @@ |
63 | 63 | |
64 | 64 | MapsMappingServices::registerService( 'googlemaps2', 'MapsGoogleMaps' ); |
65 | 65 | $googleMaps = MapsMappingServices::getServiceInstance( 'googlemaps2' ); |
66 | | - $googleMaps->addFeature( 'display_point', 'MapsBasePointMaps' ); |
67 | | - $googleMaps->addFeature( 'display_map', 'MapsBaseMaps' ); |
| 66 | + $googleMaps->addFeature( 'display_point', 'MapsBasePointMap' ); |
| 67 | + $googleMaps->addFeature( 'display_map', 'MapsBaseMap' ); |
68 | 68 | |
69 | 69 | return true; |
70 | 70 | } |
Index: branches/Maps0.8/includes/services/GoogleMaps/Maps_GoogleMaps.php |
— | — | @@ -85,8 +85,8 @@ |
86 | 86 | |
87 | 87 | $params['kml'] = new ListParameter( 'kml' ); |
88 | 88 | $params['kml']->setDefault( array() ); |
89 | | - $params['kml']->addManipulations( new ParamManipulationImplode( ',', "'" ) ); |
90 | | - |
| 89 | + $params['kml']->addManipulations( new MapsParamFile() ); |
| 90 | + |
91 | 91 | $params['overlays'] = new ListParameter( 'overlays' ); |
92 | 92 | $params['overlays']->setDefault( $egMapsGMapOverlays ); |
93 | 93 | $params['overlays']->addCriteria( new CriterionGoogleOverlay( self::$overlayData ) ); |
Index: branches/Maps0.8/includes/services/GoogleMaps/jquery.googlemap2.js |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | } |
103 | 103 | |
104 | 104 | if ( options.centre !== false ) { |
105 | | - map.setCenter( options.centre ); |
| 105 | + map.setCenter( new GLatLng( options.centre.lat, options.centre.lon ) ); |
106 | 106 | } |
107 | 107 | |
108 | 108 | if ( options.zoom !== false ) { |
Index: branches/Maps0.8/includes/manipulations/Maps_ParamImage.php |
— | — | @@ -1,34 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Parameter manipulation ensuring the value is an image url. |
6 | | - * |
7 | | - * @since 0.7.1 |
8 | | - * |
9 | | - * @file Maps_ParamImage.php |
10 | | - * @ingroup Maps |
11 | | - * @ingroup ParameterManipulations |
12 | | - * |
13 | | - * @author Jeroen De Dauw |
14 | | - */ |
15 | | -class MapsParamImage extends ItemParameterManipulation { |
16 | | - |
17 | | - /** |
18 | | - * Constructor. |
19 | | - * |
20 | | - * @since 0.7 |
21 | | - */ |
22 | | - public function __construct() { |
23 | | - parent::__construct(); |
24 | | - } |
25 | | - |
26 | | - /** |
27 | | - * @see ItemParameterManipulation::doManipulation |
28 | | - * |
29 | | - * @since 0.7 |
30 | | - */ |
31 | | - public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
32 | | - $value = MapsMapper::getImageUrl( $value ); |
33 | | - } |
34 | | - |
35 | | -} |
\ No newline at end of file |
Index: branches/Maps0.8/includes/manipulations/Maps_ParamFile.php |
— | — | @@ -0,0 +1,34 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Parameter manipulation ensuring the value is an file url. |
| 6 | + * |
| 7 | + * @since 0.8 |
| 8 | + * |
| 9 | + * @file Maps_ParamFile.php |
| 10 | + * @ingroup Maps |
| 11 | + * @ingroup ParameterManipulations |
| 12 | + * |
| 13 | + * @author Jeroen De Dauw |
| 14 | + */ |
| 15 | +class MapsParamFile extends ItemParameterManipulation { |
| 16 | + |
| 17 | + /** |
| 18 | + * Constructor. |
| 19 | + * |
| 20 | + * @since 0.7 |
| 21 | + */ |
| 22 | + public function __construct() { |
| 23 | + parent::__construct(); |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * @see ItemParameterManipulation::doManipulation |
| 28 | + * |
| 29 | + * @since 0.7 |
| 30 | + */ |
| 31 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
| 32 | + $value = MapsMapper::getFileUrl( $value ); |
| 33 | + } |
| 34 | + |
| 35 | +} |
Property changes on: branches/Maps0.8/includes/manipulations/Maps_ParamFile.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 36 | + native |
Index: branches/Maps0.8/includes/Maps_Mapper.php |
— | — | @@ -140,21 +140,21 @@ |
141 | 141 | /** |
142 | 142 | * Resolves the url of images provided as wiki page; leaves others alone. |
143 | 143 | * |
144 | | - * @since 0.7.1 |
| 144 | + * @since 0.8 |
145 | 145 | * |
146 | | - * @param string $image |
| 146 | + * @param string $file |
147 | 147 | * |
148 | 148 | * @return string |
149 | 149 | */ |
150 | | - public static function getImageUrl( $image ) { |
151 | | - $title = Title::newFromText( $image, NS_FILE ); |
| 150 | + public static function getFileUrl( $file ) { |
| 151 | + $title = Title::newFromText( $file, NS_FILE ); |
152 | 152 | |
153 | 153 | if ( !is_null( $title ) && $title->getNamespace() == NS_FILE && $title->exists() ) { |
154 | 154 | $imagePage = new ImagePage( $title ); |
155 | | - $image = $imagePage->getDisplayedFile()->getURL(); |
| 155 | + $file = $imagePage->getDisplayedFile()->getURL(); |
156 | 156 | } |
157 | 157 | |
158 | | - return $image; |
| 158 | + return $file; |
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
Index: branches/Maps0.8/includes/layers/Maps_ImageLayer.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | |
45 | 45 | $params['source'] = new Parameter( 'source' ); |
46 | 46 | $params['source']->addCriteria( new CriterionIsImage() ); |
47 | | - $params['source']->addManipulations( new MapsParamImage() ); |
| 47 | + $params['source']->addManipulations( new MapsParamFile() ); |
48 | 48 | |
49 | 49 | return $params; |
50 | 50 | } |
Index: branches/Maps0.8/includes/layers/Maps_KMLLayer.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | |
36 | 36 | $params['source'] = new Parameter( 'source' ); |
37 | 37 | $params['source']->addCriteria( new CriterionIsImage() ); |
38 | | - $params['source']->addManipulations( new MapsParamImage() ); |
| 38 | + $params['source']->addManipulations( new MapsParamFile() ); |
39 | 39 | |
40 | 40 | $params[] = new Parameter( 'maxdepth', Parameter::TYPE_INTEGER, 2 ); |
41 | 41 | |
Index: branches/Maps0.8/includes/Maps_Location.php |
— | — | @@ -373,7 +373,7 @@ |
374 | 374 | 'text' => $this->hasText() ? $this->getText() : $defText, |
375 | 375 | 'title' => $this->hasTitle() ? $this->getTitle() : $defTitle, |
376 | 376 | 'address' => $this->getAddress( false ), |
377 | | - 'icon' => $this->hasIcon() ? MapsMapper::getImageUrl( $this->getIcon() ) : $defIconUrl |
| 377 | + 'icon' => $this->hasIcon() ? MapsMapper::getFileUrl( $this->getIcon() ) : $defIconUrl |
378 | 378 | ); |
379 | 379 | } |
380 | 380 | |
Index: branches/Maps0.8/includes/features/Maps_BasePointMap.php |
— | — | @@ -147,7 +147,7 @@ |
148 | 148 | global $wgTitle; |
149 | 149 | |
150 | 150 | $parser = new Parser(); |
151 | | - $iconUrl = MapsMapper::getImageUrl( $params['icon'] ); |
| 151 | + $iconUrl = MapsMapper::getFileUrl( $params['icon'] ); |
152 | 152 | $params['locations'] = array(); |
153 | 153 | |
154 | 154 | foreach ( $params['coordinates'] as $location ) { |