tile

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is a servever to get tiles from https://wiki.openstreetmap.org/wiki/tile_servers

func NewServer

func NewServer(url string) *Server

NewServer returns a new Server for the given URL url takes the format https://a.tile.openstreetmap.org/${z}/${x}/${y}.png

func (Server) Find

func (s Server) Find(lat, long float64, zoom int) (image.Image, image.Point, int, int, error)

Find returs a tile image based on latitude and longitude. The image.Point returned is the pixel coordinate of the lat/long position. Integers returned are the x/y tile numbers

func (Server) Get

func (s Server) Get(x, y, zoom int) (image.Image, error)

Get returns a image from the tile server

func (Server) StaticMap

func (s Server) StaticMap(width, height, zoom int, lat, long float64) (*image.RGBA, error)

StaticMap patches together a image.Image of widht*height with lat and long in center. Zoom is the zoom level.

Jump to

Keyboard shortcuts

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