You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can anybody point me towards how to add a Search box on Folium?
I know Leaflet has this functionality but couldn't find any documentation on Folium.
Thanks in advance.
Reacted by kcnwogu, taut-and-yare, Michael Galarnyk, Rick B, Magomed Shamaev and Chris Abraham
I have started to work on the leaflet-search plugin, it is awaiting a Pull Request, if you're still interested in this plugin a peer review would be great.
Sent from my iPhone
On 18 Oct 2017, at 05:54, morteza3000 <notifications@github.com<mailto:notifications@github.com>> wrote:
@ghandic<https://github.com/ghandic>
Thanks a lot but I faced with below error when I wanted to run notebook.
________________________________
AttributeError Traceback (most recent call last)
in ()
9 )
10
---> 11 plugins.Search(states, search_zoom=6, geom_type="Polygon").add_to(m)
12
13 m.save(os.path.join('results', 'Plugins_search_polygon.html'))
AttributeError: 'module' object has no attribute 'Search'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#464 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AWaWQfVU5m1VVUKMtElcRinPjvmydO2Oks5stYRpgaJpZM4JNCFm>.
sorry I'm totally new to folium, I've just install folium by pip and add your search.py file to "C:\ProgramData\Anaconda2\Lib\site-packages\folium\plugins". is it write?
can you help what to do step by step?
is there a search plugin that works for FastMarkerCluster? I can't use MarkerCluster because it hinders the load performance because I'm using over 11,000 markers.
Looking at the Search plugins python file, search is currently only implemented for GeoJson and TopoJson. I'm not entirely sure as to why the documentation states that it also implements the search for FeatureGroup and MarkerClusters. Maybe there were/are plans down the line for it (?)
Activity
ocefpaf commentedon Aug 25, 2017
There is no search box on
folium. One could add a plugin for the https://github.com/stefanocudini/leaflet-search and implement it.PRs welcome 😄
ghandic commentedon Oct 16, 2017
@sangyh
I have started to work on the leaflet-search plugin, it is awaiting a Pull Request, if you're still interested in this plugin a peer review would be great.
morteza3000 commentedon Oct 17, 2017
@ocefpaf
can you please help more about mentioned plugin, how to install or add to a folium project?
ghandic commentedon Oct 17, 2017
morteza3000 commentedon Oct 17, 2017
No I didn't, can you please give me the name of that example notebook?
ghandic commentedon Oct 17, 2017
morteza3000 commentedon Oct 17, 2017
I'll really appreciate if you can share it.
ghandic commentedon Oct 17, 2017
PR: #747
https://github.com/ghandic/folium/blob/search-features/examples/Plugins-Search.ipynb
(all of the data is self contained in the notebook - this will be changed shortly. This search feature is on my feature-seach branch
ocefpaf commentedon Oct 17, 2017
morteza3000 commentedon Oct 18, 2017
@ghandic
Thanks a lot but I faced with below error when I wanted to run notebook.
AttributeError Traceback (most recent call last)
in ()
9 )
10
---> 11 plugins.Search(states, search_zoom=6, geom_type="Polygon").add_to(m)
12
13 m.save(os.path.join('results', 'Plugins_search_polygon.html'))
AttributeError: 'module' object has no attribute 'Search'
ghandic commentedon Oct 18, 2017
morteza3000 commentedon Oct 18, 2017
sorry I'm totally new to folium, I've just install folium by pip and add your search.py file to "C:\ProgramData\Anaconda2\Lib\site-packages\folium\plugins". is it write?
can you help what to do step by step?
ghandic commentedon Oct 18, 2017
run this:
pip uninstall -y foliumpip install git+https://github.com/ghandic/folium.git@search-featuresYou will then have the latest development that has not been merged into master.
35 remaining items
ms77grz commentedon Mar 28, 2019
Hi guys! Can anyone help me with search function? How can I find a marker by typing "one" in searchbar?
from folium import plugins, Map, Marker, FeatureGroup, Popup, LayerControl
import webbrowser
m = Map(location=[43.25, 45.83333 ], zoom_start=10, zoom_control=False)
fg = FeatureGroup(name='VTK')
g1 = plugins.FeatureGroupSubGroup(fg, 'FTTB')
g2 = plugins.FeatureGroupSubGroup(fg, 'FTTH')
g3 = plugins.FeatureGroupSubGroup(fg, 'GPON')
Marker([43.119749, 45.562305], popup=Popup('one')).add_to(g1)
Marker([43.143048, 45.534987], popup=Popup('two')).add_to(g2)
Marker([43.131022, 45.546844], popup=Popup('three')).add_to(g3)
m.add_child(fg)
m.add_child(g1)
m.add_child(g2)
m.add_child(g3)
m.add_child(plugins.Search(fg))
m.add_child(LayerControl(collapsed=False))
m.save('test_map2.html')
webbrowser.open('test_map2.html')
morteza3000 commentedon Apr 6, 2019
@ghandic , when I install it with (> pip install folium) below error appears for same examples.
can you please help?
AssertionError: Search can only index FeatureGroup, MarkerCluster, GeoJson, and TopoJson layers at this time.
ghandic commentedon Apr 6, 2019
morteza3000 commentedon Apr 7, 2019
Yes, your example notebooks also don't work with provided data.
ghandic commentedon Apr 7, 2019
Conengmo commentedon Apr 7, 2019
@morteza3000 please open a new issue for your problem and include:
print(folium.__version__)morteza3000 commentedon Apr 7, 2019
@Conengmo , please be informed that below issue has been raised.
Problem with Folium search plugin (loading Geojosn Data) #1125
chillinshunsui commentedon Mar 22, 2020
hey, can you share the code
ghandic commentedon Mar 22, 2020
Check out the example notebooks https://github.com/python-visualization/folium/blob/master/examples/plugin-Search.ipynb
GinoVillalpando commentedon Apr 22, 2020
is there a search plugin that works for FastMarkerCluster? I can't use MarkerCluster because it hinders the load performance because I'm using over 11,000 markers.
morteza3000 commentedon Apr 23, 2020
@ghandic , How we can style points in your example?
citygeo = folium.GeoJson(
pop_ranked_cities,
name='US Cities',
tooltip=folium.GeoJsonTooltip(
fields=['nameascii','pop_max'],
aliases=['','Population Max'],
localize=True)
).add_to(m)
how to add style_function to this in order to change points color or use custom icon?
f2daz commentedon Jun 3, 2020
Hey everyone,
as the docs say, the search plugin can index FeatureGroup, MarkerCluster, GeoJson and TopoJson layers.
It only worked for me on GeoJson layers so far.
Could you please provide an example for FeatureGroup or MarkerCluster without GeoJson?
Thanks in advance ;)
PhilippMDoerner commentedon Jun 25, 2020
Looking at the Search plugins python file, search is currently only implemented for GeoJson and TopoJson. I'm not entirely sure as to why the documentation states that it also implements the search for FeatureGroup and MarkerClusters. Maybe there were/are plans down the line for it (?)
asemrbehat commentedon Mar 14, 2021
Hi, is there any way to do it by HTML ?
I cant link the search box with the markers in order to search for them </>
AtharvaShekatkar commentedon Sep 20, 2023
@ghandic hey, could you help me with using the search plugin for FeatureGroup layers? I've not been able to find a working solution for that anywhere.