MapsSearchClient class
Client class for interacting with Azure Maps Search Service.
Constructors
Maps |
Creates an instance of MapsSearchClient from a subscription key. Example
|
Maps |
Creates an instance of MapsSearchClient from an Azure Identity Example
|
Methods
begin |
Sends batches of fuzzy search requests. The method returns a poller for retrieving the result later. |
begin |
Sends batches of reverse geocoding requests. The method returns a poller for retrieving the result later. |
begin |
Sends batches of geocoding requests. The method returns a poller for retrieving the result later. |
fuzzy |
Performs a free-form Search which handles the most fuzzy of inputs handling any combination of address or POI tokens. |
get |
Requests the geometry data such as a city or country outline for a set of entities. |
get |
Requests a full list of supported Points of Interest (POI) categories. |
resume |
Continue the fuzzy search request with a serialized state from other poller. Example
|
resume |
Continue the reverse address search request with a serialized state from other poller. Example
|
resume |
Continue the address search request with a serialized state from other poller. Example
|
reverse |
Translates a coordinates into a human understandable street address. |
reverse |
Translates a coordinates into a human understandable cross street. |
search |
Geocodes a address. |
search |
Performs a fuzzy search for POIs along a specified route. |
search |
Performs a free form search inside a single geometry or many of them. |
search |
Requests points of interest (POI) results around a specific location. |
search |
Requests points of interest (POI) results by name |
search |
Requests points of interests (POI) results from given category. |
search |
Geocodes a structured address. |
Constructor Details
MapsSearchClient(AzureKeyCredential, MapsSearchClientOptions)
Creates an instance of MapsSearchClient from a subscription key.
Example
import { MapsSearchClient, AzureKeyCredential } from "@azure/maps-search";
const credential = new AzureKeyCredential("<subscription-key>");
const client = new MapsSearchClient(credential);
new MapsSearchClient(credential: AzureKeyCredential, options?: MapsSearchClientOptions)
Parameters
- credential
- AzureKeyCredential
An AzureKeyCredential instance used to authenticate requests to the service
- options
- MapsSearchClientOptions
Options used to configure the Search Client
MapsSearchClient(TokenCredential, string, MapsSearchClientOptions)
Creates an instance of MapsSearchClient from an Azure Identity TokenCredential
.
Example
import { MapsSearchClient } from "@azure/maps-search";
import { DefaultAzureCredential } from "@azure/identity";
const credential = new DefaultAzureCredential();
const client = new MapsSearchClient(credential, "<maps-account-client-id>");
new MapsSearchClient(credential: TokenCredential, mapsAccountClientId: string, options?: MapsSearchClientOptions)
Parameters
- credential
- TokenCredential
An TokenCredential instance used to authenticate requests to the service
- mapsAccountClientId
-
string
The Azure Maps client id of a specific map resource
- options
- MapsSearchClientOptions
Options used to configure the Search Client
Method Details
beginFuzzySearchBatch(FuzzySearchRequest[], FuzzySearchBatchOptions)
Sends batches of fuzzy search requests. The method returns a poller for retrieving the result later.
function beginFuzzySearchBatch(requests: FuzzySearchRequest[], options?: FuzzySearchBatchOptions): Promise<FuzzySearchBatchPoller>
Parameters
- requests
The array of search requests to process. The array can contain a max of 10,000 requests and must contain at least 1 request.
- options
- FuzzySearchBatchOptions
Optional parameters for the operation
Returns
Promise<FuzzySearchBatchPoller>
beginReverseSearchAddressBatch(ReverseSearchAddressRequest[], ReverseSearchAddressBatchOptions)
Sends batches of reverse geocoding requests. The method returns a poller for retrieving the result later.
function beginReverseSearchAddressBatch(requests: ReverseSearchAddressRequest[], options?: ReverseSearchAddressBatchOptions): Promise<ReverseSearchAddressBatchPoller>
Parameters
- requests
The array of search requests to process. The array can contain a max of 10,000 requests and must contain at least 1 request.
- options
- ReverseSearchAddressBatchOptions
Optional parameters for the operation
Returns
Promise<ReverseSearchAddressBatchPoller>
beginSearchAddressBatch(SearchAddressRequest[], SearchAddressBatchOptions)
Sends batches of geocoding requests. The method returns a poller for retrieving the result later.
function beginSearchAddressBatch(requests: SearchAddressRequest[], options?: SearchAddressBatchOptions): Promise<FuzzySearchBatchPoller>
Parameters
- requests
The array of search requests to process. The array can contain a max of 10,000 requests and must contain at least 1 request.
- options
- SearchAddressBatchOptions
Optional parameters for the operation
Returns
Promise<FuzzySearchBatchPoller>
fuzzySearch(SearchQuery, FuzzySearchBaseOptions & OperationOptions)
Performs a free-form Search which handles the most fuzzy of inputs handling any combination of address or POI tokens.
function fuzzySearch(searchQuery: SearchQuery, options?: FuzzySearchBaseOptions & OperationOptions): Promise<SearchAddressResult>
Parameters
- searchQuery
- SearchQuery
Text query and location information to search
- options
Options for fuzzy search
Returns
Promise<SearchAddressResult>
getGeometries(string[], OperationOptions)
Requests the geometry data such as a city or country outline for a set of entities.
function getGeometries(geometryIds: string[], options?: OperationOptions): Promise<EntityGeometry[]>
Parameters
- geometryIds
-
string[]
Comma separated list of geometry UUIDs, previously retrieved from an Online Search request.
- options
- OperationOptions
Optional parameters for the operation
Returns
Promise<EntityGeometry[]>
getPointOfInterestCategories(GetPointOfInterestCategoriesOptions)
Requests a full list of supported Points of Interest (POI) categories.
function getPointOfInterestCategories(options?: GetPointOfInterestCategoriesOptions): Promise<PointOfInterestCategory[]>
Parameters
Optional parameters for the operation
Returns
Promise<PointOfInterestCategory[]>
resumeFuzzySearchBatch(string, FuzzySearchBatchOptions)
Continue the fuzzy search request with a serialized state from other poller.
Example
const serializedState = poller.toString()
const rehydratedPoller = resumeFuzzySearchBatch(serializedState)
rehydratedPoller.poll()
function resumeFuzzySearchBatch(restoreFrom: string, options?: FuzzySearchBatchOptions): Promise<FuzzySearchBatchPoller>
Parameters
- restoreFrom
-
string
The serialized state from the previous poller.
- options
- FuzzySearchBatchOptions
Optional parameters for the operation.
Returns
Promise<FuzzySearchBatchPoller>
resumeReverseSearchAddressBatch(string, ReverseSearchAddressBatchOptions)
Continue the reverse address search request with a serialized state from other poller.
Example
const serializedState = poller.toString()
const rehydratedPoller = resumeReverseSearchAddressBatch(serializedState)
rehydratedPoller.poll()
function resumeReverseSearchAddressBatch(restoreFrom: string, options?: ReverseSearchAddressBatchOptions): Promise<ReverseSearchAddressBatchPoller>
Parameters
- restoreFrom
-
string
The serialized state from the previous poller.
- options
- ReverseSearchAddressBatchOptions
Optional parameters for the operation.
Returns
Promise<ReverseSearchAddressBatchPoller>
resumeSearchAddressBatch(string, SearchAddressBatchOptions)
Continue the address search request with a serialized state from other poller.
Example
const serializedState = poller.toString()
const rehydratedPoller = resumeSearchAddressBatch(serializedState)
rehydratedPoller.poll()
function resumeSearchAddressBatch(restoreFrom: string, options?: SearchAddressBatchOptions): Promise<FuzzySearchBatchPoller>
Parameters
- restoreFrom
-
string
The serialized state from the previous poller.
- options
- SearchAddressBatchOptions
Optional parameters for the operation.
Returns
Promise<FuzzySearchBatchPoller>
reverseSearchAddress(LatLon, ReverseSearchAddressOptions & OperationOptions)
Translates a coordinates into a human understandable street address.
function reverseSearchAddress(coordinates: LatLon, options?: ReverseSearchAddressOptions & OperationOptions): Promise<ReverseSearchAddressResult>
Parameters
- coordinates
- LatLon
The coordinates for the reverse search query
- options
Optional parameters for the operation
Returns
Promise<ReverseSearchAddressResult>
reverseSearchCrossStreetAddress(LatLon, ReverseSearchCrossStreetAddressOptions)
Translates a coordinates into a human understandable cross street.
function reverseSearchCrossStreetAddress(coordinates: LatLon, options?: ReverseSearchCrossStreetAddressOptions): Promise<ReverseSearchCrossStreetAddressResult>
Parameters
- coordinates
- LatLon
The coordinates for the reverse search query
Optional parameters for the operation
Returns
searchAddress(string, SearchAddressOptions & OperationOptions)
Geocodes a address.
function searchAddress(query: string, options?: SearchAddressOptions & OperationOptions): Promise<SearchAddressResult>
Parameters
- query
-
string
The address to search for (e.g., "1 Microsoft way, Redmond, WA")
- options
Optional parameters for the operation
Returns
Promise<SearchAddressResult>
searchAlongRoute(string, number, GeoJsonLineString, SearchAlongRouteOptions)
Performs a fuzzy search for POIs along a specified route.
function searchAlongRoute(query: string, maxDetourTimeInSeconds: number, route: GeoJsonLineString, options?: SearchAlongRouteOptions): Promise<SearchAddressResult>
Parameters
- query
-
string
The POI name to search for (e.g., "statue of liberty", "starbucks", "pizza").
- maxDetourTimeInSeconds
-
number
Maximum detour time of the point of interest in seconds. Max value is 3600 seconds
- route
- GeoJsonLineString
This represents the route to search along and should be a valid GeoJSON LineString
type.
- options
- SearchAlongRouteOptions
Optional parameters for the operation
Returns
Promise<SearchAddressResult>
searchInsideGeometry(string, SearchGeometry, SearchInsideGeometryOptions)
Performs a free form search inside a single geometry or many of them.
function searchInsideGeometry(query: string, geometry: SearchGeometry, options?: SearchInsideGeometryOptions): Promise<SearchAddressResult>
Parameters
- query
-
string
The POI name to search for (e.g., "statue of liberty", "starbucks", "pizza").
- geometry
- SearchGeometry
This represents the geometry for one or more geographical features (parks, state boundary etc.) to search in and should be a GeoJSON compliant type. Please refer to RFC 7946 for details.
- options
- SearchInsideGeometryOptions
Optional parameters for the operation
Returns
Promise<SearchAddressResult>
searchNearbyPointOfInterest(LatLon, SearchNearbyPointOfInterestOptions)
Requests points of interest (POI) results around a specific location.
function searchNearbyPointOfInterest(coordinates: LatLon, options?: SearchNearbyPointOfInterestOptions): Promise<SearchAddressResult>
Parameters
- coordinates
- LatLon
The coordinates for the nearby POI search
Optional parameters for the operation
Returns
Promise<SearchAddressResult>
searchPointOfInterest(SearchQuery, SearchPointOfInterestOptions)
Requests points of interest (POI) results by name
function searchPointOfInterest(searchQuery: SearchQuery, options?: SearchPointOfInterestOptions): Promise<SearchAddressResult>
Parameters
- searchQuery
- SearchQuery
Text query and location information to search
- options
- SearchPointOfInterestOptions
Options for search POI
Returns
Promise<SearchAddressResult>
searchPointOfInterestCategory(SearchQuery, SearchPointOfInterestOptions)
Requests points of interests (POI) results from given category.
function searchPointOfInterestCategory(searchQuery: SearchQuery, options?: SearchPointOfInterestOptions): Promise<SearchAddressResult>
Parameters
- searchQuery
- SearchQuery
Text query and location information to search
- options
- SearchPointOfInterestOptions
Options for search POI category
Returns
Promise<SearchAddressResult>
searchStructuredAddress(StructuredAddress, SearchStructuredAddressOptions)
Geocodes a structured address.
function searchStructuredAddress(structuredAddress: StructuredAddress, options?: SearchStructuredAddressOptions): Promise<SearchAddressResult>
Parameters
- structuredAddress
- StructuredAddress
Structured address used for geocoding
- options
- SearchStructuredAddressOptions
Optional parameters for the operation
Returns
Promise<SearchAddressResult>
Azure SDK for JavaScript
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for