| Geo-GoogleEarth-Document documentation | Contained in the Geo-GoogleEarth-Document distribution. |
Geo::GoogleEarth::Document::Style - Geo::GoogleEarth::Document::Style
use Geo::GoogleEarth::Document; my $document=Geo::GoogleEarth::Document->new(); $document->Style();
Geo::GoogleEarth::Document::Style is a Geo::GoogleEarth::Document::Base with a few other methods.
my $style=$document->Style(id=>"Style_Internal_HREF",
iconHref=>"http://.../path/image.png");
my $style=$document->Style(id=>"Style_Internal_HREF",
iconHref=>"http://.../path/image.png");
Returns the object type.
my $type=$style->type;
Returns a hash reference for feeding directly into XML::Simple.
my $structure=$style->structure;
Try geo-perl email list.
Michael R. Davis (mrdvt92)
CPAN ID: MRDVT
This program is free software licensed under the...
The BSD License
The full text of the license can be found in the LICENSE file included with this module.
Geo::GoogleEarth::Document creates a GoogleEarth KML Document.
| Geo-GoogleEarth-Document documentation | Contained in the Geo-GoogleEarth-Document distribution. |
package Geo::GoogleEarth::Document::Style; use strict; use base qw{Geo::GoogleEarth::Document::Base}; BEGIN { use vars qw($VERSION); $VERSION = '0.01'; }
sub type { my $self=shift(); return "Style"; }
sub structure { my $self=shift(); #{ # 'Style' => { # 'IconStyle' => { # 'Icon' => { # 'href' => 'http://maps.google.com/mapfiles/kml/paddle/L.png' # } # }, # 'id' => 'http://maps.google.com/mapfiles/kml/paddle/L.png' # } # }; my $structure={id=>$self->id}; my %skip=map {$_=>1} (qw{id iconHref}); if (defined($self->iconHref)) { $structure->{'IconStyle'} = [{Icon=> [{href=>[$self->iconHref]}]}]; } foreach my $key (keys %$self) { next if exists $skip{$key}; $structure->{$key} = {content=>$self->function($key)}; } my %options=$self->options; foreach my $key (keys %options) { my $hash=$structure->{$key}||{}; my @hash=%$hash; push @hash, %{$self->options->{$key}}; $structure->{$key}={@hash}; } return $structure; }
sub id { my $self=shift(); $self->{'id'}=shift() if (@_); return $self->{'id'}; }
sub iconHref { my $self=shift(); $self->{'iconHref'}=shift() if (@_); return $self->{'iconHref'}; }
1;