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
Comment | File | Size | Author |
---|---|---|---|
#11 | location-cck_single_map-841340-11.patch | 2.99 KB | rooby |
#6 | location_cck_multiple_field_on_or_with_single_map.patch | 2.64 KB | Monzer Emam |
#6 | location_gmap_sample.png | 87.25 KB | Monzer Emam |
location_cck_multiple_field_single_map.patch | 1.23 KB | kongoji | |
Comments
Comment #1
kongoji CreditAttribution: kongoji commentedChanged category to "bug report", since the patch is a bugfix
Comment #2
eatsleepdev CreditAttribution: eatsleepdev commentedI'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?
Comment #3
eatsleepdev CreditAttribution: eatsleepdev commentedComment #4
tdimg CreditAttribution: tdimg commentedapplied patch to location 6.x-3.1 and worked fine after clearing the caches.
Comment #5
Monzer Emam CreditAttribution: Monzer Emam commentedapplied patch to location 6.x-3.1 and worked fine after clearing the caches.
Comment #6
Monzer Emam CreditAttribution: Monzer Emam commentedsame 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.
Comment #7
kongoji CreditAttribution: kongoji commentedMonzer's patch at #6 works for me. Can the patch be committed?
Comment #8
txg0_0 CreditAttribution: txg0_0 commentedIt works fine for me, thanks very much!
Comment #9
eatsleepdev CreditAttribution: eatsleepdev commented#6 works for me with the latest update 6.x-3.1
Comment #10
GiorgosK#6 works as expected
tried with latest dev of location 3.x from feb10
should be committed was tested by 4+ people
Comment #11
rooby CreditAttribution: rooby commentedThanks 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.
Comment #12
kongoji CreditAttribution: kongoji commentedCan the patch be ported on 6.x-3.x-dev module version?
Comment #13
robertor CreditAttribution: robertor commentedI 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).
Comment #14
TimeBandit CreditAttribution: TimeBandit commentedNeither #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. :)
Comment #15
rooby CreditAttribution: rooby commentedThe 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.
Comment #16
podarokbot recall
Comment #17
podarokbot
Comment #18
podarok#11 commited pushed to 6.x-3.x-dev
Thanks!