r73787 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73786‎ | r73787 | r73788 >
Date:18:13, 26 September 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.7 - fixed some issues with the OpenLayers service
Modified paths:
  • /trunk/extensions/Maps/Maps_Settings.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayers.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/Maps_ParamOLLayers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps_Settings.php
@@ -428,7 +428,7 @@
429429 'yahoo' => "<style type='text/css'> #controls {width: 512px;}</style><script src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers'></script>",
430430 'bing' => "<script type='$wgJsMimeType' src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>",
431431 'ol-wms' => "<script type='$wgJsMimeType' src='http://clients.multimap.com/API/maps/1.1/metacarta_04'></script>",
432 - 'osm' => "<script type='$wgJsMimeType' src='$egMapsScriptPath/Services/OpenLayers/OSM/OpenStreetMap.js?$egMapsStyleVersion'></script>",
 432+ 'osm' => "<script type='$wgJsMimeType' src='$egMapsScriptPath/includes/services/OpenLayers/OSM/OpenStreetMap.js?$egMapsStyleVersion'></script>",
433433 );
434434
435435
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_ParamOLLayers.php
@@ -32,7 +32,7 @@
3333 global $egMapsOLLayerGroups;
3434
3535 $unpacked = array();
36 -
 36+
3737 foreach ( $parameter->value as $layerOrGroup ) {
3838 if ( array_key_exists( $layerOrGroup, $egMapsOLLayerGroups ) ) {
3939 $unpacked = array_merge( $unpacked, $egMapsOLLayerGroups[$layerOrGroup] );
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispMap.php
@@ -1,18 +1,13 @@
22 <?php
33
44 /**
5 - * Class for handling the display_map parser function with OpenLayers
 5+ * Class for handling the display_map parser function with OpenLayers.
66 *
77 * @file Maps_OpenLayersDispMap.php
88 * @ingroup MapsOpenLayers
99 *
1010 * @author Jeroen De Dauw
1111 */
12 -
13 -if ( !defined( 'MEDIAWIKI' ) ) {
14 - die( 'Not an entry point.' );
15 -}
16 -
1712 class MapsOpenLayersDispMap extends MapsBaseMap {
1813
1914 /**
@@ -20,7 +15,7 @@
2116 */
2217 public function addSpecificMapHTML( Parser $parser ) {
2318 global $wgLang;
24 -
 19+
2520 $layerItems = $this->service->createLayersStringAndLoadDependencies( $this->layers );
2621
2722 $mapName = $this->service->getMapId();
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayers.php
@@ -65,14 +65,10 @@
6666 $egMapsOLLayers,
6767 array(),
6868 array(
69 - new CriterionInArray( self::getLayerNames( true ), new ParamManipulationImplode( ',', "'" ) ),
 69+ new CriterionInArray( self::getLayerNames( true ) ),
7070 )
71 - );
72 -
73 - // TODO
74 - $params['layers']->outputTypes = array(
75 - 'olgroups' => array( 'olgroups' ),
76 - );
 71+ );
 72+ $params['layers']->addManipulations( new MapsParamOLLayers() );
7773 }
7874
7975 /**
@@ -186,7 +182,7 @@
187183 $this->loadDependencyWhenNeeded( $layer );
188184 $layerStr[] = is_array( $egMapsOLAvailableLayers[$layer] ) ? $egMapsOLAvailableLayers[$layer][0] : $egMapsOLAvailableLayers[$layer];
189185 }
190 -
 186+
191187 return count( $layerStr ) == 0 ? '' : 'new ' . implode( ',new ', $layerStr );
192188 }
193189
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php
@@ -101,7 +101,7 @@
102102
103103 // Get an instance of the class handling the current parser hook and service.
104104 $mapClass = $service->getFeatureInstance( $this->getName() );
105 -
 105+
106106 return $mapClass->getMapHtml( $parameters, $this->parser );
107107 }
108108

Status & tagging log