Leaflet / Leaflet.VectorGrid

Display gridded vector data (sliced GeoJSON or protobuf vector tiles) in Leaflet 1.0.0
598 stars 194 forks source link

Add filter option to filter features #165

Closed mattesCZ closed 5 years ago

mattesCZ commented 6 years ago

This allows you apply filter function on features rather than hiding it with opacity: 0 as suggested in #153 It can dramatically improve performance depending on number of filtered features. Very similar to L.GeoJSON filter option.

ashleysommer commented 6 years ago

I need this in order to improve the performance of a web app I'm writing.

Besides giving a thumbs up on the PR, is there any way I can vote this up to indicate it is a desired feature?

2803media commented 5 years ago

Do you have a Leaflet.VectorGrid.bundled.min.js version of this commit so that I could test it?

mattesCZ commented 5 years ago

No, but you can build it easily. Clone the fork https://github.com/mattesCZ/Leaflet.VectorGrid, checkout branch feature-filter and run npm install and npm run build. This will create the file in the dist folder.

mattesCZ commented 5 years ago

@perliedman Thanks, I think you can also close issue #153

SamyOteroGlez commented 2 years ago

Does any body has tested this filter functionality recently?

I tried but seems to me like the filter function was never triggered.

jayvarner commented 1 year ago

@SamyOteroGlez I ran into this today. This PR was merged after the last release. I got it to work by cloning the repo, building the master branch, and then reference the local copy in my package.json. One huge cavet, I could only install the dependencies (with yarn) and build it using Node 8 and Python 2.7.