I have a page on my Drupal 5.5 site that has a list of 10 or so businesses. I would like to have a small google map next to each. I have come across a few references to the GMap module but I'm not sure if that's really appropriate here.

I came across one site that said:
"To embed a Google Map, users simply pull up the map they want to embed - it can be a location, a business, driving directions, or a My Map they have created - and then click "Link to this page" and copy and paste the HTML into their website or blog."

So, how do I achieve this?

Comments

userofdrupal’s picture

Anyone have any ideas on this? Or alternatively, would it be better from a usability standpoint to have a single google map with all the business on it?

jamesmcd’s picture

I would also be interested in something similar. I am after a set up where I have a list of businesses and clicking on one will bring up a mini profile page with a logo and a google map showing location etc.

Has anyone any ideas on the best way to achieve this?

WorldFallz’s picture

For google maps see http://drupal.org/project/gmap and http://drupal.org/project/location.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

jamesmcd’s picture

Thanks,

I currently have these installed.. I am just trying to work out how I can get them to appear on a listing.. with business contact details etc.. almost like a mini profile!

WorldFallz’s picture

Hmm.... I haven't tried it yet, but there's the gmap cck module available in http://drupal.org/project/gmap_addons . With that perhaps you could use views to create a listing with a map.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

userofdrupal’s picture

I have achieved this. It took me a long time to figure it out but it's not that complicated, I just took a bit to come across all the info I needed. Basically you will need the Gmap module and the Location module and CCK.

Enable the modules.
In module settings type in your Gmap API key which you get free from google.
In Gmap Location settings enable geocoding

Create a CCK type for your businesses (e.g., tanning salons) and enable location info for this type.

Add some content and fill out the addresses for your businesses.

Assuming your theme is phptemplate based (e.g. Zen), in your theme directory copy existing node.tpl.php to a new file called node-tanning_salon.tpl.php (or whatever your cck type is called)

Wherever you want your map to appear, insert the following into your node-tanning_salon.tpl.php file:

    <div class="map">
       <?php print gmap_simple_map(
        $latitude = $node->locations[0]['latitude'],
        $longitude = $node->locations[0]['longitude'],
        $markername = '',
        $info = '',
        $zoom = 13,
        $width = '300px',
        $height = '250px', 
        $autoshow = FALSE, 
        $map = array())
       ?>
    </div>

Use css to style the look of your business profile pages.