Skip to main content

基本使用

用法示例

const layer=new LGridLabelLayer().setDataSource(provider).setDrawOptions(style);
layer.addTo(map);

构造函数

类名 描述
LGridLabelLayer(options?: ILGridLabelLayerOptions) 二维格点标签图层

构建参数

ILGridLabelLayerOptions

属性
类型
默认值
描述
accurateYDelta(可选) boolean false 对于范围较大的数据,设置后会根据当前点所在的实际纬度计算y值在径向上的间隔变化,会稍微增加渲染时间。

ILGridLabelLayerOptions继承自ILCanvas2DGridBaseLayerOptions

ILCanvas2DGridBaseLayerOptions

属性
类型
默认值
描述
trackDataSource(可选) boolean false 是否监听数据源消息,如果监听,则在数据源更新后会自动刷新图层。
cacheDrawOptions(可选) boolean true 是否缓存绘制对象

图层方法

方法
参数
返回
描述
setDataSource 数据源dataSource: IGridDataProvider this 设置数据源
setDrawOptions 绘制样式drawOptions,
是否部分更新参数partialUpdate: boolean
this 设置渲染参数
setLayerOptions 参数options,
是否部分更新参数partialUpdate: boolean
重新设置图层构造参数,会触发重绘
setVisible 是否可见visible: boolean this 设置图层是否可见