2015-07-21 91 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)