<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">HTML::GoogleMaps(3)   User Contributed Perl Documentation  HTML::GoogleMaps(3)



NNAAMMEE
       HTML::GoogleMaps - a simple wrapper around the Google Maps API

SSYYNNOOPPSSIISS
         $map = HTML::GoogleMaps-&gt;new(key =&gt; $map_key,
                                      db =&gt; $geo_coder_us_db);
         $map-&gt;center(point =&gt; "1810 Melrose St, Madison, WI");
         $map-&gt;add_marker(point =&gt; "1210 W Dayton St, Madison, WI");

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

DDEESSCCRRIIPPTTIIOONN
       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.

CCOONNSSTTRRUUCCTTOORR
       $map = HTML::GoogleMaps-&gt;new(key =&gt; $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 =&gt; Geo::Coder::US database
               If given, the aadddd__mmaarrkkeerr and aadddd__ppoollyylliinnee methods will be able
               to map US addresses, as well as longitude/latitude pairs.

           height =&gt; height in pixels
           width =&gt; width in pixels

MMEETTHHOODDSS
       $map-&gt;center($point)
           Center the map at a given point.

       $map-&gt;zoom($level)
           Set the zoom level

       $map-&gt;controls($control1, $control2)
           Enable the given controls.  Valid controls are: llaarrggee__mmaapp__ccoonnttrrooll,
           ssmmaallll__mmaapp__ccoonnttrrooll, ssmmaallll__zzoooomm__ccoonnttrrooll and mmaapp__ttyyppee__ccoonnttrrooll.

       $map-&gt;dragging($enable)
           Enable or disable dragging.

       $map-&gt;info_window($enable)
           Enable or disable info windows.

       $map-&gt;map_type($type)
           Set the map type.  Either mmaapp__ttyyppee or ssaatteelllliittee__ttyyppee.

       $map-&gt;add_marker(point =&gt; $point, html =&gt; $info_window_html)
           Add a marker to the map at the given point.  If hhttmmll is specified,
           add a popup info window as well.

       $map-&gt;add_polyline(points =&gt; [ $point1, $point2 ])
           Add a polyline that connects the list of points.  Other options
           include ccoolloorr (any valid HTML color), wweeiigghhtt (line width in pixels)
           and ooppaacciittyy (between 0 and 1).

       $map-&gt;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.

OONNLLIINNEE EEXXAAMMPPLLEE
       &lt;http://www.cs.wisc.edu/~nmueller/fsbo_open_houses.pl&gt;

SSEEEE AALLSSOO
       &lt;http://maps.google.com/apis/maps/documentation&gt; &lt;http://geocoder.us&gt;

AAUUTTHHOORRSS
       Nate Mueller &lt;nate@cs.wisc.edu&gt;



perl v5.8.3                       2005-07-03               HTML::GoogleMaps(3)
</pre></body></html>