Leaflet markers not rendering in Quarto but render in R Markdown

The following code renders properly in RMD but not in Quarto. The code places a green marker with a red icon using RMD rendering, but places an "iconless" blue marker using Quarto rendering . Quarto does display the green marker with a red icon in the working document. Any thoughts why? Thanks.

library(leaflet)
leaflet() |> addTiles() |>
  addAwesomeMarkers(
    lat = 41.97860,
    lng = -87.90480,
    icon = 
      awesomeIcons(
        icon        = "plane", 
        library     = "glyphicon", 
        iconColor   = "red", 
        markerColor = "green"
      )
    )

rmd

Hi,
according to a similar question https://stackoverflow.com/questions/49806342/glyphicons-is-not-showing-in-browser-using-bootstrap-in-html-code bootstrap dropped the support for glyphicon since version 4.
Now since quarto is using bootstrap in its 5 version (v5.1.3 for my setup) you will se nothing.

If you just switch from glyphicon to fa in your code you should be fine.

Full Code:

---
title: "Leaflet markers not rendering in Quarto but render in R Markdown"
format: html
editor: visual
self-contained: true
theme: default
---

## Code

```{r}
#https://github.com/rstudio/leaflet/tree/main/inst/htmlwidgets/plugins/Leaflet.awesome-markers
library(leaflet)
leaflet() |> addTiles() |>
  addAwesomeMarkers(
    lat = 41.97860,
    lng = -87.90480,
    icon = 
      awesomeIcons(
        icon        = "plane", 
        library     = "fa", 
        iconColor   = "red", 
        markerColor = "green"
      )
    )

Output:

Rmarkdown still uses bootstrap in its 3 version (v.3.3.7 for my setup) so glyphicon is supported and shown as expected.

Hope it clarifies your question.

1 Like

Hello, Wonderful! That did it. Thank you so much !

Great! Please close the issue so that it is properly marked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.