How to display the GMap in a node ??
I have installed the GMAP, LOCATION ... modules, and created content with the Gmap fileds.
But, when I view this node, there is no GMAP.

Thanks.

Comments

m13’s picture

Do you have that sorted out?

(the GoogleAPi key should be registered for your website)

What kind of drupal version do you use?

Maybe it should be easier to just use drupal's fuction "drupal_add_js", write the module yourself and run it on any node you choose

dnaromance’s picture

Hi,

Have you try node map module?

I use this one :)

yakker’s picture

I have GMap installed and running. Location installed and running.

The Situation
Under "location" in the modules list, I have the following enabled:

  • GMap
  • GMap Location
  • Location
  • Node Location
  • And I have Location CCK enabled under CCK.

I have a valid key that is working (i've successfully embedded maps into tpl.php files using a direct call to the GMap API, a div called ("map canvas"... yes, nuth'n too original ;), etc. So I know my key works.

The Result
Location information stores and displays fine.
The link to Google Maps works fine and provides the right coordinates and zoom.

My Problem
I want to display a GMap right in the Node (which is what I understood the GMap module did), but it's not there.
I have no option widget in the content-type creation/edit to house a GMap.
Location widget in add/manage fields is just another location information cluster (it looks like it just allows you to pull out location from $content variable and store it in a CCK field).

Anyone have any ideas how to make a map appear in a node?

ADDENDUM: in the readme.txt it mentions possible rendering problems without a strict DOCTYPE. Mine's fine, according to that documentation. I have to be missing something super simple here (apologies!)... like a tag? something in the tpl i have to put?

yakker’s picture

I knew it was something simple. In case anyone stumbles across these posts, what I was failing to realize was that GMap displays in a BLOCK, and you have to go enable that block on Administer->Blocks. I chose to put the block in my Content area. I think there's a way to enable a CCK field for the GMap, but according to the pending issues, the version for Drupal 6.9 was having issues and not working properly.

Funny thing though: I have a custom theme, and when I enabled the block for my theme, it still wasn't showing up. But my admin theme is Garland. When I enabled it in Garland to troubleshoot, it displayed fine. Then I went back to my theme, and the GMap showed up! Wondered if it was some strange caching on my setup.

Anyway, it's there and working.

glennnz’s picture

Hi yakker

I can't get it to show up. I'm pretty sure it's working fine, I can successfully add a marker from my node/edit page, and when I type http:/mysite.com/map/node, I get the map showing.

I'm trying to put the block into a panel, but it won't show there, and also won't show when I put it in the content region on the blocks editing.

Any ideas?

Cheers

Glenn

Glenn
THECA Group

glennnz’s picture

OK, figured out how to create a view with a Gmap in it and display that.

What I can't figure out is how to get my markers to behave how I want.

In /map/node, my markers, when I hover over them, display the lacation name, and a click takes me to that node.

In my view, hovering over a marker shows nothing, and when I click it the info box is displayed, with a link to the node.

In my view, I don't want this info box to display, I want the name to appear on hover, and a click to take me to the node. How do I get this to work?

Thanks

Glenn

Glenn
THECA Group

yakker’s picture

Hi Glenn,

I don't think I can help you (I'm really just hacking around in this stuff), and we've decided to stay away from embedding a GMap in favour of providing a link to Google maps with our information in it (when they click it, Google maps comes up with our marker on it).

But it sounds like there may be a Javascript DOM thing at work. Views writes a lot of different HTML than typical Drupal Node pages. Off the top of my head, I'd check a View>>Source on both map/node, and on your view. Compare the "path" to your info box HTML to see if they are similar. On a typical node you might get:

(these are just example class names - yours will probably be different)

<div class="node">
   <div class="content>
      <div class="map">
          <div class="info-box">
          </div>
      </div>
   </div>
</div>

In views you might get something like:

<div class="views views-row row-1">
   <div class="node">
      <div class="views-content">
         <div class="map">
            <div class="info-box">
            </div>
         </div>
      </div>
   </div>
</div>

* and if you have your view display set to display Fields instead of Nodes, you're going to get even more of this. It's there to provide a lot of power over the DOM, but if you need simpler markup, you may have to go into your tpl.php files and strip it out for your theme.

Keep in mind - I'm just hacking around in Drupal so really take my thoughts with a grain of salt. ;)
Good luck!
Chris

richard moger’s picture

Spent some trying to resolve this one too.

Fixed.

Rich

Elehas’s picture

The easiest way I figured out (for solely adding into a specific node) is to enable the input format. Once you do this then inside whichever node you want to have the map, enable the gmap input format and paste in the macro in the body text. Done.

Elehas’s picture

Double posted. Sorry

nathanjo’s picture

Agree with Elehas. The easiest for me to embed a gmap in a node is to enable the gmap filter in the input format and paste the macro.

fahadurrehman’s picture

So that's how macro works. Thanks your tip works great.

iantresman’s picture

I have enabled:

  • Location CCK
  • GMap
  • GMap Location
  • Location

I have disabled:

  • Location Add Another
  • Node Locations

Then I have added a CCK field of type location:

  • Number of values: 1
  • Collective settings: defaults
  • Display Settings (Hide fields from display): default
  • GMap Macro: default

Finally, in CCK Display fields, set location:

  • Teaser (default, address)
  • Full Node: Map only
josueValRob’s picture

How do i add a CCK field of type location:

jeromewiley’s picture

Hi,

Is there a GMap / Drupal 101 document somewhere that simply lists the step by step instructions on how to install GMap, configure it, and have a small inset map appear somewhere on the page for a particular node that has an address associated with it?

In my particular example, each of our nodes is an event with a single address associated with it.

(I have already installed GMap, linked the Google key, enabled the module(s), assigned GMap block to a particular region for the active theme, etc.)

neha.gangwar’s picture