| 1 | package Geo::GoogleEarth::Pluggable::StyleMap; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use base qw{Geo::GoogleEarth::Pluggable::StyleBase}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use Scalar::Util qw{blessed}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use XML::LibXML::LazyBuilder qw{E}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | our $VERSION='0.17'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | our $PACKAGE=__PACKAGE__; | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | Geo::GoogleEarth::Pluggable::StyleMap - Geo::GoogleEarth::Pluggable StyleMap Object | ||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | use Geo::GoogleEarth::Pluggable; | ||||||||||||||||||||||||||||||||||||||||||
| 18 | my $document=Geo::GoogleEarth::Pluggable->new; | ||||||||||||||||||||||||||||||||||||||||||
| 19 | my $style=$document->StyleMap(%data); | ||||||||||||||||||||||||||||||||||||||||||
| 20 | print $document->render; | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | Geo::GoogleEarth::Pluggable::StyleMap is a L<Geo::GoogleEarth::Pluggable::Base> with a few other methods. | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | =head1 USAGE | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | my $style=$document->StyleMap( | ||||||||||||||||||||||||||||||||||||||||||
| 29 | normal => $style1, | ||||||||||||||||||||||||||||||||||||||||||
| 30 | highlight => $style2, | ||||||||||||||||||||||||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | =head1 CONSTRUCTOR | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | =head2 new | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | my $style=$document->StyleMap; | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | =head1 METHODS | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | =head2 type | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | Returns the object type. | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | my $type=$style->type; | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | sub type {"StyleMap"}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | =head2 node | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | Generates XML that looks like this. | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | <StyleMap id="StyleMap-perl-69"> | ||||||||||||||||||||||||||||||||||||||||||
| 56 | <Pair> | ||||||||||||||||||||||||||||||||||||||||||
| 57 | <key>normal</key> | ||||||||||||||||||||||||||||||||||||||||||
| 58 | <styleUrl>#Style-perl-19</styleUrl> | ||||||||||||||||||||||||||||||||||||||||||
| 59 | </Pair> | ||||||||||||||||||||||||||||||||||||||||||
| 60 | <Pair> | ||||||||||||||||||||||||||||||||||||||||||
| 61 | <key>highlight</key> | ||||||||||||||||||||||||||||||||||||||||||
| 62 | <styleUrl>#Style-perl-11</styleUrl> | ||||||||||||||||||||||||||||||||||||||||||
| 63 | </Pair> | ||||||||||||||||||||||||||||||||||||||||||
| 64 | </StyleMap> | ||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | sub node { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
node: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | my $self=shift; | |||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | my @element=(); | |||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | foreach my $key (keys %$self) { | |||||||||||||||||||||||||||||||||||||||||
| 72 | #$key should be either "normal" or "highlight" | ||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | next if $key eq "document"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | ▶ | next if $key eq "id"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | ▶ | my $value=$self->{$key}||''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{$key} || ''
MC/DC0%0/1
$self->{$key} || ''
$self->{$key}
Truth table0%0/2
A
A= $self->{$key}
| |||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | if (blessed($value) and $value->can("type") and $value->type=~m/^Style/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
builtin::blessed($value) and $value->can("type") and $value->type =~ /^Style/
builtin::blessed($value) and $value->can("type")
MC/DC0%0/3
builtin::blessed($value) and $value->can("type") and $value->type =~ /^Style/
builtin::blessed($value)
$value->can("type")
$value->type =~ /^Style/
Truth table0%0/4
A and B and C
A= builtin::blessed($value)B= $value->can("type")C= $value->type =~ /^Style/
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | $value=$value->url; | |||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | push @element, E(Pair=>{}, E(key=>{}, $key), E(styleUrl=>{}, $value)); | |||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | return E(StyleMap=>{id=>$self->id}, @element); | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | =head1 BUGS | ||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||
| 86 | Please log on RT and send to the geo-perl email list. | ||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | Try geo-perl email list. | ||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||
| 92 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | Michael R. Davis (mrdvt92) | ||||||||||||||||||||||||||||||||||||||||||
| 95 | CPAN ID: MRDVT | ||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||
| 97 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||
| 99 | This program is free software licensed under the... | ||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||
| 101 | The BSD License | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | The full text of the license can be found in the | ||||||||||||||||||||||||||||||||||||||||||
| 104 | LICENSE file included with this module. | ||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | L<Geo::GoogleEarth::Pluggable>, L<XML::LibXML::LazyBuilder>, L<Scalar::Util> | ||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||
| 110 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||
| 112 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||