1
我想在我的多邊形周圍添加黑色邊框。看到下面的圖片我到目前爲止。R,傳單多邊形添加黑色邊框
我用這個代碼。我不知道我可以如何包含一個zip文件,使其可重現。
library("rgdal")
library("leaflet")
amsterdam.districts <- shapefile("~/R/Shiny/Shapefiles/sd2010zw_region.shp")
amsterdam.districts <- spTransform(amsterdam.districts, CRS("+init=epsg:4326"))
amsterdam.districts$STADSDEELN<- c("Centrum","Westpoort","West","Nieuw West","Zuid","Oost","Noord","Zuidoost")
amsterdam.districts$SDNUMMER=as.factor(amsterdam.districts$SDNUMMER)
factpal=colorFactor(brewer.pal(n = 11, name ="Spectral") , amsterdam.districts$SDNUMMER)
leaflet() %>%
addPolygons(
data =amsterdam.districts,
stroke = FALSE, fillOpacity = 0.5, smoothFactor = 0.5,
color = "grey",
fillColor = ~factpal(SDNUMMER),
layerId = [email protected]$STADSDEELN)%>%
addProviderTiles("CartoDB.Positron", options= providerTileOptions(opacity = 1))
感謝您的閱讀!
的Martijn
有時候可以很簡單,非常感謝! @TimSalabim –