View source: R/plugin-search.R
addSearchMarker | R Documentation |
Add a marker search control to the map.
addSearchMarker(map, group, position = "topright", propertyName = "label",
initial = FALSE)
map |
a map widget object |
group |
a searchable group |
position |
standard Leaflet control position options. |
propertyName |
property in marker.options(or feature.properties for vector layer) trough filter elements in layer |
initial |
search elements only by initial text |
modified map
data(quakes)
leaflet(data = quakes) %>%
addTiles() %>%
addMarkers(~long, ~lat, popup = ~as.character(mag),
group = 'marker', label = ~as.character(mag)) %>%
addSearchMarker('marker', position = 'topleft', propertyName = 'popup')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.