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

Revision: 76257
Author:   jeroendedauw
Date:     2010-11-07 18:36:10 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
Follow up to r76228 and r76255 - partial fix - fixed Yahoo! Maps for display map

Modified Paths:
--------------
    trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispMap.php

Modified: 
trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispMap.php
===================================================================
--- trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispMap.php 
2010-11-07 18:27:29 UTC (rev 76256)
+++ trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispMap.php 
2010-11-07 18:36:10 UTC (rev 76257)
@@ -14,31 +14,40 @@
         * @see MapsBaseMap::getMapHTML()
         */
        public function getMapHTML( array $params, Parser $parser ) {
+               global $egMapsUseRL;
+               
                $mapName = $this->service->getMapId();
                
-               $this->output .= Html::element(
+               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
+                       initializeYahooMap(
+                               "$mapName",
+                               $centreLat,
+                               $centreLon,
+                               $zoom,
+                               $type,
+                               [{$params['types']}],
+                               [{$params['controls']}],
+                               {$params['autozoom']},
+                               []
+                       );
+EOT
+                       );                      
+               }               
+               
+               return 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
-               initializeYahooMap(
-                       "$mapName",
-                       $this->centreLat,
-                       $this->centreLon,
-                       $this->zoom,
-                       $this->type,
-                       [$this->types],
-                       [$this->controls],
-                       $this->autozoom,
-                       []
-               );
-EOT
-               );
+               );                      
        }
 
 }
\ No newline at end of file


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

Reply via email to