Geo::Google::Latitude::Badge - Retrieves a Google Latitude Public Location Badge


Geo-Google-Latitude documentation Contained in the Geo-Google-Latitude distribution.

Index


Code Index:

NAME

Top

Geo::Google::Latitude::Badge - Retrieves a Google Latitude Public Location Badge

SYNOPSIS

Top

  use Geo::Google::Latitude;
  my $gl=Geo::Google::Latitude->new;
  my $id=7832225593622256926;
  my $badge=$gl->get($id); #ISA Geo::Google::Latitude::Badge

DESCRIPTION

Top

USAGE

Top

METHODS

Top

id

error

Returns if there was an HTTP error

status

Return the HTTP status line

lat

lon

timeStamp

accuracyInMeters

reverseGeocode

photoImg

Returns the <img /> tag for the photo.

photoUrl

photoWidth

photoHeight

placardImg

Returns the <img /> tag for the placard.

placardUrl

placardWidth

placardHeight

point

Returns a GPS::Point object

BUGS

Top

Log and send to Geo Perl.

SUPPORT

Top

Try Geo Perl.

AUTHOR

Top

    Michael R. Davis
    CPAN ID: MRDVT
    STOP, LLC
    domain=>michaelrdavis,tld=>com,account=>perl
    http://www.stopllc.com/

COPYRIGHT

Top

SEE ALSO

Top

http://www.ruwenzori.net/code/latitude2brightkite/, GPS::Point, Geo::Google::Latitude, Geo::GoogleEarth::Document


Geo-Google-Latitude documentation Contained in the Geo-Google-Latitude distribution.
package Geo::Google::Latitude::Badge;
use strict;
use warnings;
use base qw{Geo::Google::Latitude::Base};
use GPS::Point;

our $VERSION='0.05';

sub id {
  my $self=shift;
  return $self->{"properties"}->{"id"};
}

sub error {
  my $self=shift;
  return $self->{"error"};
}

sub status {
  my $self=shift;
  return $self->{"status"};
}

sub lat {
  my $self=shift;
  return $self->{"geometry"}->{"coordinates"}->[1];
}

sub lon {
  my $self=shift;
  return $self->{"geometry"}->{"coordinates"}->[0];
}

sub timeStamp {
  my $self=shift;
  return $self->{"properties"}->{"timeStamp"};
}

sub accuracyInMeters {
  my $self=shift;
  return $self->{"properties"}->{"accuracyInMeters"};
}

sub reverseGeocode {
  my $self=shift;
  return $self->{"properties"}->{"reverseGeocode"};
}

sub photoImg {
  my $self=shift;
  return sprintf(qq{<img src="%s" height="%s" width="%s" alt="%s"/>}, $self->photoUrl, $self->photoHeight, $self->photoWidth, $self->id);
}

sub photoUrl {
  my $self=shift;
  return $self->{"properties"}->{"photoUrl"};
}

sub photoWidth {
  my $self=shift;
  return $self->{"properties"}->{"photoWidth"};
}

sub photoHeight {
  my $self=shift;
  return $self->{"properties"}->{"photoHeight"};
}

sub placardImg {
  my $self=shift;
  return sprintf(qq{<img src="%s" height="%s" width="%s" alt="%s"/>}, $self->placardUrl, $self->placardHeight, $self->placardWidth, $self->reverseGeocode);
}

sub placardUrl {
  my $self=shift;
  return $self->{"properties"}->{"placardUrl"};
}

sub placardWidth {
  my $self=shift;
  return $self->{"properties"}->{"placardWidth"};
}

sub placardHeight {
  my $self=shift;
  return $self->{"properties"}->{"placardHeight"};
}

sub point {
  my $self=shift;
  unless (defined($self->{"point"})) {
    #Fortunately all units match between APIs
    $self->{"point"}=GPS::Point->new(lat=>$self->lat,
                                     lon=>$self->lon,
                                     time=>$self->timeStamp,
                                     ehorizontal=>$self->accuracyInMeters);
  }
  return $self->{"point"};
}

1;