package
0.5.0
Repository: https://github.com/ghetzel/go-mapbox.git
Documentation: pkg.go.dev

# Functions

GetEnclosingTileIDs fetches a pair of tile IDs enclosing the provided pair of points.
No description provided by the author
LoadImage loads an image from a file.
LocationToTileID converts a lat/lon location into a tile ID.
MercatorLocationToPixel converts a lat/lng/zoom location (in degrees) to a pixel location in the global space.
MercatorLocationToTileID builds on MercatorLocationToPixel to fetch the TileID of a given location.
MercatorPixelToLocation converts a given (global) pixel location and zoom level to a lat and lng (in degrees).
NewFileCache creates a new file cache instance.
NewMaps Create a new Maps API wrapper.
NewTile creates a tile with a base RGBA object.
PixelToHeight Converts a pixel to a height value for mapbox terrain tiles Equation from https://www.mapbox.com/blog/terrain-rgb/.
SaveImageJPG writes an image instance to a jpg file.
SaveImagePNG writes an image instance to a png file.
StitchTiles combines a 2d array of image tiles into a single larger image Note that all images must have the same dimensions for this to work.
TileIDToLocation converts a tile ID to a lat/lon location.
WrapTileID wraps tile IDs by level for api requests eg.

# Constants

D2R helper for converting degrees to radians.
Constant justification types.
Constant justification types.
Constant justification types.
Constant justification types.
Constant justification types.
70% quality JPG.
80% quality JPG.
90% quality JPG.
true color PNG.
128 color indexed PNG.
256 color indexed PNG.
32 color indexed PNG.
64 color indexed PNG.
Raw PNG (only for MapIDTerrainRGB).
Vector Tile.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
Map IDs.
R2D helper for converting radians to degrees.
No description provided by the author
No description provided by the author

# Variables

Center preconfigured centering helper.

# Structs

DrawConfig configures image drawing.
FileCache is a simple file-based caching implementation for map tiles This does not implement any mechanisms for deletion / removal, and as such is not suitable for production use.
Maps api wrapper instance.
Tile is a wrapper around an image that includes positioning data.

# Interfaces

Cache interface defines an abstract tile cache This can be used to limit the number of API calls required to fetch previously fetched tiles.

# Type aliases

Interpolate function to be passed to generic line interpolator.
Justify sets image offsets for drawing.
MapFormat specifies the format in which to return the map tiles.
MapID selects which map to fetch from the API.