Leaflet/rectangle.pm

filter: Statementstmt 40.0% 12 / 30 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 100% 5 / 5 totaltotal 33.9% 20 / 59 CC 9 SCAR 22.3
CC
9
Cov
26%
llat
12.0
llon
12.0
ulat
12.0
CRAP 9.3
« Leaflet/icon.pm ↑ Summary Leaflet/Base.pm »
1 package Geo::Leaflet::rectangle;
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.03';
7 2 our $PACKAGE = __PACKAGE__;
8  
9 =head1 NAME
10  
11 Geo::Leaflet::rectangle - Leaflet rectangle object
12  
13 =head1 SYNOPSIS
14  
15 use Geo::Leaflet;
16 my $map = Geo::Leaflet->new;
17 my $rectangle = $map->rectangle(
18 llat => $llat,
19 llon => $llon,
20 ulat => $ulat,
21 ulon => $ulon,
22 options => {},
23 );
24  
25 =head1 DESCRIPTION
26  
27 This package constructs a Leaflet rectangle object for use on a L<Geo::Leaflet> map.
28  
29 =head1 PROPERTIES
30  
31 =head2 llat
32  
33 =cut
34  
35 sub llat {
36 0 ▶ my $self = shift;
Subroutine llat: not called CC=3 SCAR=24.8
Pod documented
37 0 ▶ $self->{'llat'} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
38 0 ▶ die("Error: llat required") unless defined $self->{'llat'};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"llat"} 0 0 0
39 0 return $self->{'llat'};
40 }
41  
42 =head2 llon
43  
44 =cut
45  
46 sub llon {
47 0 ▶ my $self = shift;
Subroutine llon: not called CC=3 SCAR=24.8
Pod documented
48 0 ▶ $self->{'llon'} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
49 0 ▶ die("Error: llon required") unless defined $self->{'llon'};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"llon"} 0 0 0
50 0 return $self->{'llon'};
51 }
52  
53 =head2 ulat
54  
55 =cut
56  
57 sub ulat {
58 0 ▶ my $self = shift;
Subroutine ulat: not called CC=3 SCAR=24.8
Pod documented
59 0 ▶ $self->{'ulat'} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
60 0 ▶ die("Error: ulat required") unless defined $self->{'ulat'};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"ulat"} 0 0 0
61 0 return $self->{'ulat'};
62 }
63  
64 =head2 ulon
65  
66 =cut
67  
68 sub ulon {
69 0 ▶ my $self = shift;
Subroutine ulon: not called CC=3 SCAR=24.8
Pod documented
70 0 ▶ $self->{'ulon'} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
71 0 ▶ die("Error: ulon required") unless defined $self->{'ulon'};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"ulon"} 0 0 0
72 0 return $self->{'ulon'};
73 }
74  
75 =head2 options
76  
77 =head2 popup
78  
79 =head1 METHODS
80  
81 =head2 stringify
82  
83 =cut
84  
85 sub stringify {
86 0 ▶ my $self = shift;
Subroutine stringify: not called CC=1 SCAR=6.9
Pod documented
87 #L.rectangle([[54.559322, -5.767822], [56.1210604, -3.021240]], {color: "#ff7800", weight: 1}).addTo(map);
88 0 return $self->stringify_base([[$self->llat, $self->llon], [$self->ulat, $self->ulon]]);
89 }
90  
91 =head1 SEE ALSO
92  
93 =head1 AUTHOR
94  
95 Michael R. Davis
96  
97 =head1 COPYRIGHT AND LICENSE
98  
99 Copyright (C) 2024 by Michael R. Davis
100  
101 MIT LICENSE
102  
103 =cut
104  
105 2 1;
« Leaflet/icon.pm ↑ Summary Leaflet/Base.pm »