CGI-Wiki-Plugin-Locator-UK

 view release on metacpan or  search on metacpan

lib/CGI/Wiki/Plugin/Locator/UK.pm  view on Meta::CPAN

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
  # Or specify the point via latitude and longitude.
  my $distance = $locator->distance(from_lat  => 51.53,
                                    from_long => -0.1,
                                    to_node   => "Duke of Cambridge",
                                    unit      => "metres" );
 
Defaults to kilometres if C<unit> is not supplied or is not recognised.
Recognised units at the moment: C<metres>, C<kilometres>.
 
Returns C<undef> if one of the endpoints does not exist, or does not
have both co-ordinates defined. The C<node> specification of an
endpoint overrides the x/y co-ords if both specified (but don't do
that).
 
B<Note:> Works to the nearest metre. Well, actually, calls C<int> and
rounds down, but if anyone cares about that they can send a patch.
 
=cut
 
sub distance {
    my ($self, %args) = @_;



( run in 1.157 second using v1.01-cache-2.11-cpan-49f99fa48dc )