server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package server implements the http frontend

Index

Constants

View Source
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
)
View Source
const DefaultLogFormat = "{{.Time}}:{{.RequestIP}} —— Tile:{{.Z}}/{{.X}}/{{.Y}}"

Variables

View Source
var Version string

set at runtime from main

Functions

func RegisterMap

func RegisterMap(name string, layers []Layer) error

RegisterMap associates layers with map names

func Start

func Start(port string)

Start starts the tile server binding to the provided port

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 CapabilitiesLayer struct {
	Name    string `json:"name"`
	URI     string `json:"uri"`
	MinZoom int    `json:"minZoom"`
	MaxZoom int    `json:"maxZoom"`
}

type CapabilitiesMap added in v0.3.0

type CapabilitiesMap struct {
	Name   string              `json:"name"`
	URI    string              `json:"uri"`
	Layers []CapabilitiesLayer `json:"layers"`
}

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 HandleZXY added in v0.3.0

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

func (HandleZXY) ServeHTTP added in v0.3.0

func (req HandleZXY) 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 Layer

type Layer struct {
	Name    string
	MinZoom int
	MaxZoom int
	//	instantiated provider
	Provider mvt.Provider
	//	default tags to include when encoding the layer. provider tags take precedence
	DefaultTags map[string]interface{}
}

type Logger

type Logger struct {
	File   *os.File
	Format string
	sync.Mutex
	// contains filtered or unexported fields
}
var L *Logger

func (*Logger) Log

func (l *Logger) Log(item logItem)

Jump to

Keyboard shortcuts

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