Versions in this module Expand all Collapse all v1 v1.0.0 Oct 6, 2023 Changes in this version + func CanDisplay(pos s2.LatLng) bool + func CreateBBox(nwlat float64, nwlng float64, selat float64, selng float64) (*s2.Rect, error) + func GetTileProviders() map[string]*TileProvider + func Luminance(col color.Color) float64 + func ParseColorString(s string) (color.Color, error) + func ParseLabelOffset(s string) (float64, error) + type Area struct + Color color.Color + Fill color.Color + Positions []s2.LatLng + Weight float64 + func NewArea(positions []s2.LatLng, col color.Color, fill color.Color, weight float64) *Area + func ParseAreaString(s string) (*Area, error) + func (p *Area) Bounds() s2.Rect + func (p *Area) Draw(gc *gg.Context, trans *Transformer) + func (p *Area) ExtraMarginPixels() (float64, float64, float64, float64) + type Circle struct + Color color.Color + Fill color.Color + Position s2.LatLng + Radius float64 + Weight float64 + func NewCircle(pos s2.LatLng, col, fill color.Color, radius, weight float64) *Circle + func ParseCircleString(s string) (circles []*Circle, err error) + func (m *Circle) Bounds() s2.Rect + func (m *Circle) Draw(gc *gg.Context, trans *Transformer) + func (m *Circle) ExtraMarginPixels() (float64, float64, float64, float64) + type Context struct + func NewContext() *Context + func (m *Context) AddArea(area *Area) + func (m *Context) AddCircle(circle *Circle) + func (m *Context) AddMarker(marker *Marker) + func (m *Context) AddObject(object MapObject) + func (m *Context) AddOverlay(overlay *TileProvider) + func (m *Context) AddPath(path *Path) + func (m *Context) Attribution() string + func (m *Context) ClearAreas() + func (m *Context) ClearCircles() + func (m *Context) ClearMarkers() + func (m *Context) ClearObjects() + func (m *Context) ClearOverlays() + func (m *Context) ClearPaths() + func (m *Context) OverrideAttribution(attribution string) + func (m *Context) Render() (image.Image, error) + func (m *Context) RenderWithBounds() (image.Image, s2.Rect, error) + func (m *Context) RenderWithTransformer() (image.Image, *Transformer, error) + func (m *Context) SetBackground(col color.Color) + func (m *Context) SetBoundingBox(bbox s2.Rect) + func (m *Context) SetCache(cache TileCache) + func (m *Context) SetCenter(center s2.LatLng) + func (m *Context) SetMaxZoom(maxZoom int) + func (m *Context) SetOnline(online bool) + func (m *Context) SetSize(width, height int) + func (m *Context) SetTileProvider(t *TileProvider) + func (m *Context) SetUserAgent(a string) + func (m *Context) SetZoom(zoom int) + func (m *Context) Transformer() (*Transformer, error) + type ImageMarker struct + Img image.Image + OffsetX float64 + OffsetY float64 + Position s2.LatLng + func NewImageMarker(pos s2.LatLng, img image.Image, offsetX, offsetY float64) *ImageMarker + func ParseImageMarkerString(s string) ([]*ImageMarker, error) + func (m *ImageMarker) Bounds() s2.Rect + func (m *ImageMarker) Draw(gc *gg.Context, trans *Transformer) + func (m *ImageMarker) ExtraMarginPixels() (float64, float64, float64, float64) + func (m *ImageMarker) SetImage(img image.Image) + func (m *ImageMarker) SetOffsetX(offset float64) + func (m *ImageMarker) SetOffsetY(offset float64) + type MapObject interface + Bounds func() s2.Rect + Draw func(dc *gg.Context, trans *Transformer) + ExtraMarginPixels func() (float64, float64, float64, float64) + type Marker struct + Color color.Color + Label string + LabelColor color.Color + LabelXOffset float64 + LabelYOffset float64 + Position s2.LatLng + Size float64 + func NewMarker(pos s2.LatLng, col color.Color, size float64) *Marker + func ParseMarkerString(s string) ([]*Marker, error) + func (m *Marker) Bounds() s2.Rect + func (m *Marker) Draw(gc *gg.Context, trans *Transformer) + func (m *Marker) ExtraMarginPixels() (float64, float64, float64, float64) + func (m *Marker) SetLabelColor(col color.Color) + type Path struct + Color color.Color + Positions []s2.LatLng + Weight float64 + func NewPath(positions []s2.LatLng, col color.Color, weight float64) *Path + func ParsePathString(s string) ([]*Path, error) + func (p *Path) Bounds() s2.Rect + func (p *Path) Draw(gc *gg.Context, trans *Transformer) + func (p *Path) ExtraMarginPixels() (float64, float64, float64, float64) + type Tile struct + Img image.Image + X int + Y int + Zoom int + type TileCache interface + Path func() string + Perm func() os.FileMode + type TileCacheStaticPath struct + func NewTileCache(rootPath string, perm os.FileMode) *TileCacheStaticPath + func NewTileCacheFromUserCache(perm os.FileMode) *TileCacheStaticPath + func (c *TileCacheStaticPath) Path() string + func (c *TileCacheStaticPath) Perm() os.FileMode + type TileFetcher struct + func NewTileFetcher(tileProvider *TileProvider, cache TileCache, online bool) *TileFetcher + func (t *TileFetcher) Fetch(tile *Tile) error + func (t *TileFetcher) SetUserAgent(a string) + type TileProvider struct + Attribution string + IgnoreNotFound bool + Name string + Shards []string + TileSize int + URLPattern string + func NewTileProviderArcgisWorldImagery() *TileProvider + func NewTileProviderCartoDark() *TileProvider + func NewTileProviderCartoLight() *TileProvider + func NewTileProviderOpenCycleMap() *TileProvider + func NewTileProviderOpenStreetMaps() *TileProvider + func NewTileProviderOpenTopoMap() *TileProvider + func NewTileProviderStamenTerrain() *TileProvider + func NewTileProviderStamenToner() *TileProvider + func NewTileProviderThunderforestLandscape() *TileProvider + func NewTileProviderThunderforestOutdoors() *TileProvider + func NewTileProviderThunderforestTransport() *TileProvider + func NewTileProviderWikimedia() *TileProvider + type Transformer struct + func (t *Transformer) LatLngToXY(ll s2.LatLng) (float64, float64) + func (t *Transformer) Rect() (bbox s2.Rect) + func (t *Transformer) XYToLatLng(x float64, y float64) s2.LatLng