From 9b2a769a0e524ef60b4b5a6c585cfced60494544 Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Thu, 13 Jan 2005 16:12:25 +0000 Subject: [PATCH] moving geo files to new experiments subdir --- {tests => experiments/geo}/geo.php | 9 +++-- experiments/geo/geomaker.php | 53 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 5 deletions(-) rename {tests => experiments/geo}/geo.php (97%) create mode 100644 experiments/geo/geomaker.php diff --git a/tests/geo.php b/experiments/geo/geo.php similarity index 97% rename from tests/geo.php rename to experiments/geo/geo.php index 31451d74d7..277611780b 100755 --- a/tests/geo.php +++ b/experiments/geo/geo.php @@ -35,8 +35,7 @@ polygon(germany-bavaria-bw,germany-bw-south,germany-bw-west,germany-bw-rp,german !name[de]:Deutschland !name[en]:Germany !region[political]: -addregs(germany-bavaria,germany-bw); -include(danube) +addregs(germany-bavaria,germany-bw) ", "danube" => " @@ -44,8 +43,8 @@ include(danube) !region:polyline(danube_germany,danube_austria) " , -"danube_germany" =>"!data:1.2,3.5 1.8,2.5 2,2.9" , -"danube_austria" =>"!data:2.2,3.5 2.5,3.2 3,3.7" , +"danube_germany" =>"!data:120,350 180,250 200,290" , +"danube_austria" =>"!data:220,350 250,320 300,370" , ) ; @@ -229,7 +228,7 @@ class geo $text = $this->get_specs ( "name" , array ( "de" ) ) ; if ( $text == "" ) return "" ; $text = utf8_decode ( $this->data[$text][0] ) ; - $ret = "{$text}\n" ; + $ret = "{$text}\n" ; return $ret ; } diff --git a/experiments/geo/geomaker.php b/experiments/geo/geomaker.php new file mode 100644 index 0000000000..d6a398a8e7 --- /dev/null +++ b/experiments/geo/geomaker.php @@ -0,0 +1,53 @@ + + + +" ; + +$image = "./Germany_Map.jpg" ; + +if ( isset ( $_GET['coords'] ) ) $coords = $_GET['coords'] ; +else $coords = "" ; + +$x = $y = -1 ; +foreach ( $_GET AS $k => $v ) + { + $a = explode ( "," , str_replace ( "?" , "" , $k ) ) ; + if ( $v == "" AND count ( $a ) == 2 ) + { + $x = array_shift ( $a ) ; + $y = array_shift ( $a ) ; + } + } + +if ( $coords != "" ) $coords = explode ( ";" , $coords ) ; +else $coords = array () ; + +if ( $x != -1 AND $y != -1 ) # Adding coordinates + { + $coords[] = "{$x},{$y}" ; + } + +$c2 = $coords ; +if ( count ( $c2 ) > 0 ) array_pop ( $c2 ) ; +$c2 = implode ( ";" , $c2 ) ; + +$coords = implode ( ";" , $coords ) ; + +print " + +" ; + +print "
Remove last coordinates" ; +print " | Reset" ; + +print "
Coordinates so far:
\n" ; +print str_replace ( ";" , " " , $coords ) ; + +print " + +" ; + +?> \ No newline at end of file -- 2.20.1