Index: trunk/extensions/SlippyMap/SlippyMap.class.php |
— | — | @@ -27,13 +27,41 @@ |
28 | 28 | |
29 | 29 | wfLoadExtensionMessages( 'SlippyMap' ); |
30 | 30 | |
31 | | - $lat = $argv['lat']; |
32 | | - $lon = $argv['lon']; |
33 | | - $zoom = $argv['z']; |
34 | | - $width = $argv['w']; |
35 | | - $height = $argv['h']; |
36 | | - $layer = $argv['layer']; |
37 | | - $marker = $argv['marker']; |
| 31 | + if ( isset( $argv['lat'] ) ) { |
| 32 | + $lat = $argv['lat']; |
| 33 | + } else { |
| 34 | + $lat = ''; |
| 35 | + } |
| 36 | + if ( isset( $argv['lon'] ) ) { |
| 37 | + $lon = $argv['lon']; |
| 38 | + } else { |
| 39 | + $lon = ''; |
| 40 | + } |
| 41 | + if ( isset( $argv['z'] ) ) { |
| 42 | + $zoom = $argv['z']; |
| 43 | + } else { |
| 44 | + $zoom = ''; |
| 45 | + } |
| 46 | + if ( isset( $argv['w'] ) ) { |
| 47 | + $width = $argv['w']; |
| 48 | + } else { |
| 49 | + $width = ''; |
| 50 | + } |
| 51 | + if ( isset( $argv['h'] ) ) { |
| 52 | + $height = $argv['h']; |
| 53 | + } else { |
| 54 | + $height = ''; |
| 55 | + } |
| 56 | + if ( isset( $argv['layer'] ) ) { |
| 57 | + $layer = $argv['layer']; |
| 58 | + } else { |
| 59 | + $layer = ''; |
| 60 | + } |
| 61 | + if ( isset( $argv['marker'] ) ) { |
| 62 | + $marker = $argv['marker']; |
| 63 | + } else { |
| 64 | + $marker = ''; |
| 65 | + } |
38 | 66 | |
39 | 67 | $error=""; |
40 | 68 | |
— | — | @@ -42,7 +70,9 @@ |
43 | 71 | if ($height=='') $height='320'; |
44 | 72 | if ($layer=='') $layer='mapnik'; |
45 | 73 | |
46 | | - if ($zoom=='') $zoom = $argv['zoom']; //see if they used 'zoom' rather than 'z' (and allow it) |
| 74 | + if ($zoom=='' && isset( $argv['zoom'] ) ) { |
| 75 | + $zoom = $argv['zoom']; //see if they used 'zoom' rather than 'z' (and allow it) |
| 76 | + } |
47 | 77 | |
48 | 78 | $marker = ( $marker != '' && $marker != '0' ); |
49 | 79 | |
— | — | @@ -54,7 +84,6 @@ |
55 | 85 | if ( $lat=='' ) $error .= wfMsg( 'slippymap_latmissing' ); |
56 | 86 | if ( $lon=='' ) $error .= wfMsg( 'slippymap_lonmissing' ); |
57 | 87 | if ( $zoom=='' ) $error .= wfMsg( 'slippymap_zoommissing' ); |
58 | | - if ( isset( $argv['long'] ) ) $error .= wfMsg( 'slippymap_longdepreciated' ); |
59 | 88 | |
60 | 89 | if ($error=='') { |
61 | 90 | //no errors so far. Now check the values |