| 1 | package Geo::GoogleEarth::Pluggable::LookAt; | ||||||||||
| 2 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 7 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 7 | ▶ | use base qw{Geo::GoogleEarth::Pluggable::Constructor}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 7 | ▶ | use XML::LibXML::LazyBuilder qw{E}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 7 | our $VERSION='0.17'; | |||||||||
| 8 | |||||||||||
| 9 | =head1 NAME | ||||||||||
| 10 | |||||||||||
| 11 | Geo::GoogleEarth::Pluggable::LookAt - Geo::GoogleEarth::Pluggable LookAt package | ||||||||||
| 12 | |||||||||||
| 13 | =head1 SYNOPSIS | ||||||||||
| 14 | |||||||||||
| 15 | my $lookat=$document->LookAt( | ||||||||||
| 16 | latitude => 38.1741527, | ||||||||||
| 17 | longitude => -96.7839388, | ||||||||||
| 18 | range => 3525808, | ||||||||||
| 19 | heading => 0, | ||||||||||
| 20 | tilt => 0, | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | Assign LookAt during construction | ||||||||||
| 24 | |||||||||||
| 25 | my $folder=$document->Folder(name=>"MyLook", lookat=>$lookat); | ||||||||||
| 26 | my $point=$folder->Point(lat=>$lat, lon=>$lon, lookat=>$lookat); | ||||||||||
| 27 | |||||||||||
| 28 | Assign LookAt afer construction | ||||||||||
| 29 | |||||||||||
| 30 | $document->lookat($lookat); | ||||||||||
| 31 | $folder->lookat($lookat); | ||||||||||
| 32 | $point->lookat($lookat); | ||||||||||
| 33 | |||||||||||
| 34 | Do it all at one time | ||||||||||
| 35 | |||||||||||
| 36 | my $point=$folder->Point(lat => $lat, | ||||||||||
| 37 | lon => $lon, | ||||||||||
| 38 | lookat => $document->LookAt(%data)); | ||||||||||
| 39 | |||||||||||
| 40 | =head1 DESCRIPTION | ||||||||||
| 41 | |||||||||||
| 42 | Provides a way to configure a LookAt for all Folders and Placemarks. | ||||||||||
| 43 | |||||||||||
| 44 | =head1 USAGE | ||||||||||
| 45 | |||||||||||
| 46 | =head1 CONSTRUCTOR | ||||||||||
| 47 | |||||||||||
| 48 | All Folder objects have a LookAt constructor. | ||||||||||
| 49 | |||||||||||
| 50 | my $object=$document->LookAt(%data); | ||||||||||
| 51 | my $object=$folder->LookAt(%data); | ||||||||||
| 52 | |||||||||||
| 53 | =head2 new | ||||||||||
| 54 | |||||||||||
| 55 | =head2 type | ||||||||||
| 56 | |||||||||||
| 57 | Returns the object type. | ||||||||||
| 58 | |||||||||||
| 59 | my $type=$lookat->type; | ||||||||||
| 60 | |||||||||||
| 61 | |||||||||||
| 62 | =cut | ||||||||||
| 63 | |||||||||||
| 64 | 0 | ▶ | sub type {'LookAt'}; | ||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 65 | |||||||||||
| 66 | =head2 latitude | ||||||||||
| 67 | |||||||||||
| 68 | =cut | ||||||||||
| 69 | |||||||||||
| 70 | 0 | ▶ | sub latitude { | ||||||||
|
Subroutine
latitude: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 71 | 0 | my $self=shift; | |||||||||
| 72 | 0 | ▶ | $self->{'latitude'}=shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 73 | 0 | return $self->{'latitude'}; | |||||||||
| 74 | } | ||||||||||
| 75 | |||||||||||
| 76 | =head2 longitude | ||||||||||
| 77 | |||||||||||
| 78 | =cut | ||||||||||
| 79 | |||||||||||
| 80 | 0 | ▶ | sub longitude { | ||||||||
|
Subroutine
longitude: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 81 | 0 | my $self=shift; | |||||||||
| 82 | 0 | ▶ | $self->{'longitude'}=shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 83 | 0 | return $self->{'longitude'}; | |||||||||
| 84 | } | ||||||||||
| 85 | |||||||||||
| 86 | =head2 range | ||||||||||
| 87 | |||||||||||
| 88 | =cut | ||||||||||
| 89 | |||||||||||
| 90 | 0 | ▶ | sub range { | ||||||||
|
Subroutine
range: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 91 | 0 | my $self=shift; | |||||||||
| 92 | 0 | ▶ | $self->{'range'}=shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 93 | 0 | return $self->{'range'}; | |||||||||
| 94 | } | ||||||||||
| 95 | |||||||||||
| 96 | =head2 tilt | ||||||||||
| 97 | |||||||||||
| 98 | =cut | ||||||||||
| 99 | |||||||||||
| 100 | 0 | ▶ | sub tilt { | ||||||||
|
Subroutine
tilt: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 101 | 0 | my $self=shift; | |||||||||
| 102 | 0 | ▶ | $self->{'tilt'}=shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 103 | 0 | return $self->{'tilt'}; | |||||||||
| 104 | } | ||||||||||
| 105 | |||||||||||
| 106 | =head2 heading | ||||||||||
| 107 | |||||||||||
| 108 | =cut | ||||||||||
| 109 | |||||||||||
| 110 | 0 | ▶ | sub heading { | ||||||||
|
Subroutine
heading: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 111 | 0 | my $self=shift; | |||||||||
| 112 | 0 | ▶ | $self->{'heading'}=shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 113 | 0 | return $self->{'heading'}; | |||||||||
| 114 | } | ||||||||||
| 115 | |||||||||||
| 116 | =head2 node | ||||||||||
| 117 | |||||||||||
| 118 | Returns the L<XML::LibXML::LazyBuilder> element for the LookAt object. | ||||||||||
| 119 | |||||||||||
| 120 | =cut | ||||||||||
| 121 | |||||||||||
| 122 | 0 | ▶ | sub node { | ||||||||
|
Subroutine
node: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 123 | 0 | my $self=shift; | |||||||||
| 124 | 0 | my @elements=(); | |||||||||
| 125 | 0 | my %skip=map {$_=>1} qw{document}; | |||||||||
| 126 | 0 | foreach my $key (sort keys %$self) { | |||||||||
| 127 | 0 | ▶ | next if exists $skip{$key}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 128 | 0 | push @elements, E($key => {}, $self->{$key}); | |||||||||
| 129 | } | ||||||||||
| 130 | 0 | return E(LookAt => {}, @elements); | |||||||||
| 131 | } | ||||||||||
| 132 | |||||||||||
| 133 | =head1 BUGS | ||||||||||
| 134 | |||||||||||
| 135 | Please log on RT and send to the geo-perl email list. | ||||||||||
| 136 | |||||||||||
| 137 | =head1 SUPPORT | ||||||||||
| 138 | |||||||||||
| 139 | DavisNetworks.com supports all Perl applications including this package. | ||||||||||
| 140 | |||||||||||
| 141 | =head1 AUTHOR | ||||||||||
| 142 | |||||||||||
| 143 | Michael R. Davis (mrdvt92) | ||||||||||
| 144 | CPAN ID: MRDVT | ||||||||||
| 145 | |||||||||||
| 146 | =head1 COPYRIGHT | ||||||||||
| 147 | |||||||||||
| 148 | This program is free software licensed under the... | ||||||||||
| 149 | |||||||||||
| 150 | The BSD License | ||||||||||
| 151 | |||||||||||
| 152 | The full text of the license can be found in the LICENSE file included with this module. | ||||||||||
| 153 | |||||||||||
| 154 | =head1 SEE ALSO | ||||||||||
| 155 | |||||||||||
| 156 | L<Geo::GoogleEarth::Pluggable> creates a GoogleEarth Document. | ||||||||||
| 157 | |||||||||||
| 158 | =cut | ||||||||||
| 159 | |||||||||||
| 160 | 7 | 1; | |||||||||