Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
HttpClient HTTPClient
// contains filtered or unexported fields
}
func (*Client) ListTilesets ¶
func (c *Client) ListTilesets(params ListTilesetsParams) ([]Tileset, error)
type Layer ¶
type Layer struct {
ID string `json:"id" binding:"required"`
Type string `json:"type" binding:"required,oneof=fill line symbol circle heatmap fill-extrusion raster hillshade background sky"`
Filter *json.RawMessage `json:"filter,omitempty"`
Layout *json.RawMessage `json:"layout,omitempty"`
MaxZoom *float64 `json:"maxzoom,omitempty"`
MinZoom *float64 `json:"minzoom,omitempty"`
Metadata *json.RawMessage `json:"metadata,omitempty"`
Paint *json.RawMessage `json:"paint,omitempty"`
Source *string `json:"source,omitempty"`
SourceLayer string `json:"source-layer,omitempty"`
}
type Light ¶
type ListStyle ¶
type ListStyle struct {
Version int64 `json:"version,omitempty"`
Name string `json:"name,omitempty"`
Created time.Time `json:"created,omitempty"`
ID string `json:"id,omitempty"`
Modified time.Time `json:"modified,omitempty"`
Owner string `json:"owner,omitempty"`
}
ListStyle is a stripped down metadata version of Style returned when listing styles. https://docs.mapbox.com/api/maps/#list-styles
type ListTilesetsParams ¶
type ListTilesetsParams struct {
Type *TilesetType
Visibility *TilesetVisibility
SortBy *SortBy
Limit *int
}
ListTilesetsParams defines optional parameters for the ListTilesets request.
type Style ¶
type Style struct {
// Style specification version number. Must be 8.
Version int `json:"version,omitempty"`
// 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.
// Properties should be prefixed to avoid collisions, like 'mapbox:'.
Metadata *json.RawMessage `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.
// The bearing is the compass direction that is "up";
// for example, a bearing of 90° orients the map so that east is up.
// This value will be used only if the map has not been positioned by other means
// (e.g. map options or user interaction).
Bearing *float64 `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 *float64 `json:"pitch,omitempty"`
// The global light source.
Light *Light `json:"light,omitempty"`
// Data source specifications.
Sources map[string]json.RawMessage `json:"sources,omitempty"`
// A base URL for retrieving the sprite image and metadata.
// The extensions .png, .json and scale factor @2x.png will be automatically appended.
// This property is required if any layer uses the
// background-pattern, fill-pattern, line-pattern, fill-extrusion-pattern, or icon-image properties.
// The URL must be absolute, containing the scheme, authority and path components.
Sprite *string `json:"sprite,omitempty"`
// A URL template for loading signed-distance-field glyph sets in PBF format.
// The URL must include {fontstack} and {range} tokens.
// This property is required if any layer uses the text-field layout property.
// The URL must be absolute, containing the scheme, authority and path components.
// For example "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
Glyphs *string `json:"glyphs,omitempty"`
// Layers will be drawn in the order of this array.
Layers []*Layer `json:"layers,omitempty"`
// A global transition definition to use as a default across properties,
// to be used for timing transitions between one value and the next when no property-specific transition is set.
// Collision-based symbol fading is controlled independently of the style's transition property.
Transition *Transition `json:"transition,omitempty"`
// The date and time the style was created.
Created time.Time `json:"created,omitempty"`
// The ID of the style.
Id string `json:"id,omitempty"`
// The date and time the style was last modified.
Modified time.Time `json:"modified,omitempty"`
// The username of the style owner.
Owner string `json:"owner,omitempty"`
// Access control for the style, either public or private.
// Private styles require an access token belonging to the owner.
// Public styles may be requested with an access token belonging to any user.
Visibility string `json:"visibility,omitempty"`
// Indicates whether the style is a draft (true) or whether it has been published (false)
Draft bool `json:"draft"`
}
https://docs.mapbox.com/mapbox-gl-js/style-spec/root/ https://docs.mapbox.com/api/maps/#the-style-object
type TileJSON ¶
type TileJSON struct {
Bounds [4]float64 `json:"bounds,omitempty"`
Center [3]float64 `json:"center,omitempty"`
Created int64 `json:"created,omitempty"`
Format string `json:"format,omitempty"`
MinZoom int64 `json:"minzoom,omitempty"`
MaxZoom int64 `json:"maxzoom,omitempty"`
Name string `json:"name,omitempty"`
Scheme string `json:"scheme,omitempty"`
TileJSON string `json:"tile_json,omitempty"`
Tiles []string `json:"tiles,omitempty"`
VectorLayers []VectorLayer `json:"vector_layers,omitempty"`
}
type Tileset ¶
type Tileset struct {
Type string `json:"type,omitempty"`
Center [3]float64 `json:"center,omitempty"`
Created time.Time `json:"created,omitempty"`
Description string `json:"description,omitempty"`
Filesize int64 `json:"filesize,omitempty"`
ID string `json:"id,omitempty"`
Modified time.Time `json:"modified,omitempty"`
Name string `json:"name,omitempty"`
Visibility string `json:"visibility,omitempty"`
Status string `json:"status,omitempty"`
}
type TilesetType ¶
type TilesetType string
TilesetType is the data type of the tileset, either "vector" or "raster".
const ( VectorTileset TilesetType = "vector" RasterTileset TilesetType = "raster" )
type TilesetVisibility ¶
type TilesetVisibility string
TilesetVisibility is either "public" or "private".
const ( PublicTileset TilesetVisibility = "public" PrivateTileset TilesetVisibility = "private" )
type Transition ¶
type Transition struct {
// Duration is the time allotted for transitions to complete.
Duration int64
// Delay is the length of time before a transition begins.
Delay int64
}
Transition controls timing for the interpolation between a style property's previous value and new value. A style's root transition property provides global transition defaults for that style.
type VectorLayer ¶
type VectorLayer struct {
Description string `json:"description,omitempty"`
Fields map[string]string `json:"fields,omitempty"`
ID string `json:"id,omitempty"`
MaxZoom int64 `json:"maxzoom,omitempty"`
MinZoom int64 `json:"minzoom,omitempty"`
Source string `json:"source,omitempty"`
SourceName string `json:"source_name,omitempty"`
}