2
有沒有什麼方法可以在R中獲取小冊子的自定義標記圖標?我曾嘗試使用教程中提供的示例代碼,但makeIcon函數似乎不存在。我試過的代碼在這裏,但沒有奏效。小冊子中的自定義標記
http://rstudio.github.io/leaflet/markers.html
任何建議,將不勝感激。總體目標是將其實現爲一個閃亮的Web應用程序。
非常感謝
有沒有什麼方法可以在R中獲取小冊子的自定義標記圖標?我曾嘗試使用教程中提供的示例代碼,但makeIcon函數似乎不存在。我試過的代碼在這裏,但沒有奏效。小冊子中的自定義標記
http://rstudio.github.io/leaflet/markers.html
任何建議,將不勝感激。總體目標是將其實現爲一個閃亮的Web應用程序。
非常感謝
的makeIcon
功能的確存在,至少在我的宣傳單包.. 下面的代碼(從tutorial)正常工作對我..
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)