Geo::GoogleEarth::Pluggable::NetworkLink - Geo::GoogleEarth::Pluggable::NetworkLink


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

Index


Code Index:

NAME

Top

Geo::GoogleEarth::Pluggable::NetworkLink - Geo::GoogleEarth::Pluggable::NetworkLink

SYNOPSIS

Top

  use Geo::GoogleEarth::Pluggable;
  my $document=Geo::GoogleEarth::Pluggable->new;
  $document->NetworkLink(url=>"./anotherdocument.cgi");

DESCRIPTION

Top

Geo::GoogleEarth::Pluggable::NetworkLink is a Geo::GoogleEarth::Pluggable::Base with a few other methods.

USAGE

Top

  my $networklink=$document->NetworkLink(name=>"My NetworkLink",
                                         url=>"./anotherdocument.cgi");

type

Returns the object type.

  my $type=$networklink->type;

node

url

Sets or returns the Uniform Resource Locator (URL) for the NetworkLink

  my $url=$networklink->url;
  $networklink->url("./newdoc.cgi");

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::NetworkLink;
use base qw{Geo::GoogleEarth::Pluggable::Base};
use XML::LibXML::LazyBuilder qw{E};
use warnings;
use strict;

our $VERSION='0.14';

sub type {"NetworkLink"};

sub node {
  my $self=shift;
  my @element=(E(Snippet=>{maxLines=>scalar(@{$self->Snippet})}, join("\n", @{$self->Snippet})));
  my @link=();
  my %link=map {$_=>1} qw{href refreshMode refreshInterval viewRefreshMode viewRefreshTime viewBoundScale viewFormat httpQuery};
  foreach my $key (keys %$self) {
    next if $key eq "Snippet";
    if ($key eq "url") { 
      push @link, E(href=>{}, $self->url);
    } elsif(exists $link{$key}) { #these go in the Link element
      push @link, E($key=>{}, $self->{$key}) unless ref($self->{$key});
    } else {
      push @element, E($key=>{}, $self->{$key}) unless ref($self->{$key});
    }
  }
  push @element, E(Link=>{}, @link) if @link;
  return E(NetworkLink=>{}, @element);
}

sub url {
  my $self=shift();
  if (@_) {
    $self->{'url'}=shift();
  }
  return defined($self->{'url'}) ? $self->{'url'} : 'http://localhost/';
}

1;