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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kongoji’s picture

Priority: Major » Minor

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

eatsleepdev’s picture

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?

eatsleepdev’s picture

Priority: Minor » Major
tdimg’s picture

Priority: Minor » Major

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

Monzer Emam’s picture

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.

Monzer Emam’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +gmap, +location
FileSize
87.25 KB
2.64 KB

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.

kongoji’s picture

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

txg0_0’s picture

It works fine for me, thanks very much!

eatsleepdev’s picture

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

GiorgosK’s picture

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

rooby’s picture

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

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.

kongoji’s picture

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

robertor’s picture

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).

TimeBandit’s picture

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. :)

rooby’s picture

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.

podarok’s picture

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

bot recall

podarok’s picture

Status: Patch (to be ported) » Needs review

bot

podarok’s picture

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.