0

Leaflet as standalone map

The map above renders perfectly fine in the following scenarios:

  • List item
  • RStudio Viewer
  • Shiny app
  • Shiny app using a minimal Shiny dashboard sceleton

When including the map in an existing, pretty complex Shiny dashboard, the looks as follows:

enter image description here

Obviously, the legend is missing. On top of that, the "reset view" action button has no effect.

Without posting the complete code of the complex shiny dashbboard, I would like make the following comments:

  • I have disabled all custom JS code and CSS
  • I use a bare "renderLeaflet" function without additional arguments
  • I have also tried to display the leaflet in a bare dashboard box without any further arguments

Any obvious culprit anyone could think of causing this issue? Anyone observed similar issues?

Oliver
  • 441
  • 6
  • 14
  • It is very difficult to help you without code. Instead of posting your entire code, you should try to create a minimal reproducible example, for some tips on how to do that you can see [here](https://stackoverflow.com/questions/48343080/how-to-convert-a-shiny-app-consisting-of-multiple-files-into-an-easily-shareable). This will not only make it much easier to help, in this case I think it is also likely that you find out which part of your code causes the issue in the process. – Florian Jun 21 '18 at 13:42
  • The problem is that the minimal reproducible shiny dashboard example acutally works and results in the first map shown in my post. The actual problem only occurrs when putting the leaflet into the much more complex Shiny app (~ 3000 lines of code). The intention of my question is just to check if for someone this scenario rings a bell. Hope this makes sense. – Oliver Jun 21 '18 at 13:56

1 Answers1

0

I wonder if you solved the issue. I noticed the legend of a raster layer disappears when using the function d3heatmap, for instance d3heatmap(mtcars, scale="column", colors="Blues"). When the line with the heatmap is commented out the dashboard knites just fine -even when the library d3heatmap is loaded. I used the code from this example. Oh I just noticed this has been addressed and solved in other questions, for example here.

Shepherd
  • 438
  • 3
  • 10