tilezen

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 18 Imported by: 1

README

go-tilezen

Work in progress.

Documentation

Overview

package tilezen provides methods for retrieving and caching tilezen/nextzen map tiles.

Index

Constants

View Source
const DEFAULT_FORMAT = "mvt"
View Source
const DEFAULT_LAYER = "all"
View Source
const DEFAULT_SIZE string = "512"
View Source
const DEFAULT_URITEMPLATE string = "https://tile.nextzen.org/tilezen/vector/{version}/{size}/{layer}/{z}/{x}/{y}.{format}?api_key={apikey}"
View Source
const DEFAULT_VERSION string = "v1"
View Source
const MAX_ZOOM int = 16

Variables

View Source
var Layers []string

Functions

func CropTile

func CropTile(z int, x int, y int, fh io.ReadCloser) (io.ReadCloser, error)

func FetchTile

func FetchTile(t *Tile, opts *Options) (io.ReadSeekCloser, error)

func FetchTileWithCache

func FetchTileWithCache(ctx context.Context, tile_cache cache.Cache, tile *Tile, opts *Options) (io.ReadSeekCloser, error)

func IsOverZoom

func IsOverZoom(z int) bool

Types

type Options

type Options struct {
	ApiKey      string
	Origin      string
	Debug       bool
	URITemplate string
}

type Tile

type Tile struct {
	X       int
	Y       int
	Z       int
	Version string
	Size    string
	Layer   string
	Format  string
}

func NewTile

func NewTile(z int, x int, y int) (*Tile, error)

func ParseURI

func ParseURI(uri string) (*Tile, error)

func (*Tile) String

func (t *Tile) String() string

func (*Tile) URI

func (t *Tile) URI() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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