leaflet-search icon indicating copy to clipboard operation
leaflet-search copied to clipboard

Search on the active Layer (change target with the radio button in L.control.layers)

Open novastra opened this issue 10 years ago • 2 comments

Hello,

First of all thank you very much for this usefull search solution.

Is there any way to alternate the target of the research with a helper function like getActiveLayer?

I would like to have a unique search field that switches target according to the active Layer in L.control.layers. The layers are not Json objects but arrays of coordinates. I have looked into the documentation of Leaflet and the search plugin but I have not found anything.

Thanks,

novastra avatar Nov 24 '14 14:11 novastra

@princeN Hi very interesting issue.. thank you too for this question. In a Leaflet map active layers can be more than one.. then I think that the best way could be to add new method in the Leaflet Control Search for select at run time the layer to searching... and switch it on map event layeradd

you're okay?

stefanocudini avatar Nov 29 '14 18:11 stefanocudini

Is possible searching with control search in the active layers of control?

javierlduq avatar Aug 15 '19 21:08 javierlduq