Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts *ClientOptions) *Client
func (*Client) Direct ¶
func (c *Client) Direct(query string, opts *GeoOptions) (*GeoResponse, error)
Direct returns coordinates by location name The query should be the city name, state code (only for the US) and country code divided by comma. Please use ISO 3166 country codes.
func (*Client) Reverse ¶
func (c *Client) Reverse(lat, lon float64, opts *GeoOptions) (*GeoResponse, error)
Reverse geocoding allows to get name of the location (city name or area name) by using geographical coordinates (lat, lon). The limit parameter in the API call allows you to cap how many location names you will see in the API response.
type ClientOptions ¶
type GeoData ¶
type GeoData struct {
Name string `json:"name"` // Name of the found location
Lat float64 `json:"lat"` // Geographical coordinates of the found location (latitude)
Lon float64 `json:"lon"` // Geographical coordinates of the found location (longitude)
Country string `json:"country"` // Country of the found location
State string `json:"state"` // (where available) State of the found location
// Name of the found location in different languages.
// The list of names can be different for different locations.
// Note: The key seem to be ISO 639 language codes
LocalNames map[string]string `json:"local_names"`
}
type GeoOptions ¶
type GeoResponse ¶
type GeoResponse struct {
Data []GeoData
}
Click to show internal directories.
Click to hide internal directories.