style

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2017 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	LayerTypeFill          = "fill"
	LayerTypeLine          = "line"
	LayerTypeSymbol        = "symbol"
	LayerTypeCircle        = "circle"
	LayerTypeFillExtrusion = "fill-extrusion"
	LayerTypeRaster        = "raster"
	LayerTypeBackground    = "background"
)
View Source
const (
	LayoutVisible     = "visible"
	LayoutVisibleNone = "none"
)
View Source
const (
	SourceTypeVector  = "vector"
	SourceTypeRaster  = "raster"
	SourceTypeGeoJSON = "geojson"
	SourceTypeImage   = "image"
	SourceTypeVideo   = "video"
	SourceTypeCanvas  = "canvas"
)
View Source
const Version = 8

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

type Layer struct {
	ID          string       `json:"id"`
	Source      string       `json:"source,omitempty"`
	SourceLayer string       `json:"source-layer,omitempty"`
	Type        string       `json:"type,omitempty"`
	Layout      *LayerLayout `json:"layout"`
	Paint       *LayerPaint  `json:"paint"`
}

type LayerLayout

type LayerLayout struct {
	Visibility string `json:"visibility,omitempty"`
}

type LayerPaint

type LayerPaint struct {
	LineColor        string `json:"line-color,omitempty"`
	FillColor        string `json:"fill-color,omitempty"`
	FillOutlineColor string `json:"fill-outline-color,omitempty"`
	FillOpacity      uint8  `json:"fill-opacity,omitempty"`
	CircleRadius     uint8  `json:"circle-radius,omitempty"`
	CircleColor      string `json:"circle-color,omitempty"`
}

type Light

type Light struct {
	Anchor    string  `json:"anchor"`
	Color     string  `json:"color"`
	Intensity float64 `json:"intensity"`
}

type Root

type Root struct {
	//	Style specification version number
	Version int `json:"version"`
	//	A human-readable name for the style.
	Name string `json:"name,omitempty"`
	//	Arbitrary properties useful to track with the stylesheet, but do not influence rendering.
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	//	Default map center in longitude and latitude. The style center will be
	//	used only if the map has not been positioned by other means
	//	(e.g. map options or user interaction).
	Center [2]float64 `json:"center,omitempty"`
	//	Default zoom level. The style zoom will be used only if the map has not been
	//	positioned by other means (e.g. map options or user interaction).
	Zoom float64 `json:"zoom,omitempty"`
	//	Default bearing, in degrees clockwise from true north. The style bearing
	//	will be used only if the map has not been positioned by other means
	//	(e.g. map options or user interaction).
	Bearing int64 `json:"bearing,omitempty"`
	//	Default pitch, in degrees. Zero is perpendicular to the surface, for a
	//	look straight down at the map, while a greater value like 60 looks ahead
	//	towards the horizon. The style pitch will be used only if the map has not
	//	been positioned by other means (e.g. map options or user interaction).
	Pitch int64 `json:"pitch,omitempty"`
	//	The global light source.
	Light *Light `json:"light,omitempty"`
	//	Data source specifications.
	Sources map[string]Source `json:"sources"`
	//	URL to sprites. i.e. - mapbox://sprites/mapbox/streets-v8
	Sprite string `json:"sprite,omitempty"`
	//	url to glyphs. i.e. - mapbox://fonts/mapbox/{fontstack}/{range}.pbf
	Glyphs string `json:"glyphs,omitempty"`
	//	A global transition definition to use as a default across properties.
	Transition *Transition `json:"transition,omitempty"`
	//	Layers will be drawn in the order of this array.
	Layers []Layer `json:"layers"`
}

https://www.mapbox.com/mapbox-gl-js/style-spec/

type Source

type Source struct {
	Type string `json:"type"`
	//	An array of one or more tile source URLs, as in the TileJSON spec.
	Tiles []string `json:"tiles,omitempty"`
	//	defaults to 0 if not set
	MinZoom int `json:"minzoom,omitempty"`
	//	defaults to 22 if not set
	MaxZoom int `json:"maxzoom,omitempty"`
	//	url to TileJSON resource
	URL string `json:"url,omitempty"`
}

type Transition

type Transition struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL