Versions in this module Expand all Collapse all v0 v0.4.5 Sep 7, 2023 v0.4.3 Sep 7, 2023 Changes in this version + const D2R + const R2D + const SizeHighDPI + const SizeStandard + var Center = DrawConfig + func GetEnclosingTileIDs(a, b base.Location, level uint64) (uint64, uint64, uint64, uint64) + func HeightToPixel(alt float64) (uint8, uint8, uint8) + func LoadImage(file string) (image.Image, *image.Config, error) + func LocationToTileID(loc base.Location, level uint64) (uint64, uint64) + 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 + func SaveImageJPG(img image.Image, file string) error + func SaveImagePNG(img image.Image, file string) error + func TileIDToLocation(x, y float64, 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 DrawConfig struct + Horizontal Justify + Vertical Justify + 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 Interpolate func(pixel color.Color) color.Color + type Justify string + const JustifyBottom + const JustifyCenter + const JustifyLeft + const JustifyRight + const JustifyTop + type MapFormat string + const MapFormatJpg70 + const MapFormatJpg80 + const MapFormatJpg90 + const MapFormatPng + const MapFormatPng128 + const MapFormatPng256 + const MapFormatPng32 + const MapFormatPng64 + const MapFormatPngRaw + const MapFormatVectorTile + 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 MapIDTerrainRGB + const MapIDWheatpaste + type Maps struct + func NewMaps(base *base.Base) *Maps + func (m *Maps) FastGetEnclosingTiles(mapID MapID, a, b base.Location, level uint64, format MapFormat, highDPI bool) ([][]Tile, error) + func (m *Maps) GetEnclosingTiles(mapID MapID, a, b base.Location, level uint64, format MapFormat, highDPI bool) ([][]Tile, error) + func (m *Maps) GetTile(mapID MapID, x, y, z uint64, format MapFormat, highDPI bool) (*Tile, error) + func (m *Maps) SetCache(c Cache) + type Tile struct + Level uint64 + Size uint64 + X uint64 + Y uint64 + func NewTile(x, y, level, size uint64, src image.Image) Tile + func StitchTiles(images [][]Tile) Tile + func (t *Tile) Clone() 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)