Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
修改R小叶标记的大小_R_Leaflet_Markers - Fatal编程技术网

修改R小叶标记的大小

修改R小叶标记的大小,r,leaflet,markers,R,Leaflet,Markers,没有人知道是否有可能缩小R小叶标记的大小吗 请在下面找到一个可复制的示例 library(leaflet) leaflet(data = quakes[1:80,]) %>% addTiles() %>% addAwesomeMarkers(~long, ~lat, popup = ~as.character(mag), label = ~as.character(mag)) 我想缩小这些标记的大小,以便更好地区分它们。有什么建议吗 中有一节介绍自定义标记图标 它们显示,如果您

没有人知道是否有可能缩小R小叶标记的大小吗

请在下面找到一个可复制的示例

library(leaflet)
leaflet(data = quakes[1:80,]) %>% addTiles() %>%
  addAwesomeMarkers(~long, ~lat, popup = ~as.character(mag), label = ~as.character(mag))
我想缩小这些标记的大小,以便更好地区分它们。有什么建议吗

中有一节介绍自定义标记图标

它们显示,如果您指向图像(当前指向默认图像),则可以调整大小和位置参数。以下是他们给出的代码:

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:4,]) %>% addTiles() %>%
  addMarkers(~long, ~lat, icon = greenLeafIcon)
绿叶图标%addTiles()%%>%
addMarkers(~long,~lat,icon=greenleaveicon)
因此,如果您指向所需的图像并减小
iconWidth
值,您应该达到您的要求