Pluggable/Plugin/Default.pm

filter: Statementstmt 81.4% 35 / 43 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 10 / 12 Podpod 100% 5 / 5 totaltotal 83.3% 50 / 60 CC 1 SCAR 1.5
CC
1
Cov
81%
LineString
2.0
LinearRing
2.0
BEGIN
1.0
CRAP 1.2
« Pluggable/Constructor.pm ↑ Summary
1 package Geo::GoogleEarth::Pluggable::Plugin::Default;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use Geo::GoogleEarth::Pluggable::Contrib::Point;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use Geo::GoogleEarth::Pluggable::Contrib::LineString;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use Geo::GoogleEarth::Pluggable::Contrib::LinearRing;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use Geo::GoogleEarth::Pluggable::Contrib::Polygon;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Geo::GoogleEarth::Pluggable::Contrib::MultiPolygon;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 5 our $VERSION='0.17';
11  
12 =head1 NAME
13  
14 Geo::GoogleEarth::Pluggable::Plugin::Default - Geo::GoogleEarth::Pluggable Default Plugin Methods
15  
16 =head1 METHODS
17  
18 Methods in this package are AUTOLOADed into the Geo::GoogleEarth::Pluggable::Folder namespace at runtime.
19  
20 =head1 CONVENTIONS
21  
22 Plugin Naming Convention: Geo::GoogleEarth::Pluggable::Plugin::CPANID (e.g. "MRDVT")
23 Object Naming Convention: Geo::GoogleEarth::Pluggable::Contrib::"$method" (e.g. Point, CircleByCenterPoint)
24  
25 You only need to have one plugin pointing to all of your contributed objects.
26  
27 The package should be named after the plugin not the objects since there is a many to one relationship. (e.g. Geo-GoogleEarth-Pluggable-Plugin-MRDVT)
28  
29 =head2 Point
30  
31 Constructs a new Placemark Point object and appends it to the parent folder object. Returns the object reference if you need to make any setting changes after construction.
32  
33 my $point=$folder->Point(name=>"My Placemark",
34 lat=>38.897607,
35 lon=>-77.036554,
36 alt=>0);
37  
38 =cut
39  
40 2 ▶sub Point {
Subroutine Point: called CC=1 SCAR=0.0
Pod documented
41 2 my $self=shift; #This will be a Geo::GoogleEarth::Pluggable::Folder object
42 2 my $obj=Geo::GoogleEarth::Pluggable::Contrib::Point->new(document=>$self->document, @_);
43 2 $self->data($obj);
44 2 return $obj;
45 }
46  
47 =head2 Polygon
48  
49 $folder->Polygon(
50 name => "My Polygon",
51 coordinates => [
52 [ #outerBoundaryIs
53 [ -95.74356, 29.61974 ],
54 [ -95.74868, 29.62188 ],
55 [ -95.74857, 29.62210 ],
56 [ -95.74256, 29.62266 ],
57 [ -95.74356, 29.61974 ],
58 ],
59 \@innerBoundaryIs1,
60 \@innerBoundaryIs2,
61 \@innerBoundaryIs3,
62 ],
63 style => $style,
64 open => 1,
65 description => $html,
66 ),
67  
68 =cut
69  
70 1 ▶sub Polygon {
Subroutine Polygon: called CC=1 SCAR=0.0
Pod documented
71 1 my $self = shift; #This will be a Geo::GoogleEarth::Pluggable::Folder object
72 1 my $obj = Geo::GoogleEarth::Pluggable::Contrib::Polygon->new(document=>$self->document, @_);
73 1 $self->data($obj);
74 1 return $obj;
75 }
76  
77 =head2 MultiPolygon
78  
79 $folder->MultiPolygon(
80 name => "My MultiPolygon",
81 coordinates => [ #MultiGeometry
82 [ #Polygon1
83 [
84 [ -95.45662, 29.77814 ],
85 [ -95.45668, 29.77809 ],
86 [ -95.45675, 29.77814 ],
87 [ -95.45669, 29.77820 ],
88 [ -95.45662, 29.77814 ],
89 ],
90 \@innerBoundaryIs1,
91 ],
92 [ #Polygon2
93 [
94 [ -95.45677, 29.77785 ],
95 [ -95.45683, 29.77780 ],
96 [ -95.45689, 29.77785 ],
97 [ -95.45683, 29.77791 ],
98 [ -95.45677, 29.77785 ],
99 ],
100 ],
101 ],
102 );
103  
104 =cut
105  
106 1 ▶sub MultiPolygon {
Subroutine MultiPolygon: called CC=1 SCAR=0.0
Pod documented
107 1 my $self = shift; #This will be a Geo::GoogleEarth::Pluggable::Folder object
108 1 my $obj = Geo::GoogleEarth::Pluggable::Contrib::MultiPolygon->new(document=>$self->document, @_);
109 1 $self->data($obj);
110 1 return $obj;
111 }
112  
113 =head2 LineString
114  
115 $folder->LineString(name=>"My Placemark",
116 coordinates=>[
117 [lat,lon,alt],
118 {lat=>$lat,lon=>$lon,alt=>$alt},
119 ]);
120  
121 =cut
122  
123 0 ▶sub LineString {
Subroutine LineString: not called CC=1 SCAR=6.9
Pod documented
124 0 my $self=shift;
125 0 my $obj=Geo::GoogleEarth::Pluggable::Contrib::LineString->new(document=>$self->document, @_);
126 0 $self->data($obj);
127 0 return $obj;
128 }
129  
130 =head2 LinearRing
131  
132 $folder->LinearRing(name=>"My Placemark",
133 coordinates=>[
134 [lat,lon,alt],
135 {lat=>$lat,lon=>$lon,alt=>$alt},
136 ]);
137  
138 =cut
139  
140 0 ▶sub LinearRing {
Subroutine LinearRing: not called CC=1 SCAR=6.9
Pod documented
141 0 my $self=shift;
142 0 my $obj=Geo::GoogleEarth::Pluggable::Contrib::LinearRing->new(document=>$self->document, @_);
143 0 $self->data($obj);
144 0 return $obj;
145 }
146  
147 =head1 TODO
148  
149 Need to determine what methods should be in the Folder package and what should be on the Plugin/Default package and why.
150  
151 =head1 BUGS
152  
153 Please log on RT and send to the geo-perl email list.
154  
155 =head1 SUPPORT
156  
157 DavisNetworks.com supports all Perl applications including this package.
158  
159 =head1 AUTHOR
160  
161 Michael R. Davis (mrdvt92)
162 CPAN ID: MRDVT
163  
164 =head1 COPYRIGHT
165  
166 This program is free software licensed under the...
167  
168 The BSD License
169  
170 The full text of the license can be found in the LICENSE file included with this module.
171  
172 =head1 SEE ALSO
173  
174 L<Geo::GoogleEarth::Pluggable::Contrib::Point>, L<Geo::GoogleEarth::Pluggable::Contrib::LineString>, L<Geo::GoogleEarth::Pluggable::Contrib::LinearRing>
175  
176 =cut
177  
178 5 1;
« Pluggable/Constructor.pm ↑ Summary