Search code examples
rshinyleafletr-leaflet

Shinyapp Leaflet map doesn't display markers correctly in Chrome


I made an RShiny app with a leaflet map that has markers. The marker icons work just fine in Safari and Firefox, but in Chrome they do not render and instead a different icon is displayed.

The app is the Interactive GSSP App. It is being hosted on shinyapps.io at: https://lotkey.shinyapps.io/interactive_gssp_app/
Here is the source code: https://github.com/lotkey/DTKB-Apps

The part where the icon is made is in appServer.R at line 43.

# Make "custom" icon with golden spike image
gsspIcon <- makeIcon(
  iconUrl = "http://www2.cs.uidaho.edu/~max/image/gssp.png",
  iconWidth = 20, iconHeight = 32,
  iconAnchorX = 10, iconAnchorY = 32  
)

The image link is still working for me, so I'm not sure what the issue is.

Markers not displaying properly in Chrome


Solution

  • Still not sure what the issue exactly is, but instead of using an image URL I downloaded the image and included it in the app.

    # Make "custom" icon with golden spike image
    gsspIcon <- makeIcon(
      iconUrl = "./gssp.png", # Path to local image
      iconWidth = 20, iconHeight = 32,
      iconAnchorX = 10, iconAnchorY = 32  
    )