Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here is what I did :
1) installed location package 6.x-3.0
2) Installed latest gmap module 6.x-1.0
3) Added a location cck field to a node
4) Enabled geocoding for my country (switzerland)
5) Enabled gmap with google API (default map works and shows..)
Now I create a node with an adress, save the node and...
the map does not show. I enabled the block, and the block does not show, not does the node appear with a marker in the node locations page.
To me, everything seems in order, but still there is no map showing at all with that node.
Could anyone help!!
Thanks for such a cool module,
Patchak
Comment | File | Size | Author |
---|---|---|---|
#19 | location_cck.patch | 968 bytes | rumburak |
Comments
Comment #1
patchak CreditAttribution: patchak commentedI just found that this happens only when using the cck field.
I'm using cck 2.1 for drupal 6 which is the latest version. Otherwise, on the "normal" location form, the bugs reported here do not happen.
Patchak
Comment #2
capellicI am having the same issue with CCK fields. I am also using CCK 2.1
Comment #3
bdragon CreditAttribution: bdragon commentedAhh, that would be becasue the node locations block doesn't know anything about cck locations.
Comment #4
capellicSo then how are we supposed to integrate GMAP into our nodes while using Location CCK fields? Am I missing something?
Per this feature request (http://drupal.org/node/347344), it's difficult to extract long/lat information from the $node object. Sure, I could us some grep, but that just doesn't seem right. ;-)
Comment #5
patchak CreditAttribution: patchak commented@Bdragon ; ahhhh I thought about that... It's not a "node" location, since it's a value from a cck field. I guess the idea here is to create a map view... will test that right now!!
Patchak
Comment #6
capellicDid this work? If so, a "hack" is to pretend the view is a node view and allow an arg (nid) to be passed to it and then only display one. It takes a bit of themeing, but it can be done. Views 2 is so impressive that it has made me wish, more than once, that it also handled themeing for nodes.
Comment #7
patchak CreditAttribution: patchak commentedCreating a map view does not work either, since passing the values to a gmap view from latitude and longitude fields is marked as TODO in the views interface.
Also, the fields are simply not available when trying to create a gmap view based on the cck field... So for the moment the only way to use this is to use the "direct" location that is not as a cck field...
@Bdragon : is fixing the cck field module on your short term list, cause I need to choose if I go with the normal location interface or the cck one and it depends a bit on if you think this is a priority or not... thanks a lot!!
Patchak
Comment #8
likewhoa CreditAttribution: likewhoa commentedsame issue here on drupal-6.8, map shows but markers are unavailable.
Comment #9
bdragon CreditAttribution: bdragon commentedThe map views should now be working in -dev, using a relationship. (I added relationship support to location_cck fields.)
Comment #10
sziggle CreditAttribution: sziggle commentedcould someone supply a brief recipe for creating a views page with CCK location based markers on it?
using dev as of 1/23, i cannot get it to work. if i create a view of 'location' type, i don't see any relationships exposed that would help, and if i create a view of 'node' type, i cannot figure out what the right combination of relationship and fields are necessary to show a map with markers on it.
any help appreciated.
Comment #11
chazz CreditAttribution: chazz commentedStill doesn't work even after -dev installation. Please check more info here - http://drupal.org/node/347091#comment-1217264
Comment #12
jastraat CreditAttribution: jastraat commentedRelated? http://drupal.org/node/366880
You'd need to update all the existing CCK node fields in the location_instance table
Comment #13
rbl CreditAttribution: rbl commentedSubscribing
Comment #14
SeanBannister CreditAttribution: SeanBannister commentedsub
Comment #15
pacesolutions CreditAttribution: pacesolutions commentedAs 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.
Comment #16
Marko B CreditAttribution: Marko B commentedwhat why? cck module is not working? so we shouldnt even try to make use of location CCK to have google map. as most ppl would probably setup custom content type with cck filed for ggl map. it would be "nice" if maintenre had put a line over cck module and said its not working if its really not working (currently i get nothing when viewing node with location field) so we dont waist time :-(
Comment #17
tonycpsu CreditAttribution: tonycpsu commentedSubscribe
Comment #18
rumburak CreditAttribution: rumburak commentedSubscribe.
After testing I found out that the relationship betwwen the node and the location is broken. It seems the location_cck saves the info into the DB field genid of table location_instance (as "cck:field_location:2"). The views search for a relationship making a join on
LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid
, but inside the location_instance.vid the value is 0. So the corret location is not found and so no information shown.Anyone knows how to correct (force the insert of the correct vid inside the location_instance OR modify the join relationship for the views)?
Comment #19
rumburak CreditAttribution: rumburak commentedProblem solved:
I modified the code of location_cck.module this way:
BEFORE:
AFTER:
This correctly saves the vid inside the location_instance table so that views can find the correct location for CCK fields of location type.
Sorry i d
Comment #20
drupalok CreditAttribution: drupalok commenteddo i have to uninstalle rc1 first or can i just update to dev version before applying this patch?
and will the "location block" work with this patch too? (at the moment it does not show node locations when saved to CCK)
thanks!
Comment #21
lolmaus CreditAttribution: lolmaus commentedI'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/346605#comment-1405790
Remove the CCK location field before trying it to make sure you use the correct place to enter location data.
Comment #22
Marko B CreditAttribution: Marko B commentedI guess you can theme location CCK in a way that u use text coords and add them to JS that calls google map and display map in that way, shouldnt be too hard to implement it that way.
Comment #23
mckeen_greg CreditAttribution: mckeen_greg commentedI can confirm that this patch works. Thank you very much rumburak. :)
Comment #24
rumburak CreditAttribution: rumburak commentedActually I made the patch on rc1, so I think it will work with no problem. Just in case you want to use it on dev version I think it would be safer to manually modify as indicated in the message instead of just using the patch.
Comment #25
rumburak CreditAttribution: rumburak commentedI think I will move onto patching so that CCK Location fields can show up as map. I just have to get more inside knowledge of drupal and its coding... However probably in a couple weeks or sooner I hope to have some results .
Comment #26
drupalok CreditAttribution: drupalok commenteddoes this patch work with multiple locations / cck fields per node?
Comment #27
YesCT CreditAttribution: YesCT commentedI think originally this was about why a cck location did not automatically appear on the location map. I think this is because the location map that comes with location only maps the "native" locations, not the cck locations.
Then, I think, a discussion began of how to get cck locations to show on a map: Using views to list the locations and a "map" display.
There is a patch that changes the way cck locations are saved in the database dealing with different id's. But it seems that is a work around/hack. And the right way is to have the "relationship" work.
I'm tagging, and hope to come back later and add in issue numbers.
Comment #28
arjunkr CreditAttribution: arjunkr commentedLocation block is not available in Admin-settings - Block , can anyone please guide me how to activate the location block to view the map.
Comment #29
YesCT CreditAttribution: YesCT commentedI think the blocks are views displays. Try looking in views.
Comment #30
arjunkr CreditAttribution: arjunkr commentedHai I Resolved this , was having prob with blocks...Thanks :)
Comment #31
dieter CreditAttribution: dieter commentedsubscribing
Comment #32
jontheil@gmail.com CreditAttribution: jontheil@gmail.com commentedSubscribing
Comment #33
bfdi533 CreditAttribution: bfdi533 commentedI had the same problem and before finding this patch I had written a perl script to update the location_instance table with the nid and vid and scheduled it with cron. I like the patch version better.
Comment #34
schvili CreditAttribution: schvili commentedSorry, but since the patch from Rumburak seems to work, why not insert it to the Location module itself? Seems strange though to have to via the Relationship but better than not working at all.
Thank you, Rumburak!
Comment #35
lugha CreditAttribution: lugha commentedSubscribing.
Question though, if I use Rumbarak's hack to have CCK update the nid/vid in location_instances, what will that effect down the road once the relationship is fixed and I start using modules that rely on CCK locations fields?
Comment #36
HnLn CreditAttribution: HnLn commentedsubscribe
Comment #37
nodecode CreditAttribution: nodecode commentedsubscribing.
Comment #38
izmeez CreditAttribution: izmeez commentedsubscribe
Comment #39
nickl CreditAttribution: nickl commentedDuplicate issue with working patch ready to be reviewed CCK/Views: location_instance fix
Comment #40
srobert72 CreditAttribution: srobert72 commentedSubscribing
Comment #41
mrgoltra CreditAttribution: mrgoltra commentedsubscribing
Comment #42
notsoluckycharm CreditAttribution: notsoluckycharm commentedI discovered the end result of the patch myself... too bad I didn't stumble across this post.
I also like storing the NID, so I added 'nid' = $node->nid to it as well.