http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76259
Revision: 76259
Author: jeroendedauw
Date: 2010-11-07 18:45:05 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
Follow up to r76228 and r76255 - Fixed OSM and Google Maps v3 services
Modified Paths:
--------------
trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php
trunk/extensions/Maps/includes/services/OSM/Maps_OSMDispMap.php
Modified:
trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php
===================================================================
---
trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php
2010-11-07 18:38:34 UTC (rev 76258)
+++
trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php
2010-11-07 18:45:05 UTC (rev 76259)
@@ -13,31 +13,40 @@
* @see MapsBaseMap::getMapHTML()
*/
public function getMapHTML( array $params, Parser $parser ) {
+ global $egMapsUseRL;
+
$mapName = $this->service->getMapId();
- $this->output .= Html::element(
+ if ( !$egMapsUseRL ) {
+ $centreLat = MapsMapper::encodeJsVar(
$params['centre']['lat'] );
+ $centreLon = MapsMapper::encodeJsVar(
$params['centre']['lon'] );
+ $zoom = MapsMapper::encodeJsVar( $params['zoom'] );
+ $type = Xml::escapeJsString( $params['type'] );
+
+ MapsMapper::addInlineScript( $this->service, <<<EOT
+ initGMap3(
+ "$mapName",
+ {
+ zoom: $zoom,
+ lat: $centreLat,
+ lon: $centreLon,
+ types: [],
+ mapTypeId: $type
+ },
+ []
+ );
+EOT
+ );
+ }
+
+ return Html::element(
'div',
array(
'id' => $mapName,
- 'style' => "width: $this->width; height:
$this->height; background-color: #cccccc; overflow: hidden;"
+ 'style' => "width: {$params['width']}; height:
{$params['height']}; background-color: #cccccc; overflow: hidden;",
),
- null
- );
-
- MapsMapper::addInlineScript( $this->service, <<<EOT
- initGMap3(
- "$mapName",
- {
- zoom: $this->zoom,
- lat: $this->centreLat,
- lon: $this->centreLon,
- types: [],
- mapTypeId: $this->type
- },
- []
- );
-EOT
- );
+ wfMsg( 'maps-loading-map' )
+ );
}
}
\ No newline at end of file
Modified: trunk/extensions/Maps/includes/services/OSM/Maps_OSMDispMap.php
===================================================================
--- trunk/extensions/Maps/includes/services/OSM/Maps_OSMDispMap.php
2010-11-07 18:38:34 UTC (rev 76258)
+++ trunk/extensions/Maps/includes/services/OSM/Maps_OSMDispMap.php
2010-11-07 18:45:05 UTC (rev 76259)
@@ -18,17 +18,17 @@
public function getMapHTML( array $params, Parser $parser ) {
global $wgLang;
- $thumbs = $this->thumbs ? 'yes' : 'no';
- $photos = $this->photos ? 'yes' : 'no';
+ $thumbs = $params['thumbs'] ? 'yes' : 'no';
+ $photos = $params['photos'] ? 'yes' : 'no';
$lang = $wgLang->getCode();
//
https://secure.wikimedia.org/wikipedia/de/wiki/Wikipedia:WikiProjekt_Georeferenzierung/Wikipedia-World/en#Expert_mode
- $this->output .= Html::element(
+ return Html::element(
'iframe',
array(
'id' => $this->service->getMapId(),
- 'style' => "width: $this->width; height:
$this->height; clear: both;",
- '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"
+ 'style' => "width: {$params['width']}; height:
{$params['height']}; clear: both;",
+ '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"
),
wfMsg( 'maps-loading-map' )
);
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs