Description Usage Arguments Value Examples
Add a OSM search control to the map.
Removes the OSM search control from the map.
Add a Google search control to the map.
Removes the Google search control from the map.
Add a US Census Bureau search control to the map.
Removes the US Census Bureau search control from the map.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | addSearchOSM(map, options = searchOptions(autoCollapse = TRUE, minLength = 2))
removeSearchOSM(map)
addReverseSearchOSM(map, showSearchLocation = TRUE, showBounds = FALSE,
showFeature = TRUE, fitBounds = TRUE, displayText = TRUE,
group = NULL)
addSearchGoogle(map, apikey = Sys.getenv("GOOGLE_MAP_GEOCODING_KEY"),
options = searchOptions(autoCollapse = TRUE, minLength = 2))
removeSearchGoogle(map)
addReverseSearchGoogle(map, apikey = Sys.getenv("GOOGLE_MAP_GEOCODING_KEY"),
showSearchLocation = TRUE, showBounds = FALSE, showFeature = TRUE,
fitBounds = TRUE, displayText = TRUE, group = NULL)
addSearchUSCensusBureau(map, options = searchOptions(autoCollapse = TRUE,
minLength = 20))
removeSearchUSCensusBureau(map)
|
map |
a map widget object |
options |
Search Options |
showSearchLocation |
Boolean. If TRUE displays a Marker on the searched location's coordinates. |
showBounds |
Boolean. If TRUE show the bounding box of the found feature. |
showFeature |
Boolean. If TRUE show the found feature. Depending upon the feature found this can be a marker, a line or a polygon. |
fitBounds |
Boolean. If TRUE set maps bounds to queried and found location.
For this to be effective one of |
displayText |
Boolean. If TRUE show a text box with found location's name on the map. |
group |
String. An optional group to hold all the searched locations and their results. |
apikey |
String. API Key for Google GeoCoding Service. |
modified map
modified map
modified map
modified map
modified map
modified map
modified map
modified map
1 2 3 4 5 6 7 | leaflet() %>%
addProviderTiles(providers$Esri.WorldStreetMap) %>%
addResetMapButton() %>%
addSearchGoogle()
## for more examples see
# browseURL(system.file("examples/search.R", package = "leaflet.extras"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.