我目前正在研究一段代码,它使用 MapBox GL JS 并有一个看起来像这样的 addSource() 函数
this.mapAdapter.map.addSource(`${this.asset.uuid}-data`, {
type: 'geojson',
data: this.getMapboxGeometry(),
})
Run Code Online (Sandbox Code Playgroud)
另一个 addLayer() 函数看起来像这样
this.mapAdapter.map.addLayer({
id: `${this.asset.uuid}-polygon`,
type: 'fill',
source: `${this.asset.uuid}-data`,
filter: ['==', '$type', 'Polygon'],
}
Run Code Online (Sandbox Code Playgroud)
我想知道源和层之间的区别是什么。我似乎找不到合适的明确定义。
特征采集的代码如下
type: 'FeatureCollection',
features: [
{
type: 'Feature',
properties: {},
geometry: {
type: 'Polygon',
...}
Run Code Online (Sandbox Code Playgroud)
图层是否以某种方式与要素集合相关?
图块集是来源的另一个名称还是完全不同?