Documentation
¶
Overview ¶
Mapbox is a Go package for interacting with the Mapbox API.
Index ¶
Constants ¶
View Source
const ( MapboxHost = "api.tiles.mapbox.com" UserAgent = "Mapbox Google Go Client v0.1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Geocoding ¶
func (c *Client) Geocoding() *GeocodingAPI
func (*Client) HTTPClient ¶
func (*Client) SetHTTPClient ¶
type Coordinate ¶
func ParseCoordinate ¶
func ParseCoordinate(latitude, longitude string) (*Coordinate, error)
type GeocodingAPI ¶
type GeocodingAPI struct {
// contains filtered or unexported fields
}
func (*GeocodingAPI) QueryByAddress ¶
func (api *GeocodingAPI) QueryByAddress(address *QueryByAddressRequest) (*QueryByAddressResponse, error)
QueryByAddress performs a forward geo-encoding. It takes an address and returns all kinds of information about it, e.g. the latitude and longitude. There might be more than one such result. See QueryByAddressResponse for details.
type ImageRequest ¶
type ImageResponse ¶
type ImageResponse struct {
}
type QueryByAddressRequest ¶
type QueryByAddressRequest struct {
// Index is the geocoding index as specified on
// https://www.mapbox.com/developers/api/geocoding/.
// If you construct a QueryByAddressRequest via
// NewQueryByAddressRequest, the the Index is set to
// "mapbox.places" by default.
Index string
// Query is the address you want to decode.
Query string
// Proximity is a set of coordinates
Proximity *Coordinate
// Types are filters on the granularity of results to return, e.g. region, locality, poi
Types []string
}
func NewQueryByAddressRequest ¶
func NewQueryByAddressRequest() *QueryByAddressRequest
NewQueryByAddressRequest creates a new QueryByAddressRequest. It initializes the geocoding index with "mapbox.places-v1".
type QueryByAddressResponse ¶
type QueryByAddressResponse struct {
Attribution string `json:"attribution,omitempty"`
Features []*QueryByAddressResponseFeature `json:"features,omitempty"`
Query []string `json:"query,omitempty"`
Type string `json:"type,omitempty"`
}
QueryByAddressResponse is the result of a call to QueryByAddress.
type QueryByAddressResponseFeature ¶
type QueryByAddressResponseFeature struct {
Type string `json:"type,omitempty"`
Text string `json:"text,omitempty"`
Relevance float64 `json:"relevance,omitempty"`
PlaceName string `json:"place_name,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
ID string `json:"id,omitempty"`
Geometry *json.RawMessage `json:"geometry,omitempty"`
Context *json.RawMessage `json:"context,omitempty"`
Center []float64 `json:"center,omitempty"`
BoundingBox []float64 `json:"bbox,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.