Hi everyone,
here is a patch to make Location CCK work with the "Multiple field values on a single map" display.

That's how make it work Location CCK after applying the patch:
1) Create a new node type (or use one you already created before)
2) Add a Location CCK field to the node type
3) Configure the field to be multiple
4) go to admin/content/node-type/YOUR_NODE_TYPE/display and select "Multiple field values on a single map" option for your Location CCK field
5) insert a new node of the type you just created and set more than one location (use "Add another item" button).
6) Save the node and you will see only one map for that node showing as many markers as many locations you provided for that node

Please note that you will need to clear the cache (admin/settings/performance) after applying the patch.

Please try it out and give feedback.

Greetings
Alberto

Files: 
CommentFileSizeAuthor
#11 location-cck_single_map-841340-11.patch2.99 KBrooby
PASSED: [[SimpleTest]]: [MySQL] 329 pass(es).
[ View ]
#6 location_cck_multiple_field_on_or_with_single_map.patch2.64 KBMonzer Emam
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in location_cck_multiple_field_on_or_with_single_map.patch.
[ View ]
#6 location_gmap_sample.png87.25 KBMonzer Emam
location_cck_multiple_field_single_map.patch1.23 KBkongoji
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in location_cck_multiple_field_single_map.patch.
[ View ]

Comments

Priority:Major» Minor

Changed category to "bug report", since the patch is a bugfix

Category:feature» bug

I've had the same problem and this patch fixed it for me with no issues (thanks Alberto). I just updated location and everything stopped working so I had to apply the patch again. When will this bug be fixed?

Priority:Minor» Major

Priority:Minor» Major

applied patch to location 6.x-3.1 and worked fine after clearing the caches.

Assigned:kongoji» Unassigned
Status:Needs review» Reviewed & tested by the community

applied patch to location 6.x-3.1 and worked fine after clearing the caches.

Status:Reviewed & tested by the community» Needs review
Issue tags:+gmap, +location
StatusFileSize
new87.25 KB
new2.64 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in location_cck_multiple_field_on_or_with_single_map.patch.
[ View ]

same as above patch but with one more format that is will show All addresses text and one single map as per attached image as it required to show the text for users to easy copy and use them.

please can someone review it.

Monzer's patch at #6 works for me. Can the patch be committed?

It works fine for me, thanks very much!

#6 works for me with the latest update 6.x-3.1

Status:Needs review» Reviewed & tested by the community

#6 works as expected
tried with latest dev of location 3.x from feb10
should be committed was tested by 4+ people

Status:Reviewed & tested by the community» Needs review
StatusFileSize
new2.99 KB
PASSED: [[SimpleTest]]: [MySQL] 329 pass(es).
[ View ]

Thanks for the work on this.
Here is a new version of the patch in #6 that works for me.
Would be good to get someone else to confirm before committing.

Differences are:
* Naming of function for multiple addresses and single map is a bit more consistent with the naming of existing function in both code and UI.
* Logic for looping through multiple locations is simpler.
* Theme function for multiple addresses and single map is adapted from the existing "Address with map" function. This is for consistency and as there is some logic in there to handle some special cck cases.
* Adhere to drupal coding standards.

Also, the new formatter will have to be added to the drupal 7 version too.
I can port it when committing.

Can the patch be ported on 6.x-3.x-dev module version?

I cannot get this to work.
I can see single maps for each location, but when I select the Display field to 'Multiple field values on a single map', no maps display.

I am using Location 6.x-3.x-dev

EDIT: I figured out the problem, I was not patching the correct module. Had to patch in location/contrib/location_cck. The patch does work for the dev version (6.x-3.x-dev).

Neither #6 nor #11 worked for me. Tried 6.x-3.2 and 6.x-3.x-dev. FYI, my locations were British Virgin Islands and chosen via coordinate chooser (not address), if it matters. I can show single location maps, just not combined.

Edit: Here is what ended up working for me. In my View, by default, I don't mess with the Style setting. I create a Block with Location field, set the argument to use the node ID, set the Block to show in the BLocks area and all is well for each individual node.

For the combined map, however, it was showing multiple maps. What worked here, to get one map for multiple CCK locations, is that for this Block I need to go into Style settings and change it to Gmap. I chose my Location field to group it on.

So it could be that this patch does work but didn't for me because I needed to choose Gmap in Style. Actually I'm still confused by the whole situation but maybe this will help someone. :)

The patch in #11 is pretty old so it probably needs to be rerolled for the latest dev.

Also, in reply to #14, this patch is not for views.
This issue is for when you have a multiple value location field and want a single map with all the locations when you view the node.

Status:Needs review» Patch (to be ported)
Issue tags:-gmap, -location

bot recall

Status:Patch (to be ported)» Needs review

bot

Status:Needs review» Fixed

#11 commited pushed to 6.x-3.x-dev
Thanks!

Status:Fixed» Closed (fixed)

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