#!/usr/bin/perl -w
use strict;
use CGI;
use HTTP::Request::Common qw(GET);
use LWP::UserAgent;
my $q= new CGI;
my $ua= new LWP::UserAgent;
my $phi_east= $q->param('x') || 491679;
my $phi_north= $q->param('y') || 5235293;
my $zoom= $q->param('s') || 0;
my $map= $q->param('m') || "EU"; # or NL
my $shift= 0.25;
my $PI= 4*atan2(1,1);
my $height= int(600*exp($zoom*log(2)));
my $equator= 2140; # y=5235293
#my $equator= 1970; # y=5043293
#my $equator= 1820; # y=4843293
#my $equator= 1685; # y=4643293
#my $equator= 1565; # y=4443293
#my $equator= 1250; # y=3683293
my $widthtop= int($equator*cos(($phi_north+$height)/18000000*$PI)*exp($zoom*log(2)));
my $widthupper= int($equator*cos(($phi_north+$height/2)/18000000*$PI)*exp($zoom*log(2)));
my $width= int($equator*cos($phi_north/18000000*$PI)*exp($zoom*log(2)));
my $widthlower= int($equator*cos(($phi_north-$height/2)/18000000*$PI)*exp($zoom*log(2)));
my $widthbottom= int($equator*cos(($phi_north-$height)/18000000*$PI)*exp($zoom*log(2)));
my $fixedparams= "s=$zoom&a=$map";
print $q->header;
print $q->start_html('kaart van europa');
print <<__EOF__;
height: $height
top : $widthtop
upper : $widthupper
center: $width
lower : $widthlower
bottom: $widthbottom
center : $phi_east, $phi_north
56
54
amsterdam
namen
ergens
46
valreas
42
40
36
thijsseweg11
west terschelling
berlin d-10587
* | * | * | ||||
* |
|
* | ||||
* | * | * |