addGeosearch: Add a GeoSearch control to a Leaflet map

View source: R/geosearch.R

addGeosearchR Documentation

Add a GeoSearch control to a Leaflet map

Description

Adds a geocoding search widget to a leaflet map using the leaflet-geosearch plugin. Supports multiple providers such as OpenStreetMap, Esri, Google, HERE, etc.

Usage

addGeosearch(map, provider = geosearchProvider(), options = geosearchOptions())

Arguments

map

a map widget

provider

A provider list object created with e.g. 'geosearchProviderOSM()'.

options

A list of control options created with 'geosearchOptions()'.

Value

the new map object

References

https://github.com/smeijer/leaflet-geosearch

See Also

Other Geosearch Functions: geosearchOptions(), removeGeosearch()

Examples

library(leaflet)
library(leaflet.extras2)

leaflet() %>%
  addTiles() %>%
  addGeosearch()

leaflet.extras2 documentation built on Aug. 27, 2025, 5:10 p.m.