Index: trunk/extensions/GoogleMaps/export/GoogleMapsImgExporter.php |
— | — | @@ -2,51 +2,49 @@ |
3 | 3 | |
4 | 4 | class GoogleMapsImgExporter extends GoogleMapsExporter { |
5 | 5 | var $mApiKey; |
6 | | - var $mPathCount; |
7 | 6 | var $mLanguageCode; |
8 | 7 | |
9 | 8 | function GoogleMapsImgExporter($pApiKey, $pLanguageCode) { |
10 | 9 | $this->mApiKey = $pApiKey; |
11 | | - $this->mPathCount = 0; |
12 | 10 | $this->mLanguageCode = $pLanguageCode; |
13 | 11 | } |
14 | 12 | |
15 | 13 | function addHeader($o) { |
16 | | - $width = $o['width'] > 512 ? 512 : $o['width']; |
17 | | - $height = $o['height'] > 512 ? 512 : $o['height']; |
| 14 | + $width = $o['width'] > 640 ? 640 : $o['width']; |
| 15 | + $height = $o['height'] > 640 ? 640 : $o['height']; |
18 | 16 | $this->mOutput .= '<img '; |
19 | 17 | $this->mOutput .= "alt=\"Map\" "; |
20 | 18 | $this->mOutput .= "height=\"{$height}\" width=\"{$width}\" "; |
21 | | - $this->mOutput .= 'src="http://maps.google.com/staticmap'; |
| 19 | + $this->mOutput .= 'src="http://maps.google.com/maps/api/staticmap'; |
22 | 20 | $this->mOutput .= "?center={$o['lat']}%2C{$o['lon']}"; |
23 | 21 | $this->mOutput .= "&zoom={$o['zoom']}"; |
24 | 22 | $this->mOutput .= "&size={$width}x{$height}"; |
25 | 23 | $this->mOutput .= "&key={$this->mApiKey}"; |
26 | | - $this->mOutput .= "&hl={$this->mLanguageCode}"; |
27 | | - $this->mOutput .= "&markers="; |
| 24 | + $this->mOutput .= "&language={$this->mLanguageCode}"; |
| 25 | + $this->mOutput .= "&sensor=false"; |
| 26 | + if ($o['type'] == 'terrain' || $o['type'] == 'satellite' || $o['type'] == 'hybrid') { |
| 27 | + $this->mOutput .= "&maptype={$o['type']}"; |
| 28 | + } |
28 | 29 | } |
29 | 30 | |
30 | 31 | function addMarker($pLat, $pLon, $pIcon, $pTitle, $pTitleLink, $pCaption, $pMaxContent, $pIsLine) |
31 | 32 | { |
32 | | - if ($this->mPathCount == 0) { |
33 | | - $label = ''; |
34 | | - if ($pIcon) { |
35 | | - $label = strtolower(substr($pIcon, 0, 1)); |
36 | | - } |
37 | | - $this->mOutput .= urlencode("{$pLat},{$pLon},red{$label}|"); |
| 33 | + $this->mOutput .= "&markers=".urlencode("size:mid|color:red"); |
| 34 | + if ($pIcon) { |
| 35 | + $this->mOutput .= urlencode("|label:" . strtoupper(substr($pIcon, 0, 1))); |
38 | 36 | } |
| 37 | + $this->mOutput .= urlencode("|{$pLat},{$pLon}"); |
39 | 38 | } |
40 | 39 | |
41 | 40 | function addPolyline( $pPolyline, $pLineColor, $pLineOpacity, $pStroke, $pFillColor, $pFillOpacity ) |
42 | 41 | { |
43 | | - if ($this->mPathCount == 0) { # limit 1 |
44 | | - $this->mPathCount++; |
45 | | - $this->mOutput .= "&path="; |
46 | | - $this->mOutput .= urlencode("rgba:0x{$pLineColor}{$pLineOpacity},weight:{$pStroke}"); |
47 | | - foreach ($pPolyline as $p) { |
48 | | - $this->mOutput .= urlencode("|{$p['lat']},{$p['lon']}"); |
49 | | - } |
| 42 | + $this->mOutput .= "&path=".urlencode("color:0x{$pLineColor}{$pLineOpacity}|weight:{$pStroke}"); |
| 43 | + if ( isset( $pFillColor ) ) { |
| 44 | + $this->mOutput .= urlencode("|fillcolor:0x{$pFillColor}{$pFillOpacity}"); |
50 | 45 | } |
| 46 | + foreach ($pPolyline as $p) { |
| 47 | + $this->mOutput .= urlencode("|{$p['lat']},{$p['lon']}"); |
| 48 | + } |
51 | 49 | } |
52 | 50 | |
53 | 51 | function addTrailer() { |
Index: trunk/extensions/GoogleMaps/SpecialGoogleMapsKML.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | |
11 | 11 | class GoogleMapsKML extends SpecialPage { |
12 | 12 | function GoogleMapsKML() { |
13 | | - parent::SpecialPage('Google Maps KML', '', false /* listed */); |
| 13 | + parent::SpecialPage('GoogleMapsKML', '', false /* listed */); |
14 | 14 | } |
15 | 15 | function execute( $params ) { |
16 | 16 | global $wgRequest, $wgOut, $wgTitle, $wgUser; |