package opencage

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module OpencageSource

Sourcetype 'a response = ('a, [ `Msg of string ]) result
Sourceval geocode : ?params:(string * string) list -> string -> Yojson.Safe.t response Lwt.t

geocode ~params query Forward geocodes the given query string.

  • parameter params

    A list of optional parameters to pass to the API.

  • parameter query

    The query to geocode.

  • returns

    A Lwt promise that resolves to a result containing either the JSON response or an error message.

Sourceval reverse_geocode : ?params:(string * string) list -> float -> float -> Yojson.Safe.t response Lwt.t

reverse_geocode ~params lat lon Reverse geocodes the given latitude and longitude.

  • parameter params

    A list of optional parameters to pass to the API.

  • parameter lat

    The latitude.

  • parameter lon

    The longitude.

  • returns

    A Lwt promise that resolves to a result containing either the JSON response or an error message.