43 search control
Uncomment the following line to install leafmap if needed.
In [1]:
Copied!
# !pip install leafmap
# !pip install leafmap
In [2]:
Copied!
import leafmap
import leafmap
Add a search control to the map. See the Nominatim Usage Policy.
In [3]:
Copied!
m = leafmap.Map(draw_control=False)
url = "https://nominatim.openstreetmap.org/search?format=json&q={s}"
m.add_search_control(url)
m
m = leafmap.Map(draw_control=False)
url = "https://nominatim.openstreetmap.org/search?format=json&q={s}"
m.add_search_control(url)
m
The folium plotting backend does not support this function.
Out[3]:
Search for features in GeoJSON files or any GeoPandas supported vector data.
In [4]:
Copied!
m = leafmap.Map(draw_control=False, layers_control=True)
url = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/countries.geojson"
m.add_geojson(
url,
layer_name="Countries",
fill_colors=["red", "yellow", "green", "orange"],
info_mode=None,
)
m
m = leafmap.Map(draw_control=False, layers_control=True)
url = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/countries.geojson"
m.add_geojson(
url,
layer_name="Countries",
fill_colors=["red", "yellow", "green", "orange"],
info_mode=None,
)
m
Out[4]: