Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add opacity choices #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions R/demoMap.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
##' @examples
##' demomap("china")
##' @export
demomap = function(mapName){
demomap = function(mapName, opacity=0.2){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加新参数请在第九行 @param里面增加一个描述~

后面的Rd文档都是用roxygen2::roxygenise()函数自动生成的,会把上面的注释转化为文档

# if(.Platform$OS.type == "windows"){
# locate = Sys.getlocale("LC_CTYPE")
# Sys.setlocale("LC_CTYPE","eng")
Expand All @@ -30,8 +30,10 @@ demomap = function(mapName){
output = map %>% leaflet::addTiles() %>%
leaflet::addPolygons(stroke = T,
smoothFactor = 0.2,
fillOpacity = 0.2,
# fillColor = ~color,
fillOpacity = opacity,
fillColor = 'grey',
color = 'white',
opacity = 1,
weight = 1,
popup = ~htmltools::htmlEscape(popup))
#
Expand Down
1 change: 1 addition & 0 deletions man/demomap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.