I have searched all over, and found so much information, but nothing really that could help much.

I have installed & enabled both location & gmap module. However, all what I need is the ability to display maps inline in a Page content.
What I mean is I just need to embed a map inside a page (no association with user etc.). How can I do this?

I tried embedding a macro inside page content, but no use. Can somebody list simple step-by-step instructions starting from the admin setup to the final node creation step, to enable embed of a Map inside a page content??

Comments

samhassell’s picture

Hi,

You need to use CCK to add a gmap to your node type.

Your first step should be to get your head around CCK.

see: http://drupal.org/project/cck

There are lots of links to documentation on the project page.

Actually upon re-reading your post it sounds like you want a code snippet to embed a map directly in the body section of a node? CCK won't help with that. A quick read through http://drupal.org/node/184588 and it looks like you should be able to make a block with the map in it and embed the block.

Hope that helps in some small way.

r_honey’s picture

I googled out much for this, but found no easy way. What I needed was just to embed a map inside a node content. CCKs, etc. were just an overkill for this.

And I did not believe what I found in the end. Similarly, I dont believe that other people have missed this out.

Simply enable the "GMap macro expander" filter for an Input format, and you wold be able to embed a GMap macro inside content that gets parsed out on rendering. It does not get easier than that I believe. Here's what the filter description says:

"Converts a Google Map macro into the HTML required for inserting a Google Map."

I have tried it out too & it works wonderfully.

samhassell’s picture

Awesome I will have to remember that one!

RichieRich’s picture

Are you using the Google Maps API? If so, this is tricky and the GMap module appears to be useless (I'm trying to do it myself but I've put it on hold).

If you want a basic map then create an account with google and desing your own map with markers. Then simply get the code and embed it in your page. It works fine. I dot it on my site all the time.

r_honey’s picture

Yes, I have a Google Maps API. And I have successfully configured the GMap module.
What's more, now I can simply create a GMap macro through the provided UI, and embed it in any node directly. Just remember to enable the GMap macro filter for atleast one "Input Format" and take care to use that format while creating the node content. Copy-paste any macro in the content and you should be able to see the map for it.

RichieRich’s picture

I finally got round to approaching this task again. I integrated with the Google Map API without using the GMap module. I created a custom page.tpl.php with a couple of line of google code in the header. I load the relevant javascript file which builds the map an populates the menu on the left from within the node. Here's a sample:

http://www.ishigaki-japan.com/maps/places_of_interest

I don't think that you can do this with the GMap module, but then again I lost patience with it pretty quickly so I could be wrong.

Adam S’s picture

Really nice website. I really like your template. Where did you get it?

RichieRich’s picture

Thanks very much. That's just a modified Zen template. It was my first experience with using CSS but it really wasn't that hard once I'd got to grips with a few things. I use NiceMenus for the drop down menu, which I've styled a bit.

I've created a few custom page and node files, but nothing fancy at all - I've barely written any code.

I'm so glad that I went for Zen in the end. I had been messing around with a couple of other templates but was unable to progress very far due to the fact that I wasn't sure what all the code did. With Zen you have the bare essentials laid out in a well commented fashion and it's really easy to build on top of it (after a week or so of pulling your hair out).

Rich