Problem/Motivation
I have created a webform with this module and a filed name called Pick Point
When the user submits this and the email is sent with the below token the following is returned
Token used: [webform_submission:values:pick_point]
Value printed out in email: lat { "lat": 52.355556972593305, "lng": -7.702601627895779}
Is there a way to return the lat or lng only eg using a token like
Token used maybe for lat [webform_submission:values:pick_point:lat]
Would print out: 52.355556972593305
Token used maybe for lng [webform_submission:values:pick_point:lng]
Would Print out: -7.702601627895779
Is doable with the current setup
many thanks
Issue fork webform_gmap_field-3282421
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
rajeshreeputraComment #3
BeeOnLion commentedHi all
I was wondering if I could volunteer some time to help resolve this issue as I think its a really handy module to have and if I can help resolve that would be great
Cheers
Comment #4
rajeshreeputra@BeeOnLion patches are alway welcome, thanks!!!
Please proceed ahead!!
Comment #5
BeeOnLion commentedHi @rajeshreeputra
Apologies I didnt come back to you on this is there anything I can help with you out with this patch. I have been looking at this module but I cant seem to find a fix for it yet
Comment #6
BeeOnLion commentedHi @rajeshreeputra
I was just looking at the code but im not too sure if something like the below would work
I think you might be able to used this by triggering the storeLatLng function on the form's submit event. For example, if the form's id is my-form, you could add this line of code to trigger the function:
However im not 100% if it would work as havent tested it yet and would have to let you guys have a look at implementing it in the module
Comment #7
rajeshreeputra@ganeshsurya, could you please look into it.
Comment #8
BeeOnLion commentedHi @rajeshreeputra unfortunately I dont think I would be able to apply it as outside my knowledge base will have to leave it the dev team of the module sorry cant be of more help on it
Comment #11
vzsigmond commentedHey folks,
I've gone ahead and created an issue fork for this. Here's a merge request for you to check out: https://git.drupalcode.org/project/webform_gmap_field/-/merge_requests/3...
The main thing I've done is switch the element to a composite structure instead of a simple one. This change allows us to easily access the `lat` and `lng` properties.
To keep things smooth, I've added an update hook that handles the migration of existing submissions to the new composite structure.
Take a look and let me know what you think.
Cheers!
Comment #12
vzsigmond commentedComment #13
Andy_D commentedBig thanks to Tipperary County Council for sponsoring this enhancement!
Comment #14
Andy_D commentedLet's get this merged!
Comment #17
rajeshreeputraComment #18
rajeshreeputraMerged, Release will follow shortly!!