Skip to main content

Overview

Mapmost StyleIncludeversionnamespritesourceslayersand other attributes, the specific form is as follows:

{
"version": 8,
"name": "Mapmost Style",
"sprite": "http://***/vt_map/sprite/sprite",
"glyphs": "http://***/vt_map/font/{fontstack}/{range}.pbf",
"sources": {...},
"layers": [...]
}

Required attributes

version

Required attribute.enum

Style version specification number, must be8

"version": 8

sources

Required attribute.object

The data source specifications are as follows:

"sources": {
"mapbox-streets": {
"type": "vector",
"url": "http://******.json"
}
}

layers

Required attribute.array

The layers will be drawn in the order of the array.

"layers": [
{
"id": "water",
"source": "mapmost-style",
"source-layer": "water",
"type": "fill",
"paint": {
"fill-color": "#00ffff"
}
}
]

Optional attributes

name

Optional attribute.string

The name of the style file.

"name": "SIPSD"

glyphs

Optional attribute.string

oneURLtemplate to loadPBFThe format isSDFset. URLmust contain{fontstack}and{range}mark. If there are layers usedtext-fieldproperty, this property is required.

"glyphs": "http://***/vt_map/font/{fontstack}/{range}.pbf"

sprite

Optional attribute.string

Basics of getting sprite images and metadataURL。 extension.png, .jsonand scaling factor@2x.pngwill be added automatically. If any layer usesbackground-patternfill-patternline-patternfill-extrusion-patternoricon-image,This property is required.

"sprite": "http://***/vt_map/sprite/sprite"

center

Optional attribute.array

Default map center, including longitude and latitude. only if there is no other way(such as map options or user interaction)When positioning, the default center in the style is used.

"center": [
120.31249,
31.7736
]

zoom

Optional attribute.number

Default map level. only if there is no other way(such as map options or user interaction)When positioning, the default map level in the style will be used.

"zoom": 12.5

bearing

Optional attribute.number。Units in degrees, default value0。

Default bearing, expressed in degrees. Bearing is the compass direction of "north"; for example, set to90°,The top of the map is east. This value is only used when there is no other way to locate (such as map options or user interaction).

"bearing": 90

pitch

Optional attribute.number。Units are degrees, default value0。

Default viewing angle, in degrees. The value is0The line of sight is perpendicular to the map, looking down at the map, when the value increases, such as60,It is the horizon facing forward. The perspective in the style file will only be used if there is no other way to position it (such as a map option or user interaction).

"pitch": 50

light

Optional attribute.light ':type=code')。

global light source

"light": {
"anchor": "viewport",
"color": "white",
"intensity": 0.4
}

transition

Optional attribute.transition

The global transition attribute is used as the default value of multiple attributes and is used to set the transition effect of two value transformations. The process of symbol disappearance due to avoidance does not belong to transition attribute control.

"transition": {
"duration": 300,
"delay": 0
}