Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addSearchFeatures highlight multiple circles with same name #150

Open
noshealcrix opened this issue Aug 8, 2018 · 2 comments
Open

addSearchFeatures highlight multiple circles with same name #150

noshealcrix opened this issue Aug 8, 2018 · 2 comments

Comments

@noshealcrix
Copy link

noshealcrix commented Aug 8, 2018

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 ...

  • New York
  • Boston
  • Hartford
  • Philadelphia
  • Pittsburgh
  • Providence

",
position = "bottomright")`

@SNoboa
Copy link

SNoboa commented Oct 27, 2020

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

@trafficonese
Copy link
Owner

this is still an in issue in the upstream repo
stefanocudini/leaflet-search#261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants