zakjan / leaflet-lasso

Lasso selection plugin for Leaflet

Home Page:https://zakjan.github.io/leaflet-lasso/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

performance for too many layers

SixiCat opened this issue · comments

hi!
there is a project that has too many layers, leaflet-lasso needs 10~20s until the lasso selection is done.
so, is there a option that make lasso just pick selected layer in the given layers,instead of the map's all layers.

thanks!!!

Hi @SixiCat, performance was improved in #24, have you tried the latest release? There is no such option yet, it checks all layers. Do you activate lasso by the provided control or handler? What do you mean by "selected layer", could you post an example?

sorry, it's my fault. The "selected layer" is point this
image
source code.

If there is an option that can set the layers before activate lasso, we don't need to waste time on irrelevant layers.
image

Would adding a filter function option work for your use case?

export interface LassoHandlerOptions {
    polygon?: L.PolylineOptions,
    intersect?: boolean;
    filter?: (layer: L.Layer) => boolean;
}

thanks for your work.
I also think it will help for my project.