I'm trying to reproduce the following jupyter notebook :


But once I'm trying to create the map I had to make a few changes to the search plugin because of the documentation:

citysearch = Search(layer=citygeo, 
                placeholder="Search for a US City", 

becomes, according to the folium documentation here :

citysearch = Search(data=citygeo, 

The issue is that, at best the search plugin doesn't appear and at worse my folium map isn't displayed. Does anyone have this problem as well ? Or is there any dependecies I've forgot ?

  • what does the browser console say? – bugmenot123 Feb 24 '19 at 21:13
  • Uncaught SyntaxError: Unexpected token < on this line : var macro_element_6d25be1d6f0b4126bc445bdd631cf103 = new L.GeoJSON(<folium.features.GeoJson object at 0x00000000886896D8>); – Brocolus Feb 24 '19 at 21:36
  • That hints at a lack of JavaScript understanding, I recommend you either learn some of that or go to the general programming stackoverflow.com for help on programming. – bugmenot123 Feb 25 '19 at 8:58
  • 1
    Ah, sorry, I forgot. :) Then this might hint at a Folium bug. Please provide a stackoverflow.com/help/mcve that exhibits the problem so we can help. – bugmenot123 Feb 25 '19 at 9:09
  • 1
    Thank you for your answers, I'll create a new question with a minimal example to put the problem clearer – Brocolus Feb 25 '19 at 9:55

Alright found the solution after couple days of research,

The example in the notebook is using a new search.pyfile which isn't updated in the folium document yet (as the working version is from december 23 2018 so it's very recent)

I just went to the pluginfolder to change the search.py with the github newest version Here Then it doesn't update automatically to my notebooks so I just created a new one and there it works !

  • 1
    Sweet! I was just going to notify you about the brand-new folium 0.8 release that just happened, as the search plugin is mentioned in its docs. I'll notify the author, so they fix their examples. Don't forget to mark your answer as solution! – bugmenot123 Feb 25 '19 at 15:19
  • 1
    Yes I saw it today, now it works perfectly ! Thank you again, today I can't mark solution yet (blocked by stackExchange), I will put a mark tomorrow – Brocolus Feb 25 '19 at 17:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.