For this scenario I recommend using the Search Address (V1 search service). With that you can add &entityType=PostalCodeArea
to limit the results to postal/zip codes. You can add &typeahead=true
to tell it the request is part of an autocomplete scenario and it will be more forgiving on what it would normally consider "garbage" input. Pass your input into the query
parameter. Optionally you can use the countrySet
parameter to limit the results to a set of countries. https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-address?view=rest-maps-1.0&tabs=HTTP
How do I get partial zip code typeahead matches in Azure Maps Address Search?
I'm new to Azure Maps, and I'm trying to find documentation around the options with typeahead address search.
My use case is this - I want to provide a partial zip code (example: "372") and get zip code results only (screenshot below).
Google's Places API allows you to optionally pass "postal_codes" as a "types" parameter to only serve zip code results. Is there similar functionality in Azure Maps?
Thanks!
2 answers
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
-
rbrundritt 18,686 Reputation points Microsoft Employee
2024-06-28T15:26:38.8566667+00:00