r76259 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76258‎ | r76259 | r76260 >
Date:18:45, 7 November 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r76228 and r76255 - Fixed OSM and Google Maps v3 services
Modified paths:
  • /trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OSM/Maps_OSMDispMap.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php
@@ -13,31 +13,40 @@
1414 * @see MapsBaseMap::getMapHTML()
1515 */
1616 public function getMapHTML( array $params, Parser $parser ) {
 17+ global $egMapsUseRL;
 18+
1719 $mapName = $this->service->getMapId();
1820
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(
2044 'div',
2145 array(
2246 '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;",
2448 ),
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+ );
4251 }
4352
4453 }
\ No newline at end of file
Index: trunk/extensions/Maps/includes/services/OSM/Maps_OSMDispMap.php
@@ -18,17 +18,17 @@
1919 public function getMapHTML( array $params, Parser $parser ) {
2020 global $wgLang;
2121
22 - $thumbs = $this->thumbs ? 'yes' : 'no';
23 - $photos = $this->photos ? 'yes' : 'no';
 22+ $thumbs = $params['thumbs'] ? 'yes' : 'no';
 23+ $photos = $params['photos'] ? 'yes' : 'no';
2424 $lang = $wgLang->getCode();
2525
2626 // https://secure.wikimedia.org/wikipedia/de/wiki/Wikipedia:WikiProjekt_Georeferenzierung/Wikipedia-World/en#Expert_mode
27 - $this->output .= Html::element(
 27+ return Html::element(
2828 'iframe',
2929 array(
3030 '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"
3333 ),
3434 wfMsg( 'maps-loading-map' )
3535 );

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