Geo::GoogleEarth::Pluggable::Contrib::Point - Geo::GoogleEarth::Pluggable Point Object


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

Index


Code Index:

NAME

Top

Geo::GoogleEarth::Pluggable::Contrib::Point - Geo::GoogleEarth::Pluggable Point Object

SYNOPSIS

Top

  use Geo::GoogleEarth::Pluggable;
  my $document=Geo::GoogleEarth::Pluggable->new();
  $document->Point();

DESCRIPTION

Top

Geo::GoogleEarth::Pluggable::Contrib::Point is a Geo::GoogleEarth::Pluggable::Placemark with a few other methods.

USAGE

Top

  my $placemark=$document->Point(name=>"Point Name",
                                 lat=>$lat,
                                 lon=>$lon,
                                 alt=>$alt);

CONSTRUCTOR

Top

new

  my $placemark=$document->Point(
              name       => "White House",
              lat        => 38.89769,       #signed decimal degrees WGS-84
              lon        => -77.036549,     #signed decimal degrees WGS-84
              alt        => 30,             #meters above ellipsoid WGS-84
            );

METHODS

Top

subnode

lat

Sets or returns latitude. The format is signed decimal degrees WGS-84.

  my $lat=$placemark->lat;

lon

Sets or returns longitude. The format is signed decimal degrees WGS-84.

  my $lon=$placemark->lon;

alt

Sets or returns altitude. The units are meters above the ellipsoid WGS-84.

  my $alt=$placemark->alt;

Typically, Google Earth "snaps" Placemarks to the surface regardless of how the altitude is set.

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, XML::LibXML::LazyBuilder, Geo::GoogleEarth::Pluggable::Placemark


Geo-GoogleEarth-Pluggable documentation Contained in the Geo-GoogleEarth-Pluggable distribution.
package Geo::GoogleEarth::Pluggable::Contrib::Point;
use base qw{Geo::GoogleEarth::Pluggable::Placemark};
use XML::LibXML::LazyBuilder qw{E};
use warnings;
use strict;

our $VERSION='0.13';

sub subnode {
  my $self=shift;
  my $coordinates=join(",", $self->lon+0, $self->lat+0, $self->alt+0);
  return E(Point=>{}, E(coordinates=>{}, $coordinates));
}

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

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

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

1;