I'm using Amazon Location Services for a mapping project that I'm working on and I want to implement autocomplete using searchPlaceIndexForSuggestions
as outlined at https://docs.aws.amazon.com/location/latest/developerguide/search-place-index-autocomplete.html
and documented at https://docs.aws.amazon.com/location-places/latest/APIReference/API_SearchPlaceIndexForSuggestions.html
I'm able to call location.searchPlaceIndexForText
and location.searchPlaceIndexForPosition
just fine and get the expected responses, but when I call location.searchPlaceIndexForSuggestions
with relevant parameters I get Uncaught TypeError: location.searchPlaceIndexForSuggestions is not a function
.
My declaration for location
is
const location = new AWS.Location({credentials, region: AWS.config.region});
The relevant IAM role has the following in its policy:
"Action": [
"geo:GetMapGlyphs",
"geo:GetMapSprites",
"geo:GetMapStyleDescriptor",
"geo:SearchPlaceIndex*",
"geo:GetMapTile"
],
I'm not sure if I'm missing something in the policy, calling the function incorrectly, declaring location incorrectly, or what. Any ideas or assistance would be appreciated :)
Your IAM policy seems fine. There are a couple of things I'd suggest:
Hope this helps.