【问题标题】:is it possible to add OCHA icon to leaflet map in r?是否可以在 r 中将 OCHA 图标添加到传单地图?
【发布时间】:2021-11-13 08:47:23
【问题描述】:

我正在为人道主义目的制作传单地图,因此我需要将 OCHA 图标用于我地图上的对象。但我找不到将 OCHA 图标插入 R 环境的任何库。任何解决方案? 谢谢

【问题讨论】:

    标签: r dictionary leaflet icons interactive


    【解决方案1】:

    看我的例子

    library(png)
    library(grid)
    library(tidyverse)
    
    
    g1 = readPNG("icons/Advocacy.png") %>% rasterGrob(interpolate=TRUE)
    g2 = readPNG("icons/Add-document.png") %>% rasterGrob(interpolate=TRUE)
    
    mi_counties <- map_data("county", "michigan") %>% 
      select(lon = long, lat, group, id = subregion)
    
    ggplot(mi_counties, aes(lon, lat)) + 
      geom_point(size = .25, show.legend = FALSE) +
      annotation_custom(g1, xmin=-88, xmax=-88.5, ymin=45, ymax=45.5)+
      annotation_custom(g2, xmin=-84, xmax=-84.5, ymin=42, ymax=42.5)
    
    

    我以 png 格式保存了 OCHA 图标。 svg 格式有问题。

    【讨论】:

      猜你喜欢
      • 2018-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-31
      • 2011-09-16
      • 1970-01-01
      • 2018-06-09
      • 1970-01-01
      相关资源
      最近更新 更多