Documentation ¶
Overview ¶
Package server implements the http frontend
Index ¶
Constants ¶
const ( // MaxTileSize is 500k. Currently just throws a warning when tile // is larger than MaxTileSize MaxTileSize = 500000 // MaxZoom will not render tile beyond this zoom level MaxZoom = 20 )
const DefaultLogFormat = "{{.Time}}:{{.RequestIP}} —— Tile:{{.Z}}/{{.X}}/{{.Y}}"
Variables ¶
var ( // set at runtime from main Version string // configurable via the tegola config.toml file HostName string )
Functions ¶
Types ¶
type Capabilities ¶ added in v0.3.0
type Capabilities struct { Version string `json:"version"` Maps []CapabilitiesMap `json:"maps"` }
type CapabilitiesLayer ¶ added in v0.3.0
type CapabilitiesMap ¶ added in v0.3.0
type HandleCapabilities ¶ added in v0.3.0
type HandleCapabilities struct{}
func (HandleCapabilities) ServeHTTP ¶ added in v0.3.0
func (req HandleCapabilities) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HandleMapCapabilities ¶ added in v0.3.1
type HandleMapCapabilities struct {
// contains filtered or unexported fields
}
func (HandleMapCapabilities) ServeHTTP ¶ added in v0.3.1
func (req HandleMapCapabilities) ServeHTTP(w http.ResponseWriter, r *http.Request)
returns details about a map according to the tileJSON spec (https://github.com/mapbox/tilejson-spec/tree/master/2.1.0)
URI scheme: /capabilities/:map_name.json
map_name - map name in the config file
type HandleMapLayerZXY ¶ added in v0.3.1
type HandleMapLayerZXY struct {
// contains filtered or unexported fields
}
func (HandleMapLayerZXY) ServeHTTP ¶ added in v0.3.1
func (req HandleMapLayerZXY) ServeHTTP(w http.ResponseWriter, r *http.Request)
URI scheme: /maps/:map_name/:layer_name/:z/:x/:y map_name - map name in the config file layer_name - name of the single map layer to render z, x, y - tile coordinates as described in the Slippy Map Tilenames specification
z - zoom level x - row y - column
type HandleMapZXY ¶ added in v0.3.1
type HandleMapZXY struct {
// contains filtered or unexported fields
}
func (HandleMapZXY) ServeHTTP ¶ added in v0.3.1
func (req HandleMapZXY) ServeHTTP(w http.ResponseWriter, r *http.Request)
URI scheme: /maps/:map_name/:z/:x/:y map_name - map name in the config file z, x, y - tile coordinates as described in the Slippy Map Tilenames specification
z - zoom level x - row y - column
type Logger ¶
type Logger struct { File *os.File Format string sync.Mutex // contains filtered or unexported fields }
var L *Logger
type Map ¶ added in v0.3.1
type Map struct { Name string // Contains an attribution to be displayed when the map is shown to a user. // This string is sanatized so it can't be abused as a vector for XSS or beacon tracking. Attribution string // The maximum extent of available map tiles in WGS:84 // latitude and longitude values, in the order left, bottom, right, top. // Default: [-180, -90, 180, 90] Bounds [4]float64 // The first value is the longitude, the second is latitude (both in // WGS:84 values), the third value is the zoom level. Center [3]float64 Layers []Layer }
func (*Map) FilterLayersByName ¶ added in v0.3.1
FilterByName returns a slice with the first layer that matches the provided name the slice return is for convenience. MVT tiles require unique layer names
func (*Map) FilterLayersByZoom ¶ added in v0.3.1
FilterByZoom returns layers that that are to be rendered between a min and max zoom