Index: trunk/extensions/geo/geo.php |
— | — | @@ -51,20 +51,8 @@ |
52 | 52 | else $vb = trim ( strtolower ( $e[1] ) ) ;# /*$this->styles*/$kv[$c][$e[0]] = trim ( strtolower ( $e[1] ) ) ; |
53 | 53 | if ( $key == "style" ) $this->styles[$c][$va] = $vb ; |
54 | 54 | else $this->label_styles[$c][$va] = $vb ; |
55 | | -# print "{$va} : " .$vb. "\n" ; |
56 | 55 | } |
57 | 56 | } |
58 | | -# $this->styles[$c][] = $a[1] ; |
59 | | -/* else if ( $key == "label" ) |
60 | | - { |
61 | | - $d = explode ( ";" , str_replace ( "," , ";" , $a[1] ) ) ; |
62 | | - foreach ( $d AS $e ) |
63 | | - { |
64 | | - $e = explode ( ":" , $e ) ; |
65 | | - if ( count ( $e ) < 2 ) $this->label_styles[$c][$e[0]] = "" ; |
66 | | - else $this->label_styles[$c][$e[0]] = $e[1] ; |
67 | | - } |
68 | | - }*/ |
69 | 57 | } |
70 | 58 | } |
71 | 59 | } |
— | — | @@ -101,7 +89,7 @@ |
102 | 90 | # Finalizing |
103 | 91 | $viewBox = $this->get_view_box () ; |
104 | 92 | $svg = |
105 | | - '<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> |
| 93 | + '<?xml version="1.0" encoding="utf-8" standalone="no"?> |
106 | 94 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/SVG/DTD/svg10.dtd"> |
107 | 95 | <svg viewBox="' . $viewBox . |
108 | 96 | '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"> |
— | — | @@ -163,29 +151,6 @@ |
164 | 152 | return implode ( "; " , $ret ) ; |
165 | 153 | } |
166 | 154 | |
167 | | -/* |
168 | | - function get_styles ( $id , $type ) |
169 | | - { |
170 | | - # Universal constants; rivers are blue! |
171 | | - if ( $type == "river" ) |
172 | | - return "fill:none; stroke:blue; stroke-width:2" ; |
173 | | - |
174 | | - if ( isset ( $this->styles[$id] ) ) |
175 | | - return $this->styles[$id] ; |
176 | | - |
177 | | - $ret = $this->styles["default"] ; # Default, if not overwritten by anything more specific |
178 | | - foreach ( $this->object_tree AS $object ) |
179 | | - { |
180 | | - $o = explode ( ";" , $object ) ; |
181 | | - $s = $this->match_object_style ( $o[0] , $o[1] ) ; |
182 | | - if ( $s != "" ) $ret .= "; " . $s ; |
183 | | - $s = $this->match_object_style ( $o[0] , $type ) ; |
184 | | - if ( $s != "" ) $ret .= "; " . $s ; |
185 | | - } |
186 | | - |
187 | | - return $ret ; |
188 | | - } |
189 | | -*/ |
190 | 155 | function data_to_real ( &$x , &$y ) |
191 | 156 | { |
192 | 157 | $x = coordinate_to_number ( coordinate_take_apart ( $x ) ) ; |
— | — | @@ -255,11 +220,10 @@ |
256 | 221 | $s .= "{$pk}: {$pv}; " ; |
257 | 222 | |
258 | 223 | $s .= "' x='{$x}' y='{$y}'>{$text}</text>" ; |
259 | | - if ( isset ( $l['href'] ) ) |
| 224 | + if ( isset ( $l['style']['href'] ) ) |
260 | 225 | { |
261 | | - print $l['href'] . "\n" ; |
262 | | - $href = $l['href'] ; |
263 | | - $s = "<a xlink:href={$href}>{$s}</a>" ; |
| 226 | + $href = $l['style']['href'] ; |
| 227 | + $s = "<a xlink:href=\"{$href}\">{$s}</a>" ; |
264 | 228 | } |
265 | 229 | $ret .= $s."\n" ; |
266 | 230 | } |
— | — | @@ -473,7 +437,7 @@ |
474 | 438 | if ( !$this->label_this ( $params ) ) return ; |
475 | 439 | $text = $this->get_specs ( "name" , $params->languages ) ; |
476 | 440 | if ( $text == "" ) return "" ; # No label found |
477 | | - $text = utf8_decode ( $this->data[$text][0] ) ; |
| 441 | + $text = $this->data[$text][0] ; |
478 | 442 | if ( $text == "" ) return "" ; # No point in showing an empty label |
479 | 443 | $x = floor ( $x ) ; |
480 | 444 | $y = floor ( $y ) ; |
— | — | @@ -482,8 +446,9 @@ |
483 | 447 | $a['style'] = $this->get_label_style ( &$params ) ; |
484 | 448 | if ( isset ( $a['style']['clickable'] ) ) |
485 | 449 | { |
| 450 | + $href = "http://" . $params->languages[0] . ".wikipedia.org/wiki/" . str_replace ( " " , "_" , $text ) ; |
486 | 451 | unset ( $a['style']['clickable'] ) ; # Shouldn't show up in style list |
487 | | - $a['style']['href'] = "http://www.google.de" ; |
| 452 | + $a['style']['href'] = $href ; |
488 | 453 | } |
489 | 454 | $params->add_label ( $a ) ; |
490 | 455 | } |
— | — | @@ -588,9 +553,6 @@ |
589 | 554 | $s .= "{$k}:{$v}; " ; |
590 | 555 | $ret = "style=\"{$s}\"" ; |
591 | 556 | return $ret ; |
592 | | -# $t = trim ( strtolower ( $this->get_current_type ( $params ) ) ) ; |
593 | | -# $s = $params->get_styles ( $this->id , $t ) ; |
594 | | -# return "style=\"{$s}\"" ; |
595 | 557 | } |
596 | 558 | } |
597 | 559 | |