r68888 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68887‎ | r68888 | r68889 >
Date:16:40, 2 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added list support for the KML parameter for Google Maps
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/Services/GoogleMaps/GoogleMapFunctions.js (modified) (history)
  • /trunk/extensions/Maps/Services/GoogleMaps/Maps_GoogleMaps.php (modified) (history)
  • /trunk/extensions/Maps/Services/GoogleMaps/Maps_GoogleMapsDispMap.php (modified) (history)
  • /trunk/extensions/Maps/Services/GoogleMaps/Maps_GoogleMapsDispPoint.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Services/GoogleMaps/Maps_GoogleMapsDispMap.php
@@ -84,7 +84,7 @@
8585 types: [$this->types],
8686 controls: [$this->controls],
8787 scrollWheelZoom: $this->autozoom,
88 - kml: '$this->kml'
 88+ kml: [$this->kml]
8989 },
9090 []);
9191 }
Index: trunk/extensions/Maps/Services/GoogleMaps/Maps_GoogleMaps.php
@@ -73,6 +73,8 @@
7474 'output-type' => 'boolstr'
7575 ),
7676 'kml' => array(
 77+ 'type' => array( 'string', 'list' ),
 78+ 'output-type' => array( 'list', ',', '\'' )
7779 ),
7880 );
7981
Index: trunk/extensions/Maps/Services/GoogleMaps/Maps_GoogleMapsDispPoint.php
@@ -87,7 +87,7 @@
8888 types: [$this->types],
8989 controls: [$this->controls],
9090 scrollWheelZoom: $this->autozoom,
91 - kml: '$this->kml'
 91+ kml: [$this->kml]
9292 },
9393 [$this->markerString]
9494 );
Index: trunk/extensions/Maps/Services/GoogleMaps/GoogleMapFunctions.js
@@ -166,12 +166,14 @@
167167
168168 map.enableContinuousZoom();
169169
170 - // Code to add KML files
171 - if (mapOptions.kml != '') {
172 - map.addOverlay( new GGeoXml( mapOptions.kml ) );
173 - }
 170+ // Code to add KML files.
 171+ var kmlOverlays = [];
 172+ for ( i = mapOptions.kml.length -1; i >= 0; i-- ) {
 173+ kmlOverlays[i] = new GGeoXml( mapOptions.kml[i] );
 174+ map.addOverlay( kmlOverlays[i] );
 175+ }
174176
175 - // Make the map variable available for other functions
 177+ // Make the map variable available for other functions.
176178 if (!window.GMaps) window.GMaps = new Object;
177179 eval("window.GMaps." + mapName + " = map;");
178180
Index: trunk/extensions/Maps/Maps.php
@@ -33,7 +33,7 @@
3434 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>.';
3535 }
3636 else {
37 - define( 'Maps_VERSION', '0.6.4 a4' );
 37+ define( 'Maps_VERSION', '0.6.4 a5' );
3838
3939 // The different coordinate notations.
4040 define( 'Maps_COORDS_FLOAT', 'float' );

Status & tagging log