r76256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76255‎ | r76256 | r76257 >
Date:18:27, 7 November 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r76228 and r76255 - partial fix - fixed OpenLayers for display points and Google Maps for display map
Modified paths:
  • /trunk/extensions/Maps/includes/Maps_CoordinateParser.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php
@@ -16,8 +16,6 @@
1717 public function addSpecificMapHTML( Parser $parser ) {
1818 global $wgLang;
1919
20 - $this->service->addLayerDependencies( $this->layers[1] );
21 -
2220 $mapName = $this->service->getMapId();
2321
2422 $this->output .= Html::element(
@@ -37,7 +35,7 @@
3836 $this->centreLon,
3937 $this->centreLat,
4038 $this->zoom,
41 - {$this->layers[0]},
 39+ {$this->layers},
4240 [$this->controls],
4341 $this->markerJs,
4442 "$langCode"
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php
@@ -14,34 +14,45 @@
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->service->addOverlayOutput( $this->output, $mapName, $this->overlays, $this->controls );
 22+ $output = '';
2123
22 - $this->output .= Html::element(
 24+ $this->service->addOverlayOutput( $output, $mapName, $params['overlays'], $params['controls'] );
 25+
 26+ if ( !$egMapsUseRL ) {
 27+ $centreLat = MapsMapper::encodeJsVar( $params['centre']['lat'] );
 28+ $centreLon = MapsMapper::encodeJsVar( $params['centre']['lon'] );
 29+ $zoom = MapsMapper::encodeJsVar( $params['zoom'] );
 30+ $type = Xml::escapeJsString( $params['type'] );
 31+
 32+ MapsMapper::addInlineScript( $this->service, <<<EOT
 33+ initializeGoogleMap("$mapName",
 34+ {
 35+ lat: $centreLat,
 36+ lon: $centreLon,
 37+ zoom: $zoom,
 38+ type: $type,
 39+ types: [{$params['types']}],
 40+ controls: [{$params['controls']}],
 41+ scrollWheelZoom: {$params['autozoom']},
 42+ kml: [{$params['kml']}]
 43+ },
 44+ []);
 45+EOT
 46+ );
 47+ }
 48+
 49+ return $output . Html::element(
2350 'div',
2451 array(
2552 'id' => $mapName,
26 - 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;",
 53+ 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;",
2754 ),
2855 wfMsg( 'maps-loading-map' )
29 - );
30 -
31 - MapsMapper::addInlineScript( $this->service, <<<EOT
32 - initializeGoogleMap("$mapName",
33 - {
34 - lat: $this->centreLat,
35 - lon: $this->centreLon,
36 - zoom: $this->zoom,
37 - type: $this->type,
38 - types: [$this->types],
39 - controls: [$this->controls],
40 - scrollWheelZoom: $this->autozoom,
41 - kml: [$this->kml]
42 - },
43 - []);
44 -EOT
45 - );
 56+ );
4657 }
4758
4859 }
\ No newline at end of file
Index: trunk/extensions/Maps/includes/Maps_CoordinateParser.php
@@ -145,6 +145,7 @@
146146 * @return boolean
147147 */
148148 public static function areCoordinates( $coordsOrAddress ) {
 149+
149150 // Handle i18n notations.
150151 $coordsOrAddress = self::handleI18nLabels( $coordsOrAddress );
151152

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