传单中的自定义标记

Wil*_*ill 2 r leaflet shiny

有没有办法在R中获取传单的自定义标记图标?我已尝试使用本教程中提供的示例代码,但makeIcon函数似乎不存在.我试过的代码在这里,但它没有用.

http://rstudio.github.io/leaflet/markers.html

任何建议将不胜感激.总体目标是将其实现为一个闪亮的Web应用程序.

非常感谢

sym*_*ush 8

makeIcon函数确实存在,至少在我的传单包中..以下代码(来自教程)对我来说很好..

greenLeafIcon <- makeIcon(
  iconUrl = "http://leafletjs.com/examples/custom-icons/leaf-green.png",
  iconWidth = 38, iconHeight = 95,
  iconAnchorX = 22, iconAnchorY = 94,
  shadowUrl = "http://leafletjs.com/examples/custom-icons/leaf-shadow.png",
  shadowWidth = 50, shadowHeight = 64,
  shadowAnchorX = 4, shadowAnchorY = 62
)

leaflet(data = quakes[1:20,]) %>% addTiles() %>%
  addMarkers(~long, ~lat, ~as.character(mag), icon = greenLeafIcon)
Run Code Online (Sandbox Code Playgroud)