Hello,
I try to sort this out since yesterday....
Map is not showing in node at all... only in edit everything is working fine. I tried with cck fields, and default node page and story without cck. Also with contemplate and without contemplate. At the moment I got a rid of cck location field and I use the one build in with page node. I also use contemplate with rule for location:

print $node->content['locations']['#value']

As I said before, in edit mode everything is working fine. But in normal view mode I can only see details like street, city name etc. but I can't see the map at all. Everything is enabled, so it should work but it doesn't... Please check my screenshots. Any ideas please?
Thank you!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SeanBannister’s picture

I'm new to location and gmap but I'm having the same problem, the only solution I found was a location block that you can add to the page.

SeanBannister’s picture

Status: Active » Closed (duplicate)

Ok this is a duplicate, other people are also having this issue http://drupal.org/node/347091

chazz’s picture

Priority: Normal » Critical
Status: Closed (duplicate) » Active

This is not a duplicate, as the other thread is about CCK fields... in this one we can't see the map at all

SeanBannister’s picture

Well thats the same issue i'm having both methods don't display for me so I presume it's the same issue.

chazz’s picture

Should be the same, but nobody know how to fix any of them :(

KarenS’s picture

Status: Active » Needs review
FileSize
2.21 KB

Attached is a patch to fix the node_view so that the map will display. I don't know that this is the right way to fix it, but it seems to work. I found two critical problems in the current code, which I fix in this patch:

1) There is nothing the in the location preprocess code that will create a map.
2) There is nothing in the location .tpl file that will display the map if it exists.

I think the CCK fields are using the same theme functions, so this may fix them too, but I am only trying to get the node view working for now.

bcobin’s picture

Hunk #1 FAILED at 154.

Good to see this is being worked on - I've lost most of today trying to get mapping to work! (I'm using it to create a User map; the address is being properly geocoded, but no markers appear.)

Thanks for diving in, Karen - I'll check back. Good to know it's not me, at least...

bcobin’s picture

It was Facebook Connect in my case. See post here - a big thumbs-up to ruski.

As soon as I disabled FBConnect, my markers came back fine. Arrgh.

KarenS’s picture

It's a two line change, you can just make it manually. The third thing in the patch is actually a fix for a different problem. You just need the first two fixes, one to the preprocessor and one to the tpl file.

bcobin’s picture

Status: Reviewed & tested by the community » Needs review

Thanks, Karen - I sussed it out and also made the change to the location.us.inc file while I was at it. The markers still didn't return until after I disabled FBConnect - therein lies the solution to my particular problem.

FBC enabled - no markers. FBC disabled - all normal. So it's an either/or situation as far as FBC and Google mapping. Who gets to make the change? I'd think this would be an FBC issue (already reported.)

Thanks - keep up the great work!

chazz’s picture

Yey something working now thank you, but.... the map is blue now. I can see the square, marked point, google logo etc, but the whole map is covered by the blue background. Also there was info when patching -

Hunk #1 FAILED at 154.
1 out of 1 hunk FAILED -- saving rejects to file location.module.rej

I don't know if this is related to "blue map"

Edit:

What the hell, i point the marker in the middle of europe and when outzooming, the "blue map" seems to be ocean near Africa! Is this another issue?

Edit 2: Looks like it's working fine with CCK field. Blue map is visible only if location is setup in node instead of cck

EDIT 3: "Blue map" appear in cck field and node mode when using contemplate module

print $node->field_map[0]['view']

Is it correct?

Edit 4:

SO CONFUSED!!! I have mark point in the middle of the map in ocean all the time now and I didn't change any setup...

scottrigby’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
1.32 KB

The patch in #6 works for me - when applied manually - so I'm attaching an update for just those first two changes, against the current 6.x-3.x-dev. Too early for RTBC?
Thanks a lot KarenS!

bcobin’s picture

Just to clarify: the patch did not correct the FBConnect conflict for me - it may have fixed other stuff, but not that. This is still an open issue and the question is who's stepping on whom, I guess.

Current situation: it's either Google mapping or FB Connect. (I might add here that CiviCRM mapping is unaffected.)

I'll go back to bold that statement in my earlier entry just to make things clearer.

KarenS’s picture

Status: Needs review » Reviewed & tested by the community

@chazz, the point in the ocean near Africa is the point for lat=0, long=0, so maybe your field has the wrong coordinates or empty coordinates that defaulted to zero. Check the raw data stored in your database to be sure that's not the problem.

chazz’s picture

Issue with map display has been fixed, I can confirmed that. Thanks a lot!
Anyway... there is another issue.. map is displayed now as it should, but only if coordinates are displayed too as I state in here: http://drupal.org/node/359716#comment-1227587

