Geo::GoogleEarth::Document::Style - Geo::GoogleEarth::Document::Style


Geo-GoogleEarth-Document documentation Contained in the Geo-GoogleEarth-Document distribution.

Index


Code Index:

NAME

Top

Geo::GoogleEarth::Document::Style - Geo::GoogleEarth::Document::Style

SYNOPSIS

Top

  use Geo::GoogleEarth::Document;
  my $document=Geo::GoogleEarth::Document->new();
  $document->Style();

DESCRIPTION

Top

Geo::GoogleEarth::Document::Style is a Geo::GoogleEarth::Document::Base with a few other methods.

USAGE

Top

  my $style=$document->Style(id=>"Style_Internal_HREF",
                             iconHref=>"http://.../path/image.png");

CONSTRUCTOR

Top

new

  my $style=$document->Style(id=>"Style_Internal_HREF",
                             iconHref=>"http://.../path/image.png");

METHODS

Top

type

Returns the object type.

  my $type=$style->type;

structure

Returns a hash reference for feeding directly into XML::Simple.

  my $structure=$style->structure;

id

iconHref

BUGS

Top

SUPPORT

Top

Try geo-perl email list.

AUTHOR

Top

    Michael R. Davis (mrdvt92)
    CPAN ID: MRDVT

COPYRIGHT

Top

SEE ALSO

Top

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;