File Coverage

blib/lib/Geo/Leaflet/rectangle.pm
Criterion Covered Total %
statement 9 27 33.3
branch 0 16 0.0
condition n/a
subroutine 3 8 37.5
pod 5 5 100.0
total 17 56 30.3


line stmt bran cond sub pod time code
1             package Geo::Leaflet::rectangle;
2 2     2   14 use strict;
  2         5  
  2         93  
3 2     2   11 use warnings;
  2         3  
  2         105  
4 2     2   13 use base qw{Geo::Leaflet::Objects};
  2         3  
  2         1038  
5              
6             our $VERSION = '0.03';
7             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 map.
28              
29             =head1 PROPERTIES
30              
31             =head2 llat
32              
33             =cut
34              
35             sub llat {
36 0     0 1   my $self = shift;
37 0 0         $self->{'llat'} = shift if @_;
38 0 0         die("Error: llat required") unless defined $self->{'llat'};
39 0           return $self->{'llat'};
40             }
41              
42             =head2 llon
43              
44             =cut
45              
46             sub llon {
47 0     0 1   my $self = shift;
48 0 0         $self->{'llon'} = shift if @_;
49 0 0         die("Error: llon required") unless defined $self->{'llon'};
50 0           return $self->{'llon'};
51             }
52              
53             =head2 ulat
54              
55             =cut
56              
57             sub ulat {
58 0     0 1   my $self = shift;
59 0 0         $self->{'ulat'} = shift if @_;
60 0 0         die("Error: ulat required") unless defined $self->{'ulat'};
61 0           return $self->{'ulat'};
62             }
63              
64             =head2 ulon
65              
66             =cut
67              
68             sub ulon {
69 0     0 1   my $self = shift;
70 0 0         $self->{'ulon'} = shift if @_;
71 0 0         die("Error: ulon required") unless defined $self->{'ulon'};
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     0 1   my $self = shift;
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             1;