@bdh-gis/mapbox-gl-rastertilefilter
v1.5.1
Published
rastertilefilter for mapbox
Downloads
27
Readme
🧭 @bdh-gis/mapbox-gl-rastertilefilter
栅格图层颜色过滤
npm i @bdh-gis/mapbox-gl-rastertilefilter
import { setRasterLayerFilter, clearRasterLayerFilter, ColorFilterMode } from '@bdh-gis/mapbox-gl-rastertilefilter';
// 过滤掉色值为红色、蓝色的栅格像素
setRasterLayerFilter(map, rasterLayerId, {
colorFilterMode: ColorFilterMode.EQUALS,
filterColors: ['rgba(255,0,0,1)', 'rgba(0,0,255,1)'],
});
// 清除颜色过滤,还原栅格图层展示
clearRasterLayerFilter(map, rasterLayerId);
Options