File: Geo-GoogleEarth-Pluggable-Point-StyleMapIcon.pl

package info (click to toggle)
libgeo-googleearth-pluggable-perl 0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 882; makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,395 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl
use strict;
use warnings;
use Geo::GoogleEarth::Pluggable;

=head1 NAME

Geo-GoogleEarth-Pluggable-Point-StyleMapIcon.pl - Geo-GoogleEarth-Pluggable Icon StyleMap Example

=cut

my $type=shift || "kml";

my $document=Geo::GoogleEarth::Pluggable->new(name=>"StyleMap Example");

my $style1=$document->IconStyle(
               color   => {red=>0, green=>0, blue=>192},
               href    => "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png",
                                );

my $style2=$document->IconStyle(
               color   => {red=>0, green=>192, blue=>0},
               href    => "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png",
                                );

my $stylemap=$document->StyleMap(normal=>$style1, highlight=>$style2);

$document->Point(
             name  => "Style1 Point",
             lat   =>  38.893873,
             lon   => -77.037579,
             style => $style1,
           );

$document->Point(
             name  => "StyleMap Point",
             lat   =>  38.893873,
             lon   => -77.036579,
             style => $stylemap,
           );

$document->Point(
             name  => "Style2 Point",
             lat   =>  38.893873,
             lon   => -77.035579,
             style => $style2,
           );

if ($type eq "kmz") {
  print $document->archive;
} else {
  print $document->render;
}