trafficonese / leaflet.extras

Extra functionality for leaflet R package.
https://trafficonese.github.io/leaflet.extras/
GNU General Public License v3.0
213 stars 74 forks source link

addSearchFeatures highlight multiple circles with same name #150

Open noshealcrix opened 6 years ago

noshealcrix commented 6 years ago

Is it possible to use the addSearchFeatures option to highlight multiple circles that share the same name?

Using the Cities example, if there were two cities with the name "Boston", but in two different locations, can the search features option highlight both of those cities? Thanks

`#' ### Search Markers

Markers ----

cities <- read.csv(textConnection(" City,Lat,Long,Pop Boston,42.3601,-71.0589,645966 Boston,41.7627,-72.6743,125017 New York City,40.7127,-74.0059,8406000 Philadelphia,39.9500,-75.1667,1553000 Pittsburgh,40.4397,-79.9764,305841 Providence,41.8236,-71.4222,177994 "))

leaflet(cities) %>% addProviderTiles(providers$OpenStreetMap) %>% addCircles(lng = ~Long, lat = ~Lat, weight = 1, fillOpacity = 0.5, radius = ~sqrt(Pop) * 10, popup = ~City, label = ~City, group = "cities") %>% addResetMapButton() %>% addSearchFeatures( targetGroups = "cities", options = searchFeaturesOptions( zoom = 12, openPopup = TRUE, firstTipSubmit = TRUE, autoCollapse = TRUE, hideMarkerOnCollapse = TRUE )) %>% addControl("

Hint! Search for ...

", position = "bottomright")`

SNoboa commented 3 years ago

Hi, I have the same question. Do you resolve the problem? Thanks!!

trafficonese commented 5 months ago

this is still an in issue in the upstream repo https://github.com/stefanocudini/leaflet-search/issues/261