Documentation ¶
Index ¶
- Constants
- Variables
- func AddMap(m Map)
- func GetCache() cache.Interface
- func PurgeMapTile(m Map, tile tegola.Tile) error
- func SeedMapTile(m Map, tile tegola.Tile) error
- func SetCache(c cache.Interface)
- type Atlas
- func (a *Atlas) AddMap(m Map)
- func (a *Atlas) AllMaps() []Map
- func (a *Atlas) GetCache() cache.Interface
- func (a *Atlas) Map(mapName string) (Map, error)
- func (a *Atlas) PurgeMapTile(m Map, tile tegola.Tile) error
- func (a *Atlas) SeedMapTile(m Map, tile tegola.Tile) error
- func (a *Atlas) SetCache(c cache.Interface)
- type ErrMapNotFound
- type Layer
- type Map
- func (m Map) DisableAllLayers() Map
- func (m Map) DisableDebugLayers() Map
- func (m Map) EnableAllLayers() Map
- func (m Map) EnableDebugLayers() Map
- func (m Map) EnableLayersByName(names ...string) Map
- func (m Map) EnableLayersByZoom(zoom int) Map
- func (m Map) Encode(ctx context.Context, tile tegola.Tile) ([]byte, error)
Constants ¶
const (
// MaxZoom will not render tile beyond this zoom level
MaxZoom = 22
)
Variables ¶
var DefaultAtlas = &Atlas{}
DefaultAtlas is instanitated for convenience
var (
ErrMissingCache = errors.New("atlas: missing cache")
)
Functions ¶
func AddMap ¶
func AddMap(m Map)
AddMap registers a map by name with DefaultAtlas. if the map already exists it will be overwritten
func GetCache ¶
GetCache returns the registered cache for DefaultAtlas, if one is registered, otherwise nil
func PurgeMapTile ¶
PurgeMapTile will purge a map tile from the configured cache backend for the DefaultAtlas
func SeedMapTile ¶
SeedMapTile will generate a tile and persist it to the configured cache backend for the DefaultAtlas
Types ¶
type Atlas ¶
type Atlas struct { // for managing current access to the map container sync.RWMutex // contains filtered or unexported fields }
func (*Atlas) AddMap ¶
AddMap registers a map by name. if the map already exists it will be overwritten
func (*Atlas) PurgeMapTile ¶
PurgeMapTile will purge a map tile from the configured cache backend
func (*Atlas) SeedMapTile ¶
SeedMapTile will generate a tile and persist it to the configured cache backend
type ErrMapNotFound ¶
type ErrMapNotFound struct {
Name string
}
func (ErrMapNotFound) Error ¶
func (e ErrMapNotFound) Error() string
type Layer ¶
type Layer struct { // optional. if not set, the ProviderLayerName will be used Name string ProviderLayerName string MinZoom int MaxZoom int // instantiated provider Provider mvt.Provider // default tags to include when encoding the layer. provider tags take precedence DefaultTags map[string]interface{} GeomType tegola.Geometry // if true, ignore the layer when encoding Disabled bool }
type Map ¶
type Map struct { Name string // Contains an attribution to be displayed when the map is shown to a user. // This string is sanatized so it can't be abused as a vector for XSS or beacon tracking. Attribution string // The maximum extent of available map tiles in WGS:84 // latitude and longitude values, in the order left, bottom, right, top. // Default: [-180, -85, 180, 85] Bounds [4]float64 // The first value is the longitude, the second is latitude (both in // WGS:84 values), the third value is the zoom level. Center [3]float64 Layers []Layer SRID int }
func GetMap ¶
GetMap returns a copy of the a map by name from DefaultAtlas. if the map does not exist it will return an error
func NewWGS84Map ¶
NewMap creates a new map with the necessary default values
func (Map) DisableAllLayers ¶
func (Map) DisableDebugLayers ¶
func (Map) EnableAllLayers ¶
func (Map) EnableDebugLayers ¶
func (Map) EnableLayersByName ¶
EnableLayersByName will enable layers that match the provided layer names this method will not disable layers
func (Map) EnableLayersByZoom ¶
EnableLayersByZoom returns layers that that are to be rendered between a min and max zoom