VmLayerNative

VmLayerNative组件用于加载原生图层到地图。支持的图层类型包括 'fill' | 'line' | 'symbol' | 'symbol' | 'circle' | 'heatmap' | 'fill-extrusion' | 'raster' | 'hillshade' | 'background'。 参考。以及一个扩展类型:'raster-dem' 用于加载地形。

基础用法

绘制矢量数据

地形

API

Props

属性名说明类型默认值
idUnique layer name.string-
beforeIdThe ID of an existing layer to insert the new layer before, resulting in the new layer appearing visually beneath the existing layer. If this argument is not specified, the layer will be appended to the end of the layers array and appear visually above all other layers.string-
typeRendering type of this layer.enum-
metadataArbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.object-
sourceName of a source description to be used for this layer. Required for all layer types except.string / object-
sourceLayerLayer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.string-
minzoomThe minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden. in range [0, 24].number-
maxzoomThe maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden. in range [0, 24].number-
filterA expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The feature-state expression is not supported in filter expressions.boolean / object-
layoutLayout properties for the layer.object-
paintDefault paint properties for this layer.object-

Events

事件名说明类型
beforeLoadTriggers before the maplibreObject is loaded.Function
readyTriggers when the maplibreObject is successfully loaded.Function
unreadyTriggers when the maplibreObject loading failed.Function
destroyedTriggers when the maplibreObject is destroyed.Function

Exposes

名称说明类型
loadLoad the component manually.Function
unloadDestroy the loaded component manually.Function
reloadLoad the component manually.Function
creatingPromiseDetermine whether the component is created by this.object
maplibreObjectThe maplibreObject created by component.object
getMaplibreObjectGet the maplibreObject created by component.Function

源代码

组件文档

贡献者