Package version:

Class MapsSearchClient

Client class for interacting with Azure Maps Search Service.

Hierarchy

  • MapsSearchClient

Constructors

  • 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);

    Parameters

    • credential: AzureKeyCredential

      An AzureKeyCredential instance used to authenticate requests to the service

    • Optional options: any

      Options used to configure the Search Client

    Returns MapsSearchClient

  • 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>");

    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

    • Optional options: any

      Options used to configure the Search Client

    Returns MapsSearchClient

Methods

  • Requests the geometry data such as a city or country outline for a set of entities.

    Parameters

    • geometryIds: Object

      Comma separated list of geometry UUIDs, previously retrieved from an Online Search request.

    • options: OperationOptions = {}

      Optional parameters for the operation

    Returns Promise<Object>

  • Geocodes a address.

    Parameters

    • query: string

      The address to search for (e.g., "1 Microsoft way, Redmond, WA")

    • options: any = {}

      Optional parameters for the operation

    Returns Promise<SearchAddressResult>

  • Performs a fuzzy search for POIs along a specified route.

    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>

  • Performs a free form search inside a single geometry or many of them.

    Parameters

    • query: string

      The POI name to search for (e.g., "statue of liberty", "starbucks", "pizza").

    • geometry: any

      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>

Generated using TypeDoc