Leaflet/Rectangle.pm

filter: Statementstmt 38.7% 12 / 31 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 3 / 9 Podpod 100% 5 / 5 totaltotal 32.7% 20 / 61 CC 9 SCAR 21.8
CC
9
Cov
26%
llat
12.0
llon
12.0
ulat
12.0
CRAP 8.9
« 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.04';
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 0 ▶sub llat {
Subroutine llat: not called CC=3 SCAR=24.8
Pod documented
36 0 my $self = shift;
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 0 ▶sub llon {
Subroutine llon: not called CC=3 SCAR=24.8
Pod documented
47 0 my $self = shift;
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 0 ▶sub ulat {
Subroutine ulat: not called CC=3 SCAR=24.8
Pod documented
58 0 my $self = shift;
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 0 ▶sub ulon {
Subroutine ulon: not called CC=3 SCAR=24.8
Pod documented
69 0 my $self = shift;
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 0 ▶sub _method_name {'rectangle'};
Subroutine _method_name: not called CC=1 SCAR=6.9
86  
87 0 ▶sub stringify {
Subroutine stringify: not called CC=1 SCAR=6.9
Pod documented
88 0 my $self = shift;
89 #L.rectangle([[54.559322, -5.767822], [56.1210604, -3.021240]], {color: "#ff7800", weight: 1}).addTo(map);
90 0 return $self->stringify_base([[$self->llat, $self->llon], [$self->ulat, $self->ulon]]);
91 }
92  
93 =head1 SEE ALSO
94  
95 =head1 AUTHOR
96  
97 Michael R. Davis
98  
99 =head1 COPYRIGHT AND LICENSE
100  
101 Copyright (C) 2024 by Michael R. Davis
102  
103 MIT LICENSE
104  
105 =cut
106  
107 2 1;
« Leaflet/Icon.pm ↑ Summary Leaflet/Base.pm »