メインコンテンツまでスキップ

Imports

SDK SupportMapbox GL JSAndroid SDKiOS SDK

basic functionality

>= 3.0.0>= 11.0.0>= 11.0.0

Overview

Imports can be used to add the contents of other styles to the current style. Instead of copying the individual layers, only the other style URL is referenced, so that the imported style is always the most recent version. Imported styles are rendered together with the layers in the current style, but unlike them, they are not available through runtime APIs. Instead, you can specify configuration values for the imported style:

{
"imports": [
{
"id": "basemap",
"url": "mapbox://styles/mapbox/standard",
"config": {
"lightPreset": "dusk",
"showPointOfInterestLabels": false
}
}
]
}

A style can import multiple other styles, which in turn can import other styles (up to 5 levels deep).

Import

An import description describes the style to be imported, and optionally provides configuration values to be applied to the imported style.

id

Required string .

Unique import name.

url

Required string .

The URL of the style.

config

Optional config .

Configuration values for the imported style's options.

data

Optional style .

The inlined style that must correspond to the contents of the specified URL.

Config

When importing a style, you can set values for the available configuration options. If present, the value specified for the import will be used, and otherwise the option’s default value will be used.

*

Optional .

Value of the imported style's configuration option.

If the imported style does not have a configuration option with the specified name, the value will be ignored. The value provided in the config object will be validated against the option specified in the schema.

このpageは役に立ちましたか?