How to add an image to the g-map popup box?

when I go to "Map" in the navigation, I now see the location nodes on a map (as long as I add the latitude & Longitude manually).

I would like to add an image upload field (using attach, or as a new field) and allow that image to appear in the gmap popup box.

Thanks in advance!

Comments

liorkesos’s picture

I think the gmap popups are consisted of what appears int the teaser.
If you theme it in a way that you teaser will show an image you'll see it on the map.

scottrigby’s picture

the way it works for me is to draw info from the location module.

So in a sense you're right, the Gmap popup does draw from the teaser view in this case - but only the teaser view of content from gmap.
because in the node itself (that the location info also shows up in), there is other node info - but it doesn't show in the Gmap popup.

I was able to hide unwanted things using CSS (diaplay: none; for things I didn't want to show), but have no idea how to add new things to the teaser, like an image?

Is there a way to tell Gmap to draw from another image field I could add to the content type using CCK? Through Views maybe?

tom_o_t’s picture

To add or remove fields from the teaser (assuming you're using CCK):

Go to the admin menu, then Content Management, Content Types, click the content type you're working with, then click the 'display fields' tab at the top of the page. Here you can choose for each CCK field whether or not it shows in the teaser, and set some additional paramaters too (like whether text is a link, size of images, etc).

The alternative way to theme what shows up in the GMap popup is to create a gmap_view using the views module, and then theme the popup. Instructions at http://drupal.org/node/130671. This is the way I did it at http://www.greenmap.org/ogm - the project I'm working on at the moment.

Hope this helps...

scottrigby’s picture

Hi Tom

I like greenmap! Yeah, I made a map view for what I'm doing, though it doesn't look nearly as good as yours (would like to ask you about that too!). It's just on a local machine, so I can't show you till we host it (soon).

RE: your first question: Yes, I am using CCK (a bit) though I don't think I'm currently using it to display a map.
(I'm using a combo of Gmap, Location, and SeeMap mods).

When I go to display fields, I see:
* Restaurant image (a CCK Image field I created)
* See Map (a "See Map" checkbox I created using CCK)

I'd love to Just add a map display field, though I didnt' see any options that looked right? How could I do this? What I'd love to do is show a map on a node page, for the location of each node (e.g node-type = restaurant), which I already have them add in location fields.

When I go to manage fields, I see the fields from the edit tab:
(Label | Name | Type)
* title | title | title
* Restaurant image | field_restaurant_image | Image
* taxonomy | taxonomy | taxonomy
* locations | locations | locations
* See Map | field_see_map | See Map
* body | body_filter | body_filter

I can only edit the two of these in display fields above (others are grayed-out). Does this give you more info about what I'm trying to do?

tom_o_t’s picture

The map display feature that you seem to want is built into the Gmap module - it's done through a block.

Go to your blocks administration page and enable the 'location map' block (typically in the content region, but wherever works for you) and it will display the location of your node whenever a location's been set.

And to change what shows up in the teaser (and therefore in the popup) you need to be in the 'DISPLAY fields' tab (you are looking in the 'manage fields' tab).

I hope this gets you closer to what you are trying to do... Glad you liked Green Map!

scottrigby’s picture

Great - thanks Tom

I enabled the location map block, and I'm now able to see a map now on my nodes. Great!

I now have two maps. One which shows all the nodes of a particular type, and a map on each node:
- the map which shows all the nodes I made with views. I prefer this above the block, because in this version the marker will popup with info, like on the homepage of Green Map. Do you know if there's any way to add this feature to the node map (made with the block)?
- the map on the node, while I'm happy to see it there now, I can't seem to find any way to add popup info. I noticed the map on your nodes is also pretty similar (no popup info) -- though I also notice you've been able to place it floating to the right of your page info, which I can't seem to be able to do (mine's below the links - below "node clear-block" div). Any advice about this?

osu_bucks’s picture

Hi,

How does gmap theming work if my config is multisite? The gmap module is installed under /sites/all/module. But I don't want to change the gmap.css in that folder, because other domains are using gmap module also.

thanks,

ultimike’s picture

You can override the gmap.css definitions with those in each site's theme.

For example, if you want to override the ".gmap-tooltip" definition, then just override it with your own ".gmap-tooltip" definition in your theme's .css file.

-mike

mrgoltra’s picture

subscribing.

bartezz’s picture

subscribe

rares’s picture

Status: Active » Fixed

In my opinion, @ultimike's comment answers the question

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jindustry’s picture

For a gmap created through a views block, the UI actually gives you imagecache preset choices for any cck image field. I didn't get clued in until I read this: http://data.agaric.com/node/2075