KarenS’s picture

I saw that problem too, but it's a different problem. Lets get this fix committed first.

scottrigby’s picture

KarenS, I just noticed that while this method allows the Location CCK fields to display a map on the node, the node's location is not added to the Node Locations gmap at /map/node. I'm only mentioning in case this is related, and if it could possibly help shed light on any last-minute changes before this fix is committed. If it's not related to this issue, I'll be happy to move this observation to another (existing/new) issue.

KarenS’s picture

I would definitely consider that a different issue that needs its own thread.

SeanBannister’s picture

This patch is looking good to me, please everyone test this out so we can get it committed.

amccann’s picture

Tested fine for me (but I get the deep blue ocean unless I set co-ordinates to be visible - not my preference).

Thanks for the patch!

KarenS’s picture

Status: Reviewed & tested by the community » Needs work

I went back and took a look at #359716: No map shows without coordinates and the problem there can be fixed by creating the map before unsetting the lat and lon. So this patch just needs to be re-worked to move the place where the map is created up to the top of template_preprocess_location, before the lat and lon get unset.

I don't have time to make a patch now, but maybe someone else can re-roll it.

SeanBannister’s picture

Keen to get this committed, any progress?

gumol’s picture

I've noticed that after applying patch from #6 post evetyhing works good, map displays but only when "location name" field is filled in.

When "location name" isn't filled in Latitude and Longitude sets up on 0, so map displays the ocean near Africa.

To not display map if Latitude and Longitude sets up on 0 I've changed code in location.module line 1680 from:
if (module_exists('gmap') ) {
to:
if (module_exists('gmap') && $variables['latitude'] != 0 && $variables['longitude'] != 0) {

rbl’s picture

Subscribe

andyboutte’s picture

subscribe

gumol’s picture

Any ideas how to dave coordinates without filling in "location name"?

Hint: when I use default value for "location name" I have to change it to some other value to save the coordinates.

DementedManiac’s picture

#6 Works for me KarenS,
Thanks.

dodorama’s picture

I think this need a more granular implementation. I think there should be at least a way to hide the map in the location CCK field setting, like it is with other fields.
For example this is a problem if you make a view to display nodes from a content type with a location field associated in a map (using gMap style as pointed here http://drupal.org/node/386848#comment-1368296). In that case the map is included in the google map bubble messing things up.

SeanBannister’s picture

dodazzi: I agree this would need to be an option when you configure the field most likely under "Display Settings".

SeanBannister’s picture

KarenS: In regards to #21 I moved gmap_simple_map to the top of template_preprocess_location, before lat and lon gets unset but it didn't solve the problem. Take a look at the jQuery that's outputted to the page mine contains the details for my markers but they don't display.

In my case even my "Node locations" page (/map/node) doesn't have markers. Could someone please confirm that their node location page doesn't have markers?

scottrigby’s picture

@SeanBannister: /map/node issue confirmed in #17. KarenS suggested in #18 that should be a new issue - but i haven't gotten around to making one yet because this wasn't as important to me as the current issue. If you do make a new issue (for /map/node problem), would you please post the link in this thread?

SeanBannister’s picture

This is strange I was messing around with settings and I now have markers on my maps if I use the Coordinate Chooser. But last night I'm sure the same settings won't working :|

pacesolutions’s picture

As per my installation I did not found any problems. Everything is working as it suppose to work. Here how you can work around the problem.

Packages:

- Latest Drupal - http://ftp.drupal.org/files/projects/drupal-6.10.tar.gz
- Latest Location Module - http://drupal.org/project/location (6.x-3.1-rc1)
- Latest GMap Module - http://drupal.org/project/gmap (6.x-1.1-rc1)

- Install or Upgrade to latest Drupal 6.10

- Download and place modules in the modules directory of your Drupal.

- Now activate the following modules from Administrator section (admin/build/modules)
* User Locations
* Node Locations
* Location Search
* Location
* GMap
* GMap Location

- Once modules are enabled. Get Google Maps API and configure the Location module (admin/settings/location).
* In Main settings tab, make sure you select United States as default country.
* Toggle location display: Enable
* Use a Google Map to set latitude and longitude is checked.
* Now in Geocoding Options tab, under United States choose Google Maps.
* Hit saves Configuration
* Now again under United States choose Configure Parameters (This is where you put your Google API key).

- Now configure GMap module (admin/settings/gmap).
* Put your API key here (If not already there.)
* Set default width & height as you like and choose also the default center (e.g.: 39.9434364619742,-77.2998046875), you can also configure more settings as you like.
* Now hit Save Configurations to save them.

- Now configure GMap Location (admin/settings/gmap_location)
* For each Macro put something like this: [gmap zoom=3 |center=39.9434364619742,-77.2998046875 |width=100% |height=300px |control=Small |type=Physical]

- Now most important part is to enable Location block in the content or sidebar to display the map correctly.
* Enable 'Location map' block (admin/build/block) and set to display in sidebar or content - now a small map will be displayed next to nodes that have a location.

- You can create a new content type or modify the existing to display and enter the location/map data. I will modify the default Page content type (admin/content/node-type/page)
* Under Locative Information click on Number of locations
* Set 1 for Minimum number of locations, Maximum number of locations and Number of locations that can be added at once.
* Under Collection Settings, choose the fields you want to display in the form for adding/editing.
* Now hit Save Content Type.

- Now create a new test page (node/add/page) to see if Google maps are working or not.
* Fill the details as you like,
* Double click on the map to place the marker and auto fill the Latitude & Longitude
* Save the Page node.

- You should be able to see the Google Map with marker in right place under your block. You can free place Location block anywhere as you like.

There is no need for CCK or any other module to work around. CCK module is not working.

halver’s picture

The method you describe in post 33 works fine for me. I actually used the Composite Layout module to include the Location Map block in the content area itself. My problem is that I now want to create a printer-friendly version of the node using the 'printer, email and pdf versions' module. But it will not include any blocks. So my question is whether there is a way to have the map included as content, instead of as a block.
Thanks.

tonycpsu’s picture

Subscribe

lolmaus’s picture

I've dug into the problem of missing map or missing marker on the map and found out the following. I hope this will be helpful.

There are two concurrent ways of assigning location to a node: via the 'Location' module and via the 'Location CCK' module. In the discussions of the problem, two ways are mixed and cause a lot of confusion.

Location CCK

.

The CCK way is THE WAY IT IS SUPPOSED TO BE DONE. But for now, only plain text coordinates display is implemented in the 'Location CCK' module. I don't know if they are going to develop a normal map display, but i hope they will.

How it works:
1) Enable the 'Location CCK' module.
2) Add a location field to your content type.
3) Go to Display Fields (admin/content/node-type//display) and select how the location should be presented to site visitors.

For now there are only two displays to choose from: show plain text coords and don't show location at all. I hope they will add a GMap-widget display soon.

Location (non-CCK)

This is the old-school way. It has no future because it is not based on the Views+CCK combination (which is THE approach in Drupal). Though, this method is developed enough for us to use it.

pacesolutions has posted a comprehensive guide how to use the non-CCK way to attach a location to a node:
http://drupal.org/node/363690#comment-1405782

Remove the CCK location field before trying it to make sure you use the correct place to enter location data.

YesCT’s picture

Issue tags: +location (non-cck) node map

Tagging.

YesCT’s picture

marked
#273650: Map in the node
as a duplicate of this issue.

KarenS’s picture

Status: Needs work » Closed (duplicate)

The whole long description in #33 is how to get things working if you are NOT using a CCK field, it won't fix the CCK field, which is what this issue is about.

Instead of my original patch, I'm re-working Location CCK to add new formatters to display the address only, the map and address, or just a map. That will fix this without any changes to the core Location module. I created a new issue for that because this one is pretty confusing, and not being able to see the map is only one of the problems. See #511378: Reworked Location CCK module with GMap formatters.

mrgoltra’s picture

subscribing

urbancamping’s picture

subscribing

Also hoping to use the location node database to cluster markers on a larger Gmap macro.

siva kasireddi’s picture

i have followed same procedure #33.i created page node.but it display default location map (without any marker) instead of original map (setup by me in page node)

shunting’s picture

Thanks to Pace Solutions @33 for figuring this out.

The step I had skipped was setting the minimum number of locations to 1 instead of 0 (which seems a pretty strange default).

I hope for better things in D7 when fields are in core -- a top of the line social networking package ought to be able to integrate location and date data easily...

klucid’s picture

Thanks, #33.

ralexanderclark’s picture

does it matter if you are administering this process on your local machine? Meaning will I be able to see the map once it's live? Or have I just missed something because it's not showing. When I go to site admin/GMap I can see the map.

I just can't get it to show up in the left sidebar when the contact node is clicked.

Please help
----
15 min later...

http://drupal.org/files/issues/README_125.txt
GOTIT!!!

arski’s picture

Erm, it's a nice tutorial, but the statement "There is no need for CCK or any other module to work around. CCK module is not working." is just ridiculous, sorry.

mrgoltra’s picture

when you mention CCK module, do you mean, Location CCK module?

arski’s picture

I suppose he/me/other people in here do, yes.

PS. It actually works quite fine, with geolocation enabled and stuff.. so..