Download & Extend

Location CCK and Multiple field values on a single map

Project:Location
Version:6.x-3.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:needs review
Issue tags:gmap, location, single map

Issue Summary

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

AttachmentSizeStatusTest resultOperations
location_cck_multiple_field_single_map.patch1.23 KBIgnoredNoneNone

Comments

#1

Category:feature request» bug report

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

#2

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?

#3

Priority:minor» major

#4

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

#5

Assigned to:kongoji» Anonymous
Status:needs review» reviewed & tested by the community

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

#6

Status:reviewed & tested by the community» needs review

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.

AttachmentSizeStatusTest resultOperations
location_gmap_sample.png87.25 KBIgnoredNoneNone
location_cck_multiple_field_on_or_with_single_map.patch2.64 KBIgnoredNoneNone

#7

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

#8

It works fine for me, thanks very much!

#9

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

#10

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

#11

Status:reviewed & tested by the community» needs review

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.

AttachmentSizeStatusTest resultOperations
location-cck_single_map-841340-11.patch2.99 KBIgnoredNoneNone

#12

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

#13

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

#14

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

#15

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.

nobody click here