Versions in this module Expand all Collapse all v0 v0.4.1 Jun 19, 2017 Changes in this version + const D2R + const R2D + const SizeHighDPI + const SizeStandard + var Center = DrawConfig + func HeightToPixel(alt float64) (uint8, uint8, uint8) + func MercatorLocationToPixel(lat, lng float64, zoom, size uint64) (float64, float64) + func MercatorLocationToTileID(lat, lng float64, zoom, size uint64) (uint64, uint64) + func MercatorPixelToLocation(x, y float64, zoom, size uint64) (float64, float64) + func PixelToHeight(r, g, b uint8) float64 + type DrawConfig struct + Horizontal Justify + Vertical Justify + type Interpolate func(pixel color.Color) color.Color + type Justify string + const JustifyBottom + const JustifyCenter + const JustifyLeft + const JustifyRight + const JustifyTop type Maps + func (m *Maps) FastGetEnclosingTiles(mapID MapID, a, b base.Location, level uint64, format MapFormat, highDPI bool) ([][]Tile, error) + type Tile struct + Level uint64 + Size uint64 + X uint64 + Y uint64 + func NewTile(x, y, level, size uint64, src image.Image) Tile + func (t *Tile) DrawGlobalXY(src image.Image, x, y int, config DrawConfig) error + func (t *Tile) DrawLine(loc1, loc2 base.Location, c color.Color) + func (t *Tile) DrawLocalXY(src image.Image, x, y int, config DrawConfig) error + func (t *Tile) DrawLocation(src image.Image, loc base.Location, config DrawConfig) + func (t *Tile) DrawPoint(loc base.Location, size uint64, c color.Color) error + func (t *Tile) FlattenAltitudes(maxHeight float64) Tile + func (t *Tile) GetAltitude(loc base.Location) (float64, error) + func (t *Tile) GetHighestAltitude() float64 + func (t *Tile) InterpolateAltitudes(loc1, loc2 base.Location) []float64 + func (t *Tile) InterpolateGlobalXY(x1, y1, x2, y2 int, interpolate Interpolate) error + func (t *Tile) InterpolateLocalXY(x1, y1, x2, y2 int, interpolate Interpolate) + func (t *Tile) InterpolateLocations(loc1, loc2 base.Location, interpolate Interpolate) error + func (t *Tile) LocationToPixel(loc base.Location) (float64, float64, error) + func (t *Tile) PixelToLocation(x, y float64) (*base.Location, error) v0.4.0 May 16, 2017 v0.3.0 Mar 18, 2017 Changes in this version + func GetEnclosingTileIDs(a, b base.Location, level uint64) (int64, int64, int64, int64) + func LoadImage(file string) (image.Image, *image.Config, error) + func LocationToTileID(loc base.Location, level uint64) (int64, int64) + func SaveImageJPG(img image.Image, file string) error + func SaveImagePNG(img image.Image, file string) error + func StitchTiles(images [][]image.Image, config image.Config) image.Image + func TileIDToLocation(x, y, level uint64) base.Location + func WrapTileID(x, y, level uint64) (uint64, uint64) + type Cache interface + Fetch func(mapID MapID, x, y, level uint64, format MapFormat, highDPI bool) (image.Image, *image.Config, error) + Save func(mapID MapID, x, y, level uint64, format MapFormat, highDPI bool, ...) error + type FileCache struct + func NewFileCache(basePath string) (*FileCache, error) + func (fc *FileCache) Fetch(mapID MapID, x, y, level uint64, format MapFormat, highDPI bool) (image.Image, *image.Config, error) + func (fc *FileCache) Save(mapID MapID, x, y, level uint64, format MapFormat, highDPI bool, ...) error type MapFormat + const MapFormatPngRaw + const MapFormatVectorTile type MapID + const MapIDTerrainRGB type Maps + func (m *Maps) GetEnclosingTiles(mapID MapID, a, b base.Location, level uint64, format MapFormat, highDPI bool) ([][]image.Image, [][]image.Config, error) + func (m *Maps) GetTile(mapID MapID, x, y, z uint64, format MapFormat, highDPI bool) (image.Image, *image.Config, error) + func (m *Maps) SetCache(c Cache) v0.2.0 Mar 16, 2017 Changes in this version + type MapFormat string + const MapFormatJpg70 + const MapFormatJpg80 + const MapFormatJpg90 + const MapFormatPng + const MapFormatPng128 + const MapFormatPng256 + const MapFormatPng32 + const MapFormatPng64 + type MapID string + const MapIDComic + const MapIDDark + const MapIDEmerald + const MapIDHighContrast + const MapIDLight + const MapIDOutdoors + const MapIDPencil + const MapIDPirates + const MapIDRunBikeHike + const MapIDSatellite + const MapIDStreets + const MapIDStreetsBasic + const MapIDStreetsSatellite + const MapIDWheatpaste + type Maps struct + func NewMaps(base *base.Base) *Maps + func (m *Maps) GetTiles(mapID MapID, x, y, z uint, format MapFormat, highDPI bool) (image.Image, error)