Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php |
— | — | @@ -16,8 +16,6 @@ |
17 | 17 | public function addSpecificMapHTML( Parser $parser ) { |
18 | 18 | global $wgLang; |
19 | 19 | |
20 | | - $this->service->addLayerDependencies( $this->layers[1] ); |
21 | | - |
22 | 20 | $mapName = $this->service->getMapId(); |
23 | 21 | |
24 | 22 | $this->output .= Html::element( |
— | — | @@ -37,7 +35,7 @@ |
38 | 36 | $this->centreLon, |
39 | 37 | $this->centreLat, |
40 | 38 | $this->zoom, |
41 | | - {$this->layers[0]}, |
| 39 | + {$this->layers}, |
42 | 40 | [$this->controls], |
43 | 41 | $this->markerJs, |
44 | 42 | "$langCode" |
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php |
— | — | @@ -14,34 +14,45 @@ |
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->service->addOverlayOutput( $this->output, $mapName, $this->overlays, $this->controls ); |
| 22 | + $output = ''; |
21 | 23 | |
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( |
23 | 50 | 'div', |
24 | 51 | array( |
25 | 52 | '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;", |
27 | 54 | ), |
28 | 55 | 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 | + ); |
46 | 57 | } |
47 | 58 | |
48 | 59 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/includes/Maps_CoordinateParser.php |
— | — | @@ -145,6 +145,7 @@ |
146 | 146 | * @return boolean |
147 | 147 | */ |
148 | 148 | public static function areCoordinates( $coordsOrAddress ) { |
| 149 | + |
149 | 150 | // Handle i18n notations. |
150 | 151 | $coordsOrAddress = self::handleI18nLabels( $coordsOrAddress ); |
151 | 152 | |