Index: trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispMap.php |
— | — | @@ -14,31 +14,40 @@ |
15 | 15 | * @see MapsBaseMap::getMapHTML() |
16 | 16 | */ |
17 | 17 | public function getMapHTML( array $params, Parser $parser ) { |
| 18 | + global $egMapsUseRL; |
| 19 | + |
18 | 20 | $mapName = $this->service->getMapId(); |
19 | 21 | |
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( |
21 | 45 | 'div', |
22 | 46 | array( |
23 | 47 | '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;", |
25 | 49 | ), |
26 | 50 | 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 | + ); |
43 | 52 | } |
44 | 53 | |
45 | 54 | } |
\ No newline at end of file |