2015-07-21 56 views

回答

7

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)