I am using Google's JavaScript Map API with the Location Type Element and have two bugs to report...
Under each location text box are two map areas. Only the bottom one gets populated by a Google Map once the user enters a location, the top one stays unpopulated. In order to hide the unused map areas i had to reference each location field and hide the top map element.
//DRUPAL WRAPPER JQUERY
(function ($, Drupal) {
//JQUERY DOM READY FUNCTION
jQuery(document).ready(function($)
{
'use strict';
//Emergency No Parking
$('.webform-location-map:eq(0)').hide();
$('.webform-location-map:eq(2)').hide();
$('.webform-location-map:eq(4)').hide();
$('.webform-location-map:eq(6)').hide();
});
})(jQuery, Drupal);
The second bug is related to the mouse actions for the location field's autocomplete pop up. Using the keyboard to select the address from the autocomplete popup works flawlessly, but the mouse selection is entering random address locations.
Comment | File | Size | Author |
---|---|---|---|
#11 | location_type_element-2896587-11.patch | 556 bytes | jrockowitz |
| |||
#7 | location_type_element-2896587-7.patch | 4.72 KB | jrockowitz |
| |||
#5 | location_type_element-2896587-5.patch | 1.36 KB | jrockowitz |
#4 | Screen Shot 2017-07-24 at 3.14.06 PM.png | 322.51 KB | jrockowitz |
#2 | Location Webform Demo Site.png | 467.11 KB | jrockowitz |
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI am not able to reproduce the issue using the below YAML .
Are you using a custom theme? Can you reproduce the issue on simplytest.me?
Comment #3
buddym CreditAttribution: buddym commentedI was using a custom theme, Bootstrap 3 CDN.
Here is my YAML code...
I tested the above code on simplytest.me and did not get duplicate map elements, but still received unexpected results (i.e. different location) when using my mouse to select from autocomplete options. Also, the second and third maps, both from keyboard and mouse selections did not load properly (remained grey) until I
changed the zoom levelhit alt key of the browsers (Windows 7 Firefox & IE 11). The test tab feature loaded all three maps consistently.Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedBootstrap is render the location element's attributes twice. I am not sure why.
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedGood news!!! This is not a Bootstrap issue. Webform Composite elements were being wrapped in fieldset when the should be wrapped in a form element.
Attached patch will most likely cause a regression or two that will need to be fixed.
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #9
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI committed the patch. Please download the latest dev release to review.
Comment #10
buddym CreditAttribution: buddym commentedDownloaded and unpacked the latest dev tarball to my site. Removed the folder and files of the existing beta15 build and moved the dev ones under modules. Ran the update script and tested the latest dev build.
It seemed like the Google API wasn't initializing. There were no map elements under my location fields, and when I typed in a location the autocomplete never kicked in. I experienced the same behavior when I switched over to the bartik theme. I didn't see any javascript errors in the console, or php errors in the drupal logs.
Once I reverted back to the beta15 build the maps were back and the autocomplete was again operational.
Comment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedSorry about that, I forgot to update the javascript selector.
Comment #13
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedSince the location element is completely broken, I committed the patch. Please download the latest release to review.
Comment #14
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #15
buddym CreditAttribution: buddym commentedThanks J, it is looking good.
Comment #16
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedAwesome!!!