Documentation ¶
Index ¶
- func CloseDb()
- func DbGet1Tile(z int64, x int64, y int64) (int, []byte, error)
- func GetTile(x int64, y int64, z int64, XYZtoEPSG bool) (tile []byte, httpCode int, err error)
- func InitDb(sqliteFile string) error
- func InitMeta()
- func WriteHTTPAnswer(w http.ResponseWriter, r *http.Request, route string, XYZtoEPSG bool)
- type DbMap
- type DbMapMeta
- type MapMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseDb ¶
func CloseDb()
CloseDb close connection to remote database Should be called in main with defer keyword
func DbGet1Tile ¶
DbGet1Tile get tile data (only pbf image)
func InitMeta ¶
func InitMeta()
InitMeta init meta attribute : This is necessary to init values used to generate etags and last-modified header
func WriteHTTPAnswer ¶
WriteHTTPAnswer http answer to a tile request
Types ¶
type DbMap ¶
type DbMap struct { ZoomLevel int64 `db:"zoom_level" json:"zoom_level"` TileColumn int64 `db:"tile_column" json:"tile_column"` TileRow int64 `db:"tile_row" json:"tile_row"` TileID string `db:"tile_id" json:"tile_id"` TileData []byte `db:"tile_data" json:"tile_data,omitempty"` //NOTE: the []byte will be base64 encoded by JSON Marshall (nice) }
DbMap is map struct that match SQL select
type DbMapMeta ¶
type DbMapMeta struct { Center string `db:"center" json:"center"` Bounds string `db:"bounds" json:"bounds"` Maxzoom string `db:"maxzoom" json:"maxzoom"` Minzoom string `db:"minzoom" json:"minzoom"` Mtime string `db:"mtime" json:"mtime"` MaskLevel string `db:"maskLevel" json:"masklevel"` Format string `db:"format" json:"format"` Filesize string `db:"filesize" json:"filesize"` Type string `db:"type" json:"type"` }
DbMapMeta Metadata info
Click to show internal directories.
Click to hide internal directories.