Options
All
  • Public
  • Public/Protected
  • All
Menu

@etomon/etomon-location

Index

Type aliases

EtomonLocation

EtomonLocation: EtomonLocationBase & { address?: string; countryName?: string; languages?: string[]; location?: GeoJSONLocation; phoneCode?: string; safeLabel?: string; timezone?: string }

EtomonLocationQuery

EtomonLocationQuery: EtomonLocationBase & { address?: string; ipAddress?: string; location?: GeoJSONQuery; region?: string; resolveIpWithGeo?: boolean }

Fields that will be used in the query against the various location APIs

EtomonLocationQueryOrResult

EtomonLocationQueryOrResult: EtomonLocation | EtomonLocationQuery

GeoJSONCoordinates

GeoJSONCoordinates: [longitude: number, latitude: number]

Longitude and Latitude

ValueOrNegate

ValueOrNegate<T>: T | { $ne: T }

Type parameters

  • T

Variables

Const defaultEncodingOptions

defaultEncodingOptions: EncodingOptions = ...

Const defaultGeoResolverOptions

defaultGeoResolverOptions: GeoResolverOptions = ...

Const defaultResolvePriorities

defaultResolvePriorities: LocationResolvePriorities[] = ...

Functions

LabelLocation

  • Returns a result similar to the EtomonLocation.address field, but prefers the left-most components available, and strips out ultra-specific details about the address.

    So "Bronx, New York, USA" over "1 River Avenue, Bronx, New York, New York, USA".

    Parameters

    Returns string

LabelLocationSafe

createRouter

  • Creates a series of express routes given a GeoResolver.

    Exposes a REST interface (example, GET: /?address=New%20York) and a JSON RPC 2.0 interface at (POST: /rpc).

    The RPC interface exposes resolveLocations, resolveLocation and autcompleteSearch. Where as the REST interface only exposes resolveLocations, resolveLocation, the latter of which takes a Google Place ID as the sole parameter (/:googlePlaceId).

    Parameters

    Returns { handler: GeoRPCHandler; router: any; rpc: default }

Generated using TypeDoc