File: Geo-GoogleEarth-Pluggable-Point-StyleIcon.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 (35 lines) | stat: -rw-r--r-- 1,012 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
#!/usr/bin/perl
use strict;
use warnings;
use Geo::GoogleEarth::Pluggable;
use DateTime;

=head1 NAME

Geo-GoogleEarth-Pluggable-Point-StyleIcon.pl - Geo-GoogleEarth-Pluggable Icon Style Example

=cut

my $type=shift || "kml";
my $document=Geo::GoogleEarth::Pluggable->new(name=>sprintf("Style Example - %s", DateTime->now));

my $IconStyleBlueDot=$document->IconStyle( #This is also simply IconStyleBlueDot()
               color   => {red=>0, green=>0, blue=>192},
               scale   => 1.2,
               href    => "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png",
               hotSpot => {x=>20,y=>2,xunits=>"pixels",yunits=>"pixels"},
                                );

my $point=$document->Point(
                       name  => "Blue Point",
                       lat   =>  39.1,
                       lon   => -77.1,
                       style => $IconStyleBlueDot,
                     );


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