CGI-Wiki-Plugin-Locator-UK
view release on metacpan or search on metacpan
lib/CGI/Wiki/Plugin/Locator/UK.pm view on Meta::CPAN
105106107108109110111112113114115116117118119120121122123124125126
# 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 )