Changeset 1079
- Timestamp:
- 06/16/07 16:41:13 (1 year ago)
- Files:
-
- trunk/lib/OpenGuides/Template.pm (modified) (5 diffs)
- trunk/t/69_bug_zero_geo.t (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/OpenGuides/Template.pm
r1054 r1079 424 424 425 425 # If we were sent x and y, work out lat/long; and vice versa. 426 if ( $os_x &&$os_y ) {426 if ( defined $os_x && defined $os_y ) { 427 427 my $point = Geography::NationalGrid::GB->new( Easting =>$os_x, 428 428 Northing=>$os_y); 429 429 $lat = sprintf("%.6f", $point->latitude); 430 430 $long = sprintf("%.6f", $point->longitude); 431 } elsif ( $lat &&$long ) {431 } elsif ( defined $lat && defined $long ) { 432 432 my $point = Geography::NationalGrid::GB->new(Latitude => $lat, 433 433 Longitude => $long); … … 436 436 } 437 437 438 if ( $os_x &&$os_y ) {438 if ( defined $os_x && defined $os_y ) { 439 439 %vars = ( 440 440 %vars, … … 469 469 470 470 # If we were sent x and y, work out lat/long; and vice versa. 471 if ( $osie_x &&$osie_y ) {471 if ( defined $osie_x && defined $osie_y ) { 472 472 my $point = Geography::NationalGrid::IE->new(Easting=>$osie_x, 473 473 Northing=>$osie_y); 474 474 $lat = sprintf("%.6f", $point->latitude); 475 475 $long = sprintf("%.6f", $point->longitude); 476 } elsif ( $lat &&$long ) {476 } elsif ( defined $lat && defined $long ) { 477 477 my $point = Geography::NationalGrid::GB->new(Latitude => $lat, 478 478 Longitude => $long); … … 480 480 $osie_y = $point->northing; 481 481 } 482 if ( $osie_x &&$osie_y ) {482 if ( defined $osie_x && defined $osie_y ) { 483 483 %vars = ( 484 484 %vars, … … 506 506 my $long = $q->param("longitude"); 507 507 508 if ( $lat &&$long ) {508 if ( defined $lat && defined $long ) { 509 509 # Trim whitespace. 510 510 $lat =~ s/\s+//g;
