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

add new draw options, fix for removeDrawToolbar #184

Closed
wants to merge 1 commit into from
Closed

add new draw options, fix for removeDrawToolbar #184

wants to merge 1 commit into from

Conversation

trafficonese
Copy link
Owner

@trafficonese trafficonese commented Jan 30, 2020

Adds handlersOptions and toolbarOptions for addDrawToolbar which let you customize the drawing toolbar / tooltips.

This should close #174

This should also close #148, close #156 and close #165 .
The function removeFrom did not exist and was changed to remove and the typo drawToobar was corrected to drawToolbar

@claysa
Copy link

claysa commented Mar 25, 2020

Sorry for my ignorance, I'm really new to github... Are these fixes ready to use with the package, or going to be merged with the main branch soon? When that happens will I only need to update the package to be able to use them?

Thanks so much for all your work on this!

@trafficonese
Copy link
Owner Author

Unfortunately the package is not well maintained at the moment. Please read the comments of #188.

As soon as the PR is merged, you can install the new version with remotes::install_github("bhaskarvk/leaflet.extras") and once it is published to CRAN, you can run install.packages("leaflet.extras").

If you want to try the PR already, you can install it with remotes::install_github("bhaskarvk/leaflet.extras", ref = remotes::github_pull("184"))

@claysa
Copy link

claysa commented Mar 25, 2020

I'm trying the PR and so far so good, this is exactly what I was looking for. Thanks!

@nevilamos
Copy link

Hi, I have installed the PRs above - I tried both
rsion with remotes::install_github("bhaskarvk/leaflet.extras") and remotes::install_github("bhaskarvk/leaflet.extras", ref = remotes::github_pull("184"))

however neither of them fixed the removeDrawToolbar , with or without clearfeatures =T.

do I understand correctly that using this PR it should be possible to remove the toolbar and the drawn polyong featrue using the following?

leafletProxy('mymap')%>%
removeDrawToolbar(clearFeatures = T)

@trafficonese
Copy link
Owner Author

Yes, using this PR it should be possible to remove the draw-toolbar and the drawn shapes. This example works for me:

library(shiny)  
library(leaflet)
library(leaflet.extras)

ui <- fluidPage(
  leafletOutput("map"),
  actionButton("rm", "Remove Draw Toolbar")
)

server <- function(input, output, session) {
  output$map <- renderLeaflet({
    leaflet()  %>% 
      addTiles() %>% 
      addDrawToolbar()
  })
  
  observeEvent(input$rm, {
    leafletProxy('map')%>%
      removeDrawToolbar(clearFeatures = T)
  })
}
shinyApp(ui, server)

micahwilhelm added a commit to micahwilhelm/leaflet.extras that referenced this pull request Aug 20, 2021
@trafficonese trafficonese closed this by deleting the head repository Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants