The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Flickr::Geo::YahooMaps - tools for working with geotagged Flickr photos and Yahoo! Maps

SYNOPSIS

 my %opts = ();
 getopts('c:i:', \%opts);

 my $cfg = Config::Simple->new($opts{'c'});

 my $fl = Net::Flickr::Geo::YahooMaps->new($cfg);
 $fl->log()->add(Log::Dispatch::Screen->new('name' => 'scr', min_level => 'info'));

 my @map = $fl->mk_pinwin_map_for_photo($opts{'i'});
 print Dumper(\@map);

 # returns :
 # ['/tmp/GGsf4552h.jpg', '99999992'];

DESCRIPTION

Tools for working with geotagged Flickr photos and Yahoo! Maps

OPTIONS

Options are passed to Net::Flickr::Backup using a Config::Simple object or a valid Config::Simple config file. Options are grouped by "block".

flickr

  • api_key

    String. required

    A valid Flickr API key.

  • api_secret

    String. required

    A valid Flickr Auth API secret key.

  • auth_token

    String. required

    A valid Flickr Auth API token.

    The api_handler defines which XML/XPath handler to use to process API responses.

    • LibXML

      Use XML::LibXML.

    • XPath

      Use XML::XPath.

pinwin

  • map_height

    The height of the background map on which the pinwin/thumbnail will be placed.

    Default is 1024.

  • map_width

    The width of the background map on which the pinwin/thumbnail will be placed.

    Default is 1024.

  • upload

    Boolean.

    Automatically upload newly create map images to Flickr. Photos will be tagged with the following machine tags :

    • flickr:photo=photo_id

      Where photo_id is the photo that has been added to the map image.

    • flickr:map=pinwin

    Default is false.

  • upload_public

    Boolean.

    Mark pinwin uploads to Flickr as viewable by anyone.

    Default is false.

  • upload_friend

    Boolean.

    Mark pinwin uploads to Flickr as viewable only by friends.

    Default is false.

  • upload_family

    Boolean.

    Mark pinwin uploads to Flickr as viewable only by family.

    Default is false.

  • zoom

    Int.

    By default, the object will try to map the (Flickr) accuracy to the corresponding zoom level of the Modest Maps provider you have chosen. If this option is defined then it will be used as the zoom level regardless of what Flickr says.

  • skip_photos

    Int (or array reference of ints)

    Used by photoset related object methods, a list of photos to exclude from the list returned by the Flickr API.

  • skip_tags

    String (or array reference of strings)

    Used by photoset related object methods, a list of tags that all photos must not have if they are to be included in the final output.

  • ensure_tags

    String (or array reference of strings)

    Used by photoset related object methods, a list of tags that all photos must have if they are to be included in the final output.

yahoo

  • appid

    A valid Yahoo! developers API key.

  • map_radius

    Set the Yahoo! Map Image API 'radius' property. From the docs :

    "How far (in miles) from the specified location to display on the map."

    Default is none, and to use a zoom level that maps to the accuracy property of a photo.

PACKAGE METHODS

__PACKAGE__->new($cfg)

Returns a Net::Flickr::Geo object.

OBJECT METHODS

$obj->mk_pinwin_map_for_photo($photo_id)

Fetch a map using the Yahoo! Map Image API for a geotagged Flickr photo and place a "pinwin" style thumbnail of the photo over the map's marker.

Returns an array of arrays (kind of pointless really, but at least consistent).

The first element of the (second-level) array will be the path to the newly created map image. If uploads are enabled the newly created Flickr photo ID will be passed as the second element.

$obj->mk_pinwin_maps_for_photoset($photoset_id)

For each geotagged photo in a set, fetch a map using the Yahoo! Map Image API for a geotagged Flickr photo and place a "pinwin" style thumbnail of the photo over the map's marker.

If uploads are enabled then each map for a given photo will be added such that it appears before the photo it references.

Returns an array of arrays.

The first element of each (second-level) array reference will be the path to the newly created map image. If uploads are enabled the newly created Flickr photo ID will be passed as the second element.

VERSION

0.72

DATE

$Date: 2008/08/03 17:08:40 $

AUTHOR

Aaron Straup Cope <ascope@cpan.org>

REQUIREMENTS

Sadly, this still requires that you have a command-line version of ImageMagick installed to have the pinwin marker successfully composited on to the map.

The transparency is otherwise not honoured by either GD or Imager. Please for your patches or cluebats...

NOTES

All uploads to Flickr are marked with a content-type of "other".

SEE ALSO

Net::Flickr::Geo

http://developer.yahoo.com/maps/rest/V1/mapImage.html

BUGS

Sure, why not.

Please report all bugs via http://rt.cpan.org

LICENSE

Copyright (c) 2007-2008 Aaron Straup Cope. All Rights Reserved.

This is free software. You may redistribute it and/or modify it under the same terms as Perl itself.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 80:

'=item' outside of any '=over'

Around line 165:

You forgot a '=back' before '=head2'