line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::GoogleEarth::Pluggable::StyleMap; |
2
|
1
|
|
|
1
|
|
6
|
use base qw{Geo::GoogleEarth::Pluggable::StyleBase}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
84
|
|
3
|
1
|
|
|
1
|
|
5
|
use Scalar::Util qw{blessed}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
4
|
use XML::LibXML::LazyBuilder qw{E}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
6
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
229
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION='0.17'; |
9
|
|
|
|
|
|
|
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 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
|
|
|
0
|
1
|
|
sub type {"StyleMap"}; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 node |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Generates XML that looks like this. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
normal |
58
|
|
|
|
|
|
|
#Style-perl-19 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
highlight |
62
|
|
|
|
|
|
|
#Style-perl-11 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub node { |
69
|
0
|
|
|
0
|
1
|
|
my $self=shift; |
70
|
0
|
|
|
|
|
|
my @element=(); |
71
|
0
|
|
|
|
|
|
foreach my $key (keys %$self) { |
72
|
|
|
|
|
|
|
#$key should be either "normal" or "highlight" |
73
|
0
|
0
|
|
|
|
|
next if $key eq "document"; |
74
|
0
|
0
|
|
|
|
|
next if $key eq "id"; |
75
|
0
|
|
0
|
|
|
|
my $value=$self->{$key}||''; |
76
|
0
|
0
|
0
|
|
|
|
if (blessed($value) and $value->can("type") and $value->type=~m/^Style/) { |
|
|
|
0
|
|
|
|
|
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, L, L |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |