【发布时间】:2015-12-01 12:06:44
【问题描述】:
我正在学习使用小册子包在 R 中编程。 我想给图标一个角度,并尝试使用以下代码:
m <- leaflet()
m <- addTiles(m,urlTemplate = "http://xdworld.vworld.kr:8080/2d/Base/201310/{z}/{x}/{y}.png")
m = m %>% setView(127.074167,34.456806, zoom = 9)
arrowIcon <- makeIcon(
iconUrl = "arrow.png"
,iconWidth = 100, iconHeight = 100
,iconAnchorX = 25, iconAnchorY =25
)
arrowIcon <- makeIcon(
iconUrl = "ARROW_B2.png"
,iconWidth = 100, iconHeight = 100
,iconAnchorX = 25, iconAnchorY = 25
)
offset = 0.00 # zoom 10-> 0.03, 9->0.06, 8 -> 0.12, 7 -> 0.24
m_lat = 34.45 + offset
m_lon = 127.07 - offset
m <- addMarkers(m, lng=m_lon, lat= m_lat
, options = c( markerOptions(), iconAngle= 0)
,icon= arrowIcon)
m <- addCircles(m, lng=127.07, lat=34.45 , weight = 10,radius = 100)
m
但是,它不起作用。
【问题讨论】:
-
嗨,Seo 没有必要在那里添加不必要的粗体。而且也没有必要在代码块的底部放一行“=”。
-
谢谢 NSNoob。我太不够了,因为我是第一个。 :)
标签: r rotation icons leaflet angle