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

Tiles doesn't work with flyTo #551

Closed
DmitryMaletin opened this issue May 24, 2018 · 3 comments
Closed

Tiles doesn't work with flyTo #551

DmitryMaletin opened this issue May 24, 2018 · 3 comments

Comments

@DmitryMaletin
Copy link

DmitryMaletin commented May 24, 2018

flyTo & FlytoBounds - tiles disappear and cannot be added back

library(leaflet)
leaflet() %>% addTiles() %>% flyTo(-72, 40, 9)

Is it possible to show any example

@schloerke
Copy link
Contributor

Hi @DmitryMaletin,

The tiles are disappearing because a javascript error has occurred.

For the time being, please use setView() and fitBounds() instead of flyTo() and flyToBounds() for leaflet() map objects.

library(leaflet)
leaflet() %>% addTiles() %>% setView(-72, 40, 9)

-Barret

@DmitryMaletin
Copy link
Author

DmitryMaletin commented May 24, 2018

Hi @schloerke
Thx a lot.

I've found flyto will work only over proxy with previously initialized object.
if I understood correctly I should use something like

observe({
    
    
    leafletProxy("map") %>%
      flyTo(lan,lng,zoom) 
   
  })

but it mean it's only for shiny (which is fine for me )
-- DM

@schloerke
Copy link
Contributor

Exactly. flyTo and flyToBounds work with leafletProxy("NAME") objects.

#552 will give regular leaflet() objects a "flyTo" from a world view on widget load.

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

No branches or pull requests

2 participants