base

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BaseURL Mapbox API base URL
	BaseURL = "https://api.mapbox.com"
)

Variables

View Source
var ErrorAPILimitExceeded = errors.New("Mapbox API error api rate limit exceeded")

ErrorAPILimitExceeded indicates the API limit has been exceeded

View Source
var ErrorAPIUnauthorized = errors.New("Mapbox API error unauthorized")

ErrorAPIUnauthorized indicates authorization failed

Functions

This section is empty.

Types

type Base

type Base struct {
	// contains filtered or unexported fields
}

Base Mapbox API base

func NewBase

func NewBase(token string) *Base

NewBase Create a new API base instance

func (*Base) Query

func (m *Base) Query(api, version, mode, query string, v *url.Values, inst interface{}) error

Query the mapbox API

func (*Base) SetDebug

func (m *Base) SetDebug(debug bool)

type BoundingBox

type BoundingBox []float64

type Context

type Context struct {
	ID        string
	Text      string
	ShortCode string
	WikiData  string
}

type Feature

type Feature struct {
	ID         string
	Type       string
	Text       string
	PlaceName  string
	PlaceType  []string
	Relevance  float64
	Properties map[string]string
	BBox       BoundingBox
	Center     Point
	Geometry   Geometry
	Context    []Context
}

type FeatureCollection

type FeatureCollection struct {
	Type        string
	Features    []Feature
	Attribution string
}

type FeatureCollection2

type FeatureCollection2 geojson.FeatureCollection

type Geometry

type Geometry struct {
	Type        string
	Coordinates Point
}

type Location

type Location struct {
	Longitude float64
	Latitude  float64
}

type Point

type Point []float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL