| 1 | package Geo::Leaflet::Circle; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use base qw{Geo::Leaflet::Objects}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | our $VERSION = '0.04'; | |||||||||
| 7 | 2 | our $PACKAGE = __PACKAGE__; | |||||||||
| 8 | |||||||||||
| 9 | =head1 NAME | ||||||||||
| 10 | |||||||||||
| 11 | Geo::Leaflet::Circle - Leaflet circle object | ||||||||||
| 12 | |||||||||||
| 13 | =head1 SYNOPSIS | ||||||||||
| 14 | |||||||||||
| 15 | use Geo::Leaflet; | ||||||||||
| 16 | my $map = Geo::Leaflet->new; | ||||||||||
| 17 | my $circle = $map->circle( | ||||||||||
| 18 | lat => $lat, | ||||||||||
| 19 | lon => $lon, | ||||||||||
| 20 | radius => $radius, | ||||||||||
| 21 | options => {}, | ||||||||||
| 22 | ); | ||||||||||
| 23 | |||||||||||
| 24 | =head1 DESCRIPTION | ||||||||||
| 25 | |||||||||||
| 26 | This package constructs a Leaflet circle object for use on a L<Geo::Leaflet> map. | ||||||||||
| 27 | |||||||||||
| 28 | =head1 PROPERTIES | ||||||||||
| 29 | |||||||||||
| 30 | =head2 lat | ||||||||||
| 31 | |||||||||||
| 32 | =cut | ||||||||||
| 33 | |||||||||||
| 34 | 1 | ▶ | sub lat { | ||||||||
|
Subroutine
lat: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||
| 35 | 1 | my $self = shift; | |||||||||
| 36 | 1 | ▶ | $self->{'lat'} = shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 1 | ▶ | die("Error: lat required") unless defined $self->{'lat'}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 1 | return $self->{'lat'}; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | =head2 lon | ||||||||||
| 42 | |||||||||||
| 43 | =cut | ||||||||||
| 44 | |||||||||||
| 45 | 1 | ▶ | sub lon { | ||||||||
|
Subroutine
lon: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||
| 46 | 1 | my $self = shift; | |||||||||
| 47 | 1 | ▶ | $self->{'lon'} = shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 1 | ▶ | die("Error: lon required") unless defined $self->{'lon'}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 1 | return $self->{'lon'}; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | =head2 radius | ||||||||||
| 53 | |||||||||||
| 54 | =cut | ||||||||||
| 55 | |||||||||||
| 56 | 2 | ▶ | sub radius { | ||||||||
|
Subroutine
radius: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 57 | 2 | my $self = shift; | |||||||||
| 58 | 2 | ▶ | $self->{'radius'} = shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 2 | return $self->{'radius'}; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | =head2 options | ||||||||||
| 63 | |||||||||||
| 64 | =head1 METHODS | ||||||||||
| 65 | |||||||||||
| 66 | =head2 stringify | ||||||||||
| 67 | |||||||||||
| 68 | =cut | ||||||||||
| 69 | |||||||||||
| 70 | 1 | ▶ | sub _method_name {'circle'}; | ||||||||
|
Subroutine
_method_name: called CC=1 SCAR=0.0
| |||||||||||
| 71 | |||||||||||
| 72 | 1 | ▶ | sub stringify { | ||||||||
|
Subroutine
stringify: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 73 | 1 | my $self = shift; | |||||||||
| 74 | 1 | my $options = $self->options; | |||||||||
| 75 | 1 | ▶ | $options->{'radius'} = $self->radius if defined $self->radius; #radius is set in options | ||||||||
|
Branch: 1 branch
| |||||||||||
| 76 | 1 | return $self->stringify_base([$self->lat, $self->lon]); | |||||||||
| 77 | } | ||||||||||
| 78 | |||||||||||
| 79 | =head1 SEE ALSO | ||||||||||
| 80 | |||||||||||
| 81 | =head1 AUTHOR | ||||||||||
| 82 | |||||||||||
| 83 | Michael R. Davis | ||||||||||
| 84 | |||||||||||
| 85 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 86 | |||||||||||
| 87 | Copyright (C) 2024 by Michael R. Davis | ||||||||||
| 88 | |||||||||||
| 89 | MIT LICENSE | ||||||||||
| 90 | |||||||||||
| 91 | =cut | ||||||||||
| 92 | |||||||||||
| 93 | 2 | 1; | |||||||||