qualtrics-map
qualtrics-map copied to clipboard
Autocomplete doesn't use location sensitive features
So, the map code is working great in Qualtrics - thanks! But, the autocomplete is not location-aware. The address within the map area often comes up low down in results until the full address is typed in (see picture - second result should be first). I know there are bounding options for autocomplete that can address this, but I can't decipher the javascript to add them.
Thank you @seanchrismurphy, I didn't check if there's a corresponding option in the package that I use, let me review it and get back to you.
Note: I couldn't get this to work reactively (i.e. autocomplete within the map bounds), but I did find a way to set a bounded box in your script - hope that's helpful:
var t = new google.maps.places.Autocomplete(e, this.props.options);
// set a boundary box around southeast queensland
const southwest = { lat: -28.458248082416496, lng: 151.6542799756878 };
const northeast = { lat: -25.944880587065512, lng: 154.08375270802287 };
const newBounds = new google.maps.LatLngBounds(southwest, northeast);
t.setBounds(newBounds);