Index: trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php |
— | — | @@ -13,31 +13,40 @@ |
14 | 14 | * @see MapsBaseMap::getMapHTML() |
15 | 15 | */ |
16 | 16 | public function getMapHTML( array $params, Parser $parser ) { |
| 17 | + global $egMapsUseRL; |
| 18 | + |
17 | 19 | $mapName = $this->service->getMapId(); |
18 | 20 | |
19 | | - $this->output .= Html::element( |
| 21 | + if ( !$egMapsUseRL ) { |
| 22 | + $centreLat = MapsMapper::encodeJsVar( $params['centre']['lat'] ); |
| 23 | + $centreLon = MapsMapper::encodeJsVar( $params['centre']['lon'] ); |
| 24 | + $zoom = MapsMapper::encodeJsVar( $params['zoom'] ); |
| 25 | + $type = Xml::escapeJsString( $params['type'] ); |
| 26 | + |
| 27 | + MapsMapper::addInlineScript( $this->service, <<<EOT |
| 28 | + initGMap3( |
| 29 | + "$mapName", |
| 30 | + { |
| 31 | + zoom: $zoom, |
| 32 | + lat: $centreLat, |
| 33 | + lon: $centreLon, |
| 34 | + types: [], |
| 35 | + mapTypeId: $type |
| 36 | + }, |
| 37 | + [] |
| 38 | + ); |
| 39 | +EOT |
| 40 | + ); |
| 41 | + } |
| 42 | + |
| 43 | + return Html::element( |
20 | 44 | 'div', |
21 | 45 | array( |
22 | 46 | 'id' => $mapName, |
23 | | - 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;" |
| 47 | + 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;", |
24 | 48 | ), |
25 | | - null |
26 | | - ); |
27 | | - |
28 | | - MapsMapper::addInlineScript( $this->service, <<<EOT |
29 | | - initGMap3( |
30 | | - "$mapName", |
31 | | - { |
32 | | - zoom: $this->zoom, |
33 | | - lat: $this->centreLat, |
34 | | - lon: $this->centreLon, |
35 | | - types: [], |
36 | | - mapTypeId: $this->type |
37 | | - }, |
38 | | - [] |
39 | | - ); |
40 | | -EOT |
41 | | - ); |
| 49 | + wfMsg( 'maps-loading-map' ) |
| 50 | + ); |
42 | 51 | } |
43 | 52 | |
44 | 53 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/includes/services/OSM/Maps_OSMDispMap.php |
— | — | @@ -18,17 +18,17 @@ |
19 | 19 | public function getMapHTML( array $params, Parser $parser ) { |
20 | 20 | global $wgLang; |
21 | 21 | |
22 | | - $thumbs = $this->thumbs ? 'yes' : 'no'; |
23 | | - $photos = $this->photos ? 'yes' : 'no'; |
| 22 | + $thumbs = $params['thumbs'] ? 'yes' : 'no'; |
| 23 | + $photos = $params['photos'] ? 'yes' : 'no'; |
24 | 24 | $lang = $wgLang->getCode(); |
25 | 25 | |
26 | 26 | // https://secure.wikimedia.org/wikipedia/de/wiki/Wikipedia:WikiProjekt_Georeferenzierung/Wikipedia-World/en#Expert_mode |
27 | | - $this->output .= Html::element( |
| 27 | + return Html::element( |
28 | 28 | 'iframe', |
29 | 29 | array( |
30 | 30 | 'id' => $this->service->getMapId(), |
31 | | - 'style' => "width: $this->width; height: $this->height; clear: both;", |
32 | | - 'src' => "http://toolserver.org/~kolossos/openlayers/kml-on-ol.php?zoom={$this->zoom}&lat={$this->centreLat}&lon={$this->centreLon}&lang=$lang&thumbs=$thumbs&photo=$photos" |
| 31 | + 'style' => "width: {$params['width']}; height: {$params['height']}; clear: both;", |
| 32 | + 'src' => "http://toolserver.org/~kolossos/openlayers/kml-on-ol.php?zoom={$params['zoom']}&lat={$params['centre']['lat']}&lon={$params['centre']['lon']}&lang=$lang&thumbs=$thumbs&photo=$photos" |
33 | 33 | ), |
34 | 34 | wfMsg( 'maps-loading-map' ) |
35 | 35 | ); |