VmLayerNative
VmLayerNative组件用于加载原生图层到地图。支持的图层类型包括 'fill' | 'line' | 'symbol' | 'symbol' | 'circle' | 'heatmap' | 'fill-extrusion' | 'raster' | 'hillshade' | 'background'。 参考。以及一个扩展类型:'raster-dem' 用于加载地形。
基础用法
绘制矢量数据
地形
API
Props
属性名 | 说明 | 类型 | 默认值 |
---|---|---|---|
id | Unique layer name. | string | - |
beforeId | The 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 | - |
type | Rendering type of this layer. | enum | - |
metadata | Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'. | object | - |
source | Name of a source description to be used for this layer. Required for all layer types except. | string / object | - |
sourceLayer | Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources. | string | - |
minzoom | The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden. in range [0, 24]. | number | - |
maxzoom | The 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 | - |
filter | A 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 | - |
layout | Layout properties for the layer. | object | - |
paint | Default paint properties for this layer. | object | - |
Events
事件名 | 说明 | 类型 |
---|---|---|
beforeLoad | Triggers before the maplibreObject is loaded. | Function |
ready | Triggers when the maplibreObject is successfully loaded. | Function |
unready | Triggers when the maplibreObject loading failed. | Function |
destroyed | Triggers when the maplibreObject is destroyed. | Function |
Exposes
名称 | 说明 | 类型 |
---|---|---|
load | Load the component manually. | Function |
unload | Destroy the loaded component manually. | Function |
reload | Load the component manually. | Function |
creatingPromise | Determine whether the component is created by this. | object |
maplibreObject | The maplibreObject created by component. | object |
getMaplibreObject | Get the maplibreObject created by component. | Function |