Ham-WorldMap

 view release on metacpan or  search on metacpan

lib/Ham/WorldMap.pm  view on Meta::CPAN


# Hate that Perl doesn't define these....
use constant TRUE => 1;
use constant FALSE => 0;


sub new {
    my $class = shift;
    my %init = @_;

    my $mapPngFile = dist_file('Ham-WorldMap', 'grey-map.png');
    die "Cannot locate shared data file $mapPngFile" unless -f $mapPngFile;

    my $mapImage = Imager->new();
    $mapImage->read(file => $mapPngFile) or die "Could not read map $mapPngFile: " . $mapImage->errstr;
    $mapImage = $mapImage->convert(preset => 'addalpha');

    my $locator = Ham::Locator->new();

    my $grey = Imager::Color->new(64, 64, 64);

    my $fontFile = $init{'fontFile'} || "/Library/Fonts/Microsoft/Lucida Console.ttf";

    my $font = Imager::Font->new(file => $fontFile);



( run in 0.857 second using v1.01-cache-2.11-cpan-0a6323c29d9 )