Geo::GoogleEarth::Pluggable::Base - Geo::GoogleEarth::Pluggable Base package


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

Index


Code Index:

NAME

Top

Geo::GoogleEarth::Pluggable::Base - Geo::GoogleEarth::Pluggable Base package

SYNOPSIS

Top

  use base qw{Geo::GoogleEarth::Pluggable::Base};

DESCRIPTION

Top

The is the base of all Geo::GoogleEarth::Pluggable packages.

USAGE

Top

CONSTRUCTOR

Top

new

  my $document = Geo::GoogleEarth::Pluggable->new(key1=>value1,
                                                  key2=>[value=>{opt1=>val1}],
                                                  key3=>{value=>{opt2=>val2}});

METHODS

Top

document

Always returns the document object. Every object should know what document it is in.

name

Sets or returns the name property.

  my $name=$folder->name;
  $placemark->name("New Name");
  $document->name("New Name");

description

Sets or returns the description property.

  my $description=$folder->description;
  $placemark->description("New Description");
  $document->description("New Description");

Snippet

Returns the Snippet used in the Snippet XML element or a Placemark. The default Snippet from Google Earth is to use the first line of the description however this package defaults to a zero line Snippet.

Snippet is rendered with maxLines as the length of the array ref and the content joined with new lines.

Typical use

  $document->Point(Snippet=>"Line 1");
  $document->Point(Snippet=>["Line 1", "Line 2"]);

Extended used

  my $snippet=$placemark->Snippet;                     #[] always array reference
  $placemark->Snippet([]);                             #default
  $placemark->Snippet(["line 1", "line 2", "line 3"]); 
  $placemark->Snippet("My Snippet Text");              #folded into array reference.
  $placemark->Snippet("line 1", "line 2", "line 3");   #folded into array reference

lookat

Sets or returns a Geo::GoogleEarth::Pluggable::LookAt object

BUGS

Top

Please log on RT and send to the geo-perl email list.

SUPPORT

Top

DavisNetworks.com supports all Perl applications including this package.

AUTHOR

Top

  Michael R. Davis (mrdvt92)
  CPAN ID: MRDVT

COPYRIGHT

Top

SEE ALSO

Top

Geo::GoogleEarth::Pluggable creates a GoogleEarth Document.


Geo-GoogleEarth-Pluggable documentation Contained in the Geo-GoogleEarth-Pluggable distribution.
package Geo::GoogleEarth::Pluggable::Base;
use warnings;
use strict;
use base qw{Package::New};

our $VERSION='0.14';

sub document {shift->{"document"}};

sub name {
  my $self=shift;
  $self->{'name'}=shift if @_;
  return $self->{'name'};
}

sub description {
  my $self=shift;
  $self->{'description'}=shift if @_;
  return $self->{'description'};
}

sub Snippet {
  my $self=shift;
  if (@_ == 1) {
    $self->{"Snippet"}=shift;
  } elsif (@_ > 1) {
    $self->{"Snippet"}=[@_];
  }
  #force undef to default empty array reference
  $self->{"Snippet"}=[] unless defined $self->{"Snippet"};
  #force to array reference
  $self->{"Snippet"}=[$self->{"Snippet"}] unless ref($self->{"Snippet"}) eq "ARRAY";
  return $self->{"Snippet"};
}
  
sub lookat {
  my $self=shift;
  $self->{"lookat"}=shift if @_;
  return $self->{"lookat"};
}

1;