Image-Maps-Plot-FromLatLong
view release on metacpan or search on metacpan
FromLatLong.pm view on Meta::CPAN
package Image::Maps::Plot::FromLatLong; # where in the world are London.pm members?
our $VERSION = 0.12;
our $DATE = "Thu 17 November 18:50 2004";
use 5.006;
use strict;
use warnings;
use Image::Magick;
use File::Basename;
use Data::Dumper;
use Config;
=head1 NAME
Image::Maps::Plot::FromLatLong - plots points on Mercator Projection world/regional map
FromLatLong.pm view on Meta::CPAN
}
#
# Just loads the map specified in the FILE field of MAP array
# field specified by the calling object's MAP field.
#
sub _load_map { my $self=shift;
$self->{IM} = Image::Magick->new;
my $err = $self->{IM}->Read($MAPS{$self->{MAP}}->{FILE});
warn "Load map error: $err ($!)" if $err;
return $err? undef:1;
}
=head1 METHOD all (base_path,base_url,title, blurb)
A method that produces all available maps, and an index page with thumbnails.
FromLatLong.pm view on Meta::CPAN
=over 4
=item FILE
scalar file name of Mercator Projection map.
=item DIM
anon array of dimensions of map in pixels [x,y].
You could create DIM on the fly using C<Image::Magick>, but there's probably no point, as you're
almost certainly going to have to edit the map to align it with longitude and latitude
(if you find a stock of public-domain maps that are already aligned, please drop
the author a line).
=item SPOTSIZE
scalar number for the size of the map-marker spots, in pixels
=item ANCHOR_PIXELS
FromLatLong.pm view on Meta::CPAN
All images must be JPEGs - PNG or other support could easily be added.
=head1 REVSIONS
=over 4
=item 1.2
Corrected a slight mis-positioning of points.
Replaced GD with Image::Magick as I was seeing terrible JPEG output
with GD.
Replaced support for non-maintained C<Image::GD::Thumbnail> with
C<Image::Thumbnail>; evaluate a require of this at run time rather
than using the apparently still shakey pragmas.
Added methods to create just images and to return references to image blobs.
=item 1.0
FromLatLong.pm view on Meta::CPAN
Added more documentation; escaping of href text
=item 0.22
Added thumbnail images to index page
=back
=head1 SEE ALSO
perl(1); L<Image::Magick|http://www.ImageMagick.org> (C<http://www.ImageMagick.org>); L<File::Basename>; L<Acme::Pony>; L<Data::Dumper>; L<WWW::MapBlast>; L<Image::Thumbnail>
=head1 THANKS
Thanks to the London.pm group for their test data and insipration, to Leon for his patience with all that mess on the list, to Philip Newton for his frankly amazing knowledge of international postcodes.
Thanks also to the CIA, L<About.com|http://wwww.about.com>, L<The University of Texas|http://www.lib.utexas.edu/maps>,
and L<The Ordnance Survey|http://www.ordsvy.gov.uk/freegb/index.htm#maps>
for their public-domain maps.
=head1 AUTHOR
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Image-Maps-Plot-FromLatLong
version: 0.12
version_from: FromLatLong.pm
installdirs: site
requires:
Data::Dumper: 0.01
File::Basename: 0.01
Image::Magick: 0.01
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.21
Makefile.PL view on Meta::CPAN
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Image::Maps::Plot::FromLatLong',
'VERSION_FROM' => 'FromLatLong.pm',
'PREREQ_PM' => {
Image::Magick => 0.01,
File::Basename => 0.01,
Data::Dumper => 0.01,
},
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'FromLatLong.pm',
AUTHOR => 'Lee Goddard <lgoddard-at-cpan.org>')
: ()
),
);
this isn't quite right - see the NOTES ON LATITUDE AND
LONGITUDE entry elsewhere in this document. This will be
adjusted in a later version.
All images must be JPEGs - PNG or other support could
easily be added.
REVSIONS
1.2 Corrected a slight mis-positioning of points.
Replaced GD with Image::Magick as I was seeing
terrible JPEG output
with GD.
Replaced support for non-maintained
"Image::GD::Thumbnail" with "Image::Thumbnail";
evaluate a require of this at run time rather than
using the apparently still shakey pragmas.
Added methods to create just images and to return
references to image blobs.
0.25
Clean IMG path and double-header bugs
0.23
Added more documentation; escaping of href text
0.22
Added thumbnail images to index page
SEE ALSO
perl(1); Image::Magick ("http://www.ImageMagick.org");
the File::Basename manpage; the Acme::Pony manpage; the
Data::Dumper manpage; the WWW::MapBlast manpage; the
Image::Thumbnail manpage
AUTHOR
Lee Goddard <lgoddard@cpan.org>
COPYRIGHT
Copyright (C) Lee Goddard, 2001. All Rights Reserved.
# LatLong tests
print "1..11\n";
use Cwd;
use Image::Magick;
print "ok 1\n";
use Image::Maps::Plot::FromLatLong;
print "ok 2\n";
if (not mkdir cwd."/__test__"){
print "not ok 4\n";
die "Could not make test dir: dying before messing with files: unlink the __test__ dir manually to prevent errors";
} else{
print "skip 3\n";
}
if ($maker){
if ($maker->all(cwd)){
print "ok 5\n";
} else {
print "no ok 5\n";
}
my $i = Image::Magick->new;
if ($i->BlobToImage( ${$maker->create_blob} )){
print "not ok 6\n";
} else {
print "ok 6\n";
}
if ($i->Write($cwd."__test__.jpg")){
print "not ok 7\n";
} else {
print "ok 7\n";
unlink "__test__.jpg";
( run in 0.778 second using v1.01-cache-2.11-cpan-beeb90c9504 )