R语言leaflet.extras2包,addAntpath动画线条,贪吃蛇,火车图
# Fri May 27 17:07:55 2022 edit
# 字符编码:UTF-8
# R 版本:R 4.2.0 x64 for window 11
# cgh163email@163.com
# 个人笔记不负责任,拎了个梨🍐🍈
#.rs.restartR()
require(leaflet.extras2)
rm(list = ls());gc()
library(leaflet)
require(sf)
require(leafletCN)
View(atlStorms2005)
leaflet() |>
addAntpath(data = atlStorms2005)
#diy1 Fri May 27 17:08:12 2022 ------------------------------
leaflet() |>
amap() |>
addAntpath(
lng = c(113,117,115),
lat = c(21,22,23),
layerId = 'a'
)
#end Fri May 27 17:08:17 2022 ---
#ex2 Fri May 27 17:12:16 2022 ------------------------------
l.dt <-sf::st_read('罗浮百公里标注.geojson') |>
st_coordinates(l.dt) |> as.data.frame()
names(l.dt) <- c('lng','lat','z')
leaflet() |>
amap() |>
addAntpath(
data = l.dt,
lng = ~lng,
lat = ~lat
)
# Fri May 27 17:24:59 2022 ---
leaflet() |>
amap() |>
addAntpath(
data = l.dt,
lng = ~lng,
lat = ~lat,
color = 'green'#颜色
,weight = '3' # 粗细
,opacity = .7 # 透明度
,fill = T # 填充为多边形
,fillColor = 'red' # 填充颜色
,fillOpacity =.2 # 填充透明度
,dashArray = 2
,smoothFactor = 10 # 精细度
,noClip = F # 是否裁剪
,label = 'aa🍐' # 显示标签
)
#end Mon May 30 10:05:25 2022 ---