简体   繁体   English

是否有可能在 WebGlPointsLayer 上实现多过滤

[英]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.

相关问题 如何创建一个多过滤器 function 来过滤掉多个属性? - How to create a multi-filter function to filter out multiple attributes? 如何进行多过滤搜索? - How Do I Make a Multi-filter Search? 如何使用 Object 中的多个条件对 Javascript 中的数组进行多重过滤? - How to Multi-Filter an Array in Javascript with multiple Conditions from Object? 如何使数据表示例“多过滤器”适应多表支持 - How to adapt datatables example “multi-filter” for multi-table support 如何创建woocommerce / ecommerce产品过滤器之类的多过滤器库 - How to create multi-filter gallery like woocommerce/ecommerce product filter 尝试在AngularJS中创建多重过滤器以按月和年ID过滤JSON数据 - Trying to create multi-filter in AngularJS to filter JSON data by month and year id's 包含字符串的data-attr的多过滤器表行 - Multi-filter table-rows by data-attr containing string 是否有可能调用任何 web 页面的 java 脚本 function ? - Is there any possibilities to call java script function of any web pages? 是否可以使用three.js文件读取STEP文件? - Is there any possibilities to read STEP file using three.js file? d3-有可能在差异图表中添加画笔事件吗? - d3 - Is there any possibilities of adding brush event to difference chart?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM