wind-layer 各包参数说明 ¶WindCore 参数说明 ¶TIP
此类库主要用于外部扩展,不可以直接使用,相关参数也需要通过扩展图层传入。
参数说明类型默认值globalAlpha全局透明度,主要影响粒子路径拖尾效果number0.9lineWidth粒子路径宽度number|function1, 当为回调函数时,参数function(m:对应点风速值) => numbercolorScale粒子颜色配置string|function|string[]#fff,当为回调函数时,参数function(m:对应点风速值) => stringminVelocity粒子最小风速number配置此值主要影响当colorScale为颜色数组时的颜色索引,非必填maxVelocity粒子最大风速number配置此值主要影响当colorScale为颜色数组时的颜色索引,必填velocityScale对于粒子路径步长的乘积基数number1 / 25maxAge | particleAge(不推荐使用) 粒子路径能够生成的最大帧数number90paths 生成的粒子路径数量number|function800, 当为回调函数时,参数function(m:对应点风速值) => numberparticleMultiplier粒子路径数量的系数,不推荐使用(视野宽度 * 高度 * 系数)number1 / 300frameRate帧率(ms)number20fieldOptions 数据配置项说明 ¶tsexport interface IField {
/* 一般格点数据是按照矩形范围来切割,所以定义其经纬度范围 */
xmin: number; // 经度最小值
ymin: number; // 纬度最小值
xmax: number; // 经度最大值
ymax: number; // 纬度最大值
deltaX: number; // x(经度)增量
deltaY: number; // y(纬度)增量 (默认我们采用的数据和格点原始数据方向保持一致,数据从左上到右下) 但是需要注意的是此时 deltaY为 -(ymax-ymin) / rows
cols: number; // 列(可由 `(xmax - xmin) / deltaX` 得到)
rows: number; // 行
us: number[]; // U分量
vs: number[]; // V分量
flipY?: boolean; // 因为grib2json的问题,我们需要翻转 Y 轴数据
wrapX?: boolean; // 是否实现跨世界渲染
wrappedX?: boolean; // 当数据范围时按照 [0, 360] 时需要对x方向进行切割转换为 [-180, 180],即将废弃
translateX?: boolean; // 当数据范围时按照 [0, 360] 时需要对x方向进行切割转换为 [-180, 180]
}1234567891011121314151617ol-wind 参数说明 ¶TIP
对应于 openlayers 6 相关参数,风场默认参数最好最好放到参数的 windOptions
图层参数 ¶参数说明类型默认值forceRender在鼠标交互时始终显示粒子boolean--windOptions风场参数,具体配置如下object--fieldOptions数据配置项object--zIndex图层层级number--其他参数遵循 ol 基础图层参数。windOptions ¶参数说明类型默认值globalAlpha全局透明度,主要影响粒子路径拖尾效果number0.9lineWidth粒子路径宽度number|function1, 当为回调函数时,参数function(m:对应点风速值) => numbercolorScale粒子颜色配置string|function|string[]#fff,当为回调函数时,参数function(m:对应点风速值) => stringvelocityScale对于粒子路径步长的乘积基数number1 / 25maxAge | particleAge(不推荐使用) 粒子路径能够生成的最大帧数number90paths 生成的粒子路径数量number|function800, 当为回调函数时,参数function(m:对应点风速值) => numberparticleMultiplier粒子路径数量的系数,不推荐使用(视野宽度 * 高度 * 系数)number1 / 300frameRate帧率(ms)number20ol5-wind 参数说明 ¶图层参数 ¶参数说明类型默认值windOptions风场参数,具体配置如下object--fieldOptions数据配置项object--map地图对象, 在使用 WindLayer 必须配置,不需要调用 addLayer,在使用 PerfWindLayer,可选,具体可以参考 openlayer 官方文档ol.Map--zIndex图层层级number--其他参数遵循 ol 基础图层参数。windOptions ¶参数说明类型默认值globalAlpha全局透明度,主要影响粒子路径拖尾效果number0.9lineWidth粒子路径宽度number|function1, 当为回调函数时,参数function(m:对应点风速值) => numbercolorScale粒子颜色配置string|function|string[]#fff,当为回调函数时,参数function(m:对应点风速值) => stringvelocityScale对于粒子路径步长的乘积基数number1 / 25maxAge | particleAge(不推荐使用) 粒子路径能够生成的最大帧数number90paths 生成的粒子路径数量number|function800, 当为回调函数时,参数function(m:对应点风速值) => numberparticleMultiplier粒子路径数量的系数,不推荐使用(视野宽度 * 高度 * 系数)number1 / 300frameRate帧率(ms)number20openlayers-wind 参数说明 ¶TIP
对应于 openlayers 3-4 相关参数
图层参数 ¶参数说明类型默认值windOptions风场参数,具体配置如下object--fieldOptions数据配置项object--map地图对象,必须配置,不需要调用 addLayer,具体可以参考 openlayer 官方文档ol.Map--zIndex图层层级number--其他参数遵循 ol 基础图层参数。windOptions ¶参数说明类型默认值globalAlpha全局透明度,主要影响粒子路径拖尾效果number0.9lineWidth粒子路径宽度number|function1, 当为回调函数时,参数function(m:对应点风速值) => numbercolorScale粒子颜色配置string|function|string[]#fff,当为回调函数时,参数function(m:对应点风速值) => stringvelocityScale对于粒子路径步长的乘积基数number1 / 25maxAge | particleAge(不推荐使用) 粒子路径能够生成的最大帧数number90paths 生成的粒子路径数量number|function800, 当为回调函数时,参数function(m:对应点风速值) => numberparticleMultiplier粒子路径数量的系数,不推荐使用(视野宽度 * 高度 * 系数)number1 / 300frameRate帧率(ms)number20amap-wind 参数说明 ¶TIP
注意地图 viewMode 最好不要设置为 3D 模式,目前性能有一定问题
图层参数 ¶参数说明类型默认值fieldOptions数据配置项object--windOptions风场参数,具体配置如下object--zIndex图层层级number--其他参数遵循 高德地图 的 CanvasLayer 基础图层参数,请自行查阅对应文档。windOptions ¶参数说明类型默认值globalAlpha全局透明度,主要影响粒子路径拖尾效果number0.9lineWidth粒子路径宽度number|function1, 当为回调函数时,参数function(m:对应点风速值) => numbercolorScale粒子颜色配置string|function|string[]#fff,当为回调函数时,参数function(m:对应点风速值) => stringvelocityScale对于粒子路径步长的乘积基数number1 / 25maxAge | particleAge(不推荐使用) 粒子路径能够生成的最大帧数number90paths 生成的粒子路径数量number|function800, 当为回调函数时,参数function(m:对应点风速值) => numberparticleMultiplier粒子路径数量的系数,不推荐使用(视野宽度 * 高度 * 系数)number1 / 300frameRate帧率(ms)number20bmap-wind 参数说明 ¶TIP
百度地图风场图层主要实现是基于官方 Overlay 图层来实现的,基础参数请查阅对应文档,使用 addOverlay 添加图层。
图层参数 ¶参数说明类型默认值fieldOptions数据配置项object--windOptions风场参数,具体配置如下object--zIndex图层层级number--windOptions ¶参数说明类型默认值globalAlpha全局透明度,主要影响粒子路径拖尾效果number0.9lineWidth粒子路径宽度number|function1, 当为回调函数时,参数function(m:对应点风速值) => numbercolorScale粒子颜色配置string|function|string[]#fff,当为回调函数时,参数function(m:对应点风速值) => stringvelocityScale对于粒子路径步长的乘积基数number1 / 25maxAge | particleAge(不推荐使用) 粒子路径能够生成的最大帧数number90paths 生成的粒子路径数量number|function800, 当为回调函数时,参数function(m:对应点风速值) => numberparticleMultiplier粒子路径数量的系数,不推荐使用(视野宽度 * 高度 * 系数)number1 / 300frameRate帧率(ms)number20@sakitam-gis/maptalks-wind 旧版 参数说明 ¶TIP
默认只有 canvas renderer
图层参数 ¶参数说明类型默认值windOptions风场参数,具体配置如下object--fieldOptions数据配置项object--zIndex图层层级number--其他参数遵循 maptalks 的 CanvasLayer 基础图层参数。windOptions ¶参数说明类型默认值globalAlpha全局透明度,主要影响粒子路径拖尾效果number0.9lineWidth粒子路径宽度number|function1, 当为回调函数时,参数function(m:对应点风速值) => numbercolorScale粒子颜色配置string|function|string[]#fff,当为回调函数时,参数function(m:对应点风速值) => stringvelocityScale对于粒子路径步长的乘积基数number1 / 25maxAge | particleAge(不推荐使用) 粒子路径能够生成的最大帧数number90paths 生成的粒子路径数量number|function800, 当为回调函数时,参数function(m:对应点风速值) => numberparticleMultiplier粒子路径数量的系数,不推荐使用(视野宽度 * 高度 * 系数)number1 / 300frameRate帧率(ms)number20@sakitam-gis/mapbox-wind 参数说明 ¶