Repository navigation
Use Places API (New) for address autocomplete (6.4) - #276
Draft
jill-fleet[bot] wants to merge 2 commits into
Draft
jill-fleet[bot] wants to merge 2 commits into
jill-fleet[bot] wants to merge 2 commits into
Conversation
Replace the legacy google.maps.places.Autocomplete widget with the Place / AutocompleteSuggestion API and a custom suggestion dropdown. Fills mapped fields and lat/lng from the selected place.
The result-type setting still offers the legacy values; sending them as includedPrimaryTypes made the default value (address) an invalid request. Map address to street_address, keep geocode and establishment, send a (regions)/(cities) collection alone, drop unknown values and cap at five. Also refresh the distance calculator and map elements after a pick, clear the suggestion list below three characters, escape prediction text before it becomes markup and keep request errors out of the visitor overlay.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type: fix
Same change as the 6.3 PR, for release/6.4.x (src/assets/js/common.js).
address_normalize: normalisation still applies to the field's formatted address; only the old per-component stripping of the mapped field values is not ported.
Test with a Maps key that has Places API (New) enabled. No PHP touched.