my $zoom = -1;
my $baselayer = undef;
if (defined(param('lon'))) {
- $lon = param('lon');
+ $lon = param('lon') || '';
unless ($lon =~ m/^-{0,1}\d+\.\d+$/) { $lon = -999.0; }
if (($lon < -180.0) || ($lon > 180.0)) { $lon = -999.0; }
}
if (defined(param('lat'))) {
- $lat = param('lat');
+ $lat = param('lat') || '';
unless ($lat =~ m/^-{0,1}\d+\.\d+$/) { $lat = -999.0; }
if (($lat < -90.0) || ($lat > 90.0)) { $lat = -999.0; }
}
if (defined(param('mlon'))) {
- $mlon = param('mlon');
+ $mlon = param('mlon') || '';
unless ($mlon =~ m/^-{0,1}\d+\.\d+$/) { $mlon = -999.0; }
if (($mlon < -180.0) || ($mlon > 180.0)) { $mlon = -999.0; }
}
if (defined(param('mlat'))) {
- $mlat = param('mlat');
+ $mlat = param('mlat') || '';
unless ($mlat =~ m/^-{0,1}\d+\.\d+$/) { $mlat = -999.0; }
if (($mlat < -90.0) || ($mlat > 90.0)) { $mlat = -999.0; }
}
if (defined(param('zoom'))) {
- $zoom = param('zoom');
+ $zoom = param('zoom') || '';
unless ($zoom =~ m/^\d+$/) { $zoom = -1; }
if (($zoom < 0) || ($zoom > 30)) { $lat = -1; }
}
if (defined(param('layers'))) {
# Mapping for Openlayers Permalinks
my @layerlist = ('osmde', 'osmorg', 'osmorglowzoom', 'luftbilderl');
- my $layers = param('layers');
+ my $layers = param('layers') || '';
+ $layers .= ' '; # Just append spaces so we do not get warnings if the string was too short.
my $i;
for ($i = 0; $i < int(@layerlist); $i++) {
if (substr($layers, $i, 1) eq 'B') { # This is our baselayer
}
if (defined(param('layer'))) {
# Mapping for Leaflet Permalinks
- my $layers = param('layer');
+ my $layers = param('layer') || '';
if ($layers eq 'RRZE tileserver osm.de style tiles') { $baselayer = 'osmde'; }
if ($layers eq 'RRZE tileserver osm.org style tiles') { $baselayer = 'osmorg'; }
if ($layers eq 'RRZE tileserver osm.org style with different lowzoom tiles') { $baselayer = 'osmorglowzoom'; }