r76257 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76256‎ | r76257 | r76258 >
Date:18:36, 7 November 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
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) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispMap.php
@@ -14,31 +14,40 @@
1515 * @see MapsBaseMap::getMapHTML()
1616 */
1717 public function getMapHTML( array $params, Parser $parser ) {
 18+ global $egMapsUseRL;
 19+
1820 $mapName = $this->service->getMapId();
1921
20 - $this->output .= Html::element(
 22+ if ( !$egMapsUseRL ) {
 23+ $centreLat = MapsMapper::encodeJsVar( $params['centre']['lat'] );
 24+ $centreLon = MapsMapper::encodeJsVar( $params['centre']['lon'] );
 25+ $zoom = MapsMapper::encodeJsVar( $params['zoom'] );
 26+ $type = Xml::escapeJsString( $params['type'] );
 27+
 28+ MapsMapper::addInlineScript( $this->service, <<<EOT
 29+ initializeYahooMap(
 30+ "$mapName",
 31+ $centreLat,
 32+ $centreLon,
 33+ $zoom,
 34+ $type,
 35+ [{$params['types']}],
 36+ [{$params['controls']}],
 37+ {$params['autozoom']},
 38+ []
 39+ );
 40+EOT
 41+ );
 42+ }
 43+
 44+ return Html::element(
2145 'div',
2246 array(
2347 'id' => $mapName,
24 - 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;",
 48+ 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;",
2549 ),
2650 wfMsg( 'maps-loading-map' )
27 - );
28 -
29 - MapsMapper::addInlineScript( $this->service, <<<EOT
30 - initializeYahooMap(
31 - "$mapName",
32 - $this->centreLat,
33 - $this->centreLon,
34 - $this->zoom,
35 - $this->type,
36 - [$this->types],
37 - [$this->controls],
38 - $this->autozoom,
39 - []
40 - );
41 -EOT
42 - );
 51+ );
4352 }
4453
4554 }
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76228Fixed incorrect loading of bc classjeroendedauw00:58, 7 November 2010
r76255Follow up to r76228 - partial fix - still expecting problems for OpenLayers w...jeroendedauw17:43, 7 November 2010

Status & tagging log