HTML::GoogleMaps(3)   User Contributed Perl Documentation  HTML::GoogleMaps(3)



NNAAMMEE
       HTML::GoogleMaps - a simple wrapper around the Google Maps API

SSYYNNOOPPSSIISS
         $map = HTML::GoogleMaps->new(key => $map_key,
                                      db => $geo_coder_us_db);
         $map->center(point => "1810 Melrose St, Madison, WI");
         $map->add_marker(point => "1210 W Dayton St, Madison, WI");

         my ($head, $body) = $map->render;

DDEESSCCRRIIPPTTIIOONN
       HTML::GoogleMaps provides a simple wrapper around the Google Maps API.
       It allows you to easily create maps with markers, polylines and infor-
       mation windows.  If you have Geo::Coder::US installed, it will be able
       to do basic geocoding for US addresses.

CCOONNSSTTRRUUCCTTOORR
       $map = HTML::GoogleMaps->new(key => $map_key);
           Creates a new HTML::GoogleMaps object.  Takes a hash of options.
           The only required option is _k_e_y, which is your Google Maps API key.
           You can get a key at http://maps.google.com/apis/maps/signup.html .
           Other valid options are:

           db => Geo::Coder::US database
               If given, the aadddd__mmaarrkkeerr and aadddd__ppoollyylliinnee methods will be able
               to map US addresses, as well as longitude/latitude pairs.

           height => height in pixels
           width => width in pixels

MMEETTHHOODDSS
       $map->center($point)
           Center the map at a given point.

       $map->zoom($level)
           Set the zoom level

       $map->controls($control1, $control2)
           Enable the given controls.  Valid controls are: llaarrggee__mmaapp__ccoonnttrrooll,
           ssmmaallll__mmaapp__ccoonnttrrooll, ssmmaallll__zzoooomm__ccoonnttrrooll and mmaapp__ttyyppee__ccoonnttrrooll.

       $map->dragging($enable)
           Enable or disable dragging.

       $map->info_window($enable)
           Enable or disable info windows.

       $map->map_type($type)
           Set the map type.  Either mmaapp__ttyyppee or ssaatteelllliittee__ttyyppee.

       $map->add_marker(point => $point, html => $info_window_html)
           Add a marker to the map at the given point.  If hhttmmll is specified,
           add a popup info window as well.

       $map->add_polyline(points => [ $point1, $point2 ])
           Add a polyline that connects the list of points.  Other options
           include ccoolloorr (any valid HTML color), wweeiigghhtt (line width in pixels)
           and ooppaacciittyy (between 0 and 1).

       $map->render
           Renders the map and returns a two element list.  The first element
           needs to be placed in the head section of your HTML document.  The
           second in the body where you want the map to appear.

OONNLLIINNEE EEXXAAMMPPLLEE
       <http://www.cs.wisc.edu/~nmueller/fsbo_open_houses.pl>

SSEEEE AALLSSOO
       <http://maps.google.com/apis/maps/documentation> <http://geocoder.us>

AAUUTTHHOORRSS
       Nate Mueller <nate@cs.wisc.edu>



perl v5.8.3                       2005-07-03               HTML::GoogleMaps(3)
