http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76256

Revision: 76256
Author:   jeroendedauw
Date:     2010-11-07 18:27:29 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
Follow up to r76228 and r76255 - partial fix - fixed OpenLayers for display 
points and Google Maps for display map

Modified Paths:
--------------
    trunk/extensions/Maps/includes/Maps_CoordinateParser.php
    
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php
    
trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php

Modified: trunk/extensions/Maps/includes/Maps_CoordinateParser.php
===================================================================
--- trunk/extensions/Maps/includes/Maps_CoordinateParser.php    2010-11-07 
17:43:19 UTC (rev 76255)
+++ trunk/extensions/Maps/includes/Maps_CoordinateParser.php    2010-11-07 
18:27:29 UTC (rev 76256)
@@ -145,6 +145,7 @@
         * @return boolean
         */
        public static function areCoordinates( $coordsOrAddress ) {
+               
                // Handle i18n notations.
                $coordsOrAddress = self::handleI18nLabels( $coordsOrAddress );
 

Modified: 
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php
===================================================================
--- 
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php   
    2010-11-07 17:43:19 UTC (rev 76255)
+++ 
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php   
    2010-11-07 18:27:29 UTC (rev 76256)
@@ -14,34 +14,45 @@
         * @see MapsBaseMap::getMapHTML()
         */
        public function getMapHTML( array $params, Parser $parser ) {
+               global $egMapsUseRL;
+               
                $mapName = $this->service->getMapId();
                
-               $this->service->addOverlayOutput( $this->output, $mapName, 
$this->overlays, $this->controls );
+               $output = '';
                
-               $this->output .= Html::element(
+               $this->service->addOverlayOutput( $output, $mapName, 
$params['overlays'], $params['controls'] );
+               
+               if ( !$egMapsUseRL ) {
+                       $centreLat = MapsMapper::encodeJsVar( 
$params['centre']['lat'] );
+                       $centreLon = MapsMapper::encodeJsVar( 
$params['centre']['lon'] );
+                       $zoom = MapsMapper::encodeJsVar( $params['zoom'] );
+                       $type = Xml::escapeJsString( $params['type'] ); 
+                               
+                       MapsMapper::addInlineScript( $this->service, <<<EOT
+                       initializeGoogleMap("$mapName", 
+                               {
+                               lat: $centreLat,
+                               lon: $centreLon,
+                               zoom: $zoom,
+                               type: $type,
+                               types: [{$params['types']}],
+                               controls: [{$params['controls']}],
+                               scrollWheelZoom: {$params['autozoom']},
+                               kml: [{$params['kml']}]
+                               },
+                       []);
+EOT
+                       );
+               }
+               
+               return $output . Html::element(
                        'div',
                        array(
                                'id' => $mapName,
-                               'style' => "width: $this->width; height: 
$this->height; background-color: #cccccc; overflow: hidden;",
+                               'style' => "width: {$params['width']}; height: 
{$params['height']}; background-color: #cccccc; overflow: hidden;",
                        ),
                        wfMsg( 'maps-loading-map' )
-               );
-               
-               MapsMapper::addInlineScript( $this->service, <<<EOT
-               initializeGoogleMap("$mapName", 
-                       {
-                       lat: $this->centreLat,
-                       lon: $this->centreLon,
-                       zoom: $this->zoom,
-                       type: $this->type,
-                       types: [$this->types],
-                       controls: [$this->controls],
-                       scrollWheelZoom: $this->autozoom,
-                       kml: [$this->kml]
-                       },
-               []);
-EOT
-               );
+               );                      
        }
        
 }
\ No newline at end of file

Modified: 
trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php
===================================================================
--- 
trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php 
    2010-11-07 17:43:19 UTC (rev 76255)
+++ 
trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php 
    2010-11-07 18:27:29 UTC (rev 76256)
@@ -16,8 +16,6 @@
        public function addSpecificMapHTML( Parser $parser ) {
                global $wgLang;
                
-               $this->service->addLayerDependencies( $this->layers[1] );
-               
                $mapName = $this->service->getMapId();
                
                $this->output .= Html::element(
@@ -37,7 +35,7 @@
                        $this->centreLon,
                        $this->centreLat,
                        $this->zoom,
-                       {$this->layers[0]},
+                       {$this->layers},
                        [$this->controls],
                        $this->markerJs,
                        "$langCode"


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to