3

Be careful with your variable names. You're dangerously re-defining the variable c within your list comprehensions. Do this instead: counties = [x['long_name'] for x in c if 'neighborhood' in x['types']] localities = [x['long_name'] for x in c if 'locality' in x['types']] Better yet, use different names entirely so your code is easier to read and reason ...


1

A good tool is leaflet-control-geocoder (see demo with Google, Nominatim, Bing, and Mapbox services). I prefer to use Mapbox for geocoding, it works much better with US addresses compared to Nominatim, at least in Connecticut. You will need to create an account and get the public API key. With their new pricing rolled out in June 2019, you get 100,000 ...


1

You can try the leaflet-geosearch plugin. The OSM demo seems to be what you are looking for. There are other options you can find on leaflet's plugins page. Please remember that the quality of the results depends on the underlying data, Google works very hard on their data. That's why it's no longer free to use. Also note that the OSM Nominatim API is ...


Only top voted, non community-wiki answers of a minimum length are eligible