[英]Is there any possibilities to realize multi-filter on WebGlPointsLayer
I'm using React, OpenLayers & https://tileserver.readthedocs.io/en/latest/index.html to take src for my WebGlPointLayer.我正在使用 React、OpenLayers 和https://tileserver.readthedocs.io/en/latest/index.html为我的 WebGlPointLayer 获取 src。 I've got a lot of data to display on the highest zoom.
我有很多数据要在最高变焦上显示。 Now I'm going to create some filters, so following OpenLayers example ( https://openlayers.org/en/latest/examples/filter-points-webgl.html ) I've done the same for my porject.
现在我要创建一些过滤器,所以按照 OpenLayers 示例( https://openlayers.org/en/latest/examples/filter-points-webgl.html )我已经为我的项目做了同样的事情。 The problem is the multiple filters realization.
问题是多个过滤器的实现。 Filter is done by style.variables and style.filter.
过滤器由 style.variables 和 style.filter 完成。
{
variables: defaultVariables,
filter: ['between', ['get', 'i'], ['var', 'volumeMnemonicsFrom'], ['var', 'volumeMnemonicsTo']],
symbol: {
symbolType: 'circle',
size: [10, 10],
color,
rotateWithView: false,
offset: [0, 0],
},
}
Is there any possibilities to realize multiple filters by WebGLPointsLayer style property?是否有可能通过 WebGLPointsLayer 样式属性实现多个过滤器?
what you need to do is simply using 'all' expression and putting all filter definitions as parameter of it.您需要做的只是使用“all”表达式并将所有过滤器定义作为它的参数。 Something like this:
像这样的东西:
filter: ['all',
['between', ['get', 'i'], ['var', 'volumeMnemonicsFrom'], ['var', 'volumeMnemonicsTo']],
['between', ['get', 'anotherFilterField'], ['var', 'minAnotherFilterField'], ['var', 'maxAnotherFilterField']],
],
you can check the source code of expressions here.您可以在此处查看表达式的源代码。 It's a pity the
all
value is missing in the original example of the WebGlPointsLayer in the openlayers page .遗憾的是,在 openlayers 页面中WebGlPointsLayer 的原始示例中缺少
all
值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.