Class: FGBLayer

FGBLayer

FGB 图层类。该图层把 FlatGeobuf 格式解析为点线面要素。 FlatGeobuf(FGB)是一种用于存储地理要素的坐标、类型的二进制编码格式。 FGB 格式与传统的 Shapefile、GeoJSON 等文件格式类似,支持地理空间矢量数据的存储,但 FGB 格式具有更高的存储效率和更快的读写速度, 适用于大量静态数据的编码与传输。

new FGBLayer(options)

Usage
// 浏览器
<script type="text/javascript" src="https://iclient.supermap.io/dist/maplibregl/iclient-maplibregl.js"></script>
<script>
  new maplibregl.supermap.FGBLayer(options);
  
</script>

// ES6 Import
import { FGBLayer } from '@supermapgis/iclient-maplibregl';

new FGBLayer(options);

maplibregl/overlay/FGBLayer.js, line 15
Name Type Description
options Object

参数。

Name Type Default Description
layerID string 可选

图层 ID。默认使用 CommonUtil.createUniqueID("FGBlayer_") 创建图层 ID。

strategy boolean 'bbox' 可选

指定加载策略,可选值为 all,bbox。all 为全量加载,bbox 为当前可见范围加载。

extent Array 可选

加载范围,参数规范为: [minX, minY, maxX, maxY],传递此参数后,图层将使用局部加载。

featureLoader function 可选

要素自定义方法,接收要素作为参数,需返回要素。

paint Object 可选

参数内容详见: https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#paint-property

layout Object 可选

参数内容详见: https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#layout-property

sourceOptions Object 可选

参数内容详见: mapboxgl.source

Version:
  • 11.1.0

Methods

moveLayer(layerID, beforeId)

maplibregl/overlay/FGBLayer.js, line 117

设置图层可见性。

Name Type Default Description
layerID string

待插入的图层 ID。

beforeId boolean true 可选

将本图层插入到图层 ID 为layerID 的图层之前。

onAdd(map)

maplibregl/overlay/FGBLayer.js, line 76
Name Type Description
map maplibregl.Map

MapLibreGL Map 对象。

onRemove()

maplibregl/overlay/FGBLayer.js, line 111

render()

maplibregl/overlay/FGBLayer.js, line 105

setVisibility(visibility)

maplibregl/overlay/FGBLayer.js, line 126

设置图层可见性。

Name Type Description
visibility boolean 可选

是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。