VmLayerNative
The VmLayerNative component is used to load native layers onto the map. The supported layer types include 'fill', 'line', 'symbol', 'circle', 'heatmap', 'fill-extrusion', 'raster', 'hillshade', and 'background'. see. And a extension type 'raster-dem' for terrain.
Basic usage
Use VmLayerNative component to add a openstreetmap layer.
Draw vector datas
Use VmLayerNative component to draw points from a GeoJSON collection to a map; add a vector source to map.
3D Terrain
Use VmLayerNative component to go beyond hillshade and show elevation in actual 3D.
API
Props
| Name | Description | Type | Default |
|---|---|---|---|
| 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
| Name | Description | Type |
|---|---|---|
| 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
| Name | Description | Type |
|---|---|---|
| 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 